From 9449b23bbca71471a64f914b4bc7ec7d810e587f Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sun, 12 Aug 2018 22:34:43 -0600 Subject: * Several changes to the compilation of Alpine in Windows to use LibreSSL in connecting to external servers. This complements the changes to support S/MIME. In particular, we add support for validation of certificates by using C:\\libressl\ssl\certs as the place to save CA certificates. In order to help users, some certificates are distributed. TODO: Kerberos port, w2k. --- imap/src/osdep/nt/proc.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 imap/src/osdep/nt/proc.c (limited to 'imap/src/osdep/nt/proc.c') diff --git a/imap/src/osdep/nt/proc.c b/imap/src/osdep/nt/proc.c new file mode 100644 index 00000000..8fc3c4ee --- /dev/null +++ b/imap/src/osdep/nt/proc.c @@ -0,0 +1,80 @@ +/* + * Copyright 2018 Eduardo Chappa + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +#include +#include +#include +#include + +int main(int, char **); + +int +main(int argc, char *argv[]) +{ + int rv = 0, i; + FILE *fph, *fpc, *fpa; + char *opt; + + fph = fpc = fpa = NULL; + if(argc < 2){ + fprintf(stdout, "Not enough arguments.\n"); + fprintf(stdout, "Usage: %s opt ...\n", argv[0]); + fprintf(stdout, "opt can be drivers, mkauths, version, setproto or sslinit\n"); + exit(1); + } + + opt = argv[1]; + if(!strcmp(opt, "drivers")){ + fph = fopen("linkage.h", "w"); + fpc = fopen("linkage.c", "w"); + for (i = 2; i < argc; i++){ + fprintf(fph, "extern DRIVER %sdriver;\n", argv[i]); + fprintf(fpc, " mail_link (&%sdriver); /* link in the %s driver */\n", + argv[i], argv[i]); + } + } + else if(!strcmp(opt, "mkauths")){ + fph = fopen("linkage.h", "a"); + fpc = fopen("linkage.c", "a"); + fpa = fopen("auths.c", "w"); + for (i = 2; i < argc; i++){ + fprintf(fph, "extern AUTHENTICATOR auth_%s;\n", argv[i]); + fprintf(fpc, " auth_link (&auth_%s); /* link in the %s authenticator */\n", + argv[i], argv[i]); + fprintf(fpa, "#include \"auth_%s.c\"\n", argv[i]); + } + } + else if(!strcmp(opt, "setproto")){ + if(argc != 4){ + fprintf(stdout, "setproto requires two additional arguments\n"); + exit(1); + } + fph = fopen("linkage.h", "a"); + fprintf(fph, "#define CREATEPROTO %sproto\n", argv[2]); + fprintf(fph, "#define APPENDPROTO %sproto\n", argv[3]); + } + else if(!strcmp(opt, "sslinit")){ + fpc = fopen("linkage.c", "a"); + fprintf(fpc, "%s\n", "ssl_onceonlyinit();"); + } + else if(!strcmp(opt, "version")){ + fpc = fopen("linkage.c", "a"); + fprintf(fpc, "%s\n", "mail_versioncheck(CCLIENTVERSION);"); + } + else { + fprintf(stdout, "Try: \"drivers\", \"mkauths\", \"setproto\", \"sslinit\", or \"version\".\n"); + exit(1); + } + if(fpa != NULL) fclose(fpa); + if(fpc != NULL) fclose(fpc); + if(fph != NULL) fclose(fph); + exit(0); +} -- cgit v1.2.3-54-g00ecf