diff options
author | Eduardo Chappa <chappa@washington.edu> | 2019-09-06 21:36:38 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2019-09-06 21:36:38 -0600 |
commit | f7b373f085992290c427392a28984c2ddc1553ba (patch) | |
tree | 60a9ccf460bff534b8f350a40b955986031a79d3 /imap/src/osdep/unix/ssl_unix.c | |
parent | a7f1ee6fbe1aa46f7bcc0d40740e0b6c98a12692 (diff) | |
download | alpine-f7b373f085992290c427392a28984c2ddc1553ba.tar.xz |
* Fixes so that Alpine will build in the Windows operating system. This
update takes care of building with LibreSSL.
Diffstat (limited to 'imap/src/osdep/unix/ssl_unix.c')
-rw-r--r-- | imap/src/osdep/unix/ssl_unix.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c index 04da2d34..78b6c839 100644 --- a/imap/src/osdep/unix/ssl_unix.c +++ b/imap/src/osdep/unix/ssl_unix.c @@ -93,6 +93,41 @@ static long ssl_abort (SSLSTREAM *stream); static RSA *ssl_genkey (SSL_CTX_TYPE *con,int export,int keylength); +typedef struct ssl_versions_s { + char *name; + int version; +} SSL_VERSIONS_S; + +int +pith_ssl_encryption_version(char *s) +{ + SSL_VERSIONS_S ssl_versions[] = { + { "no_min", 0 }, + { "ssl3", SSL3_VERSION }, + { "tls1", TLS1_VERSION }, + { "tls1_1", TLS1_1_VERSION }, + { "tls1_2", TLS1_2_VERSION }, +#ifdef TLS1_3_VERSION + { "tls1_3", TLS1_3_VERSION }, +#endif /* TLS1_3_VERSION */ + { "no_max", 0 }, /* set this last in the list */ + { NULL, 0 }, + }; + int i; + + if (s == NULL || *s == '\0') + return -1; + + for (i = 0; ssl_versions[i].name != NULL; i++) + if (strcmp(ssl_versions[i].name, s) == 0) + break; + + if (strcmp(s, "no_max") == 0) i--; + + return ssl_versions[i].name != NULL ? ssl_versions[i].version : -1; +} + + /* Secure Sockets Layer network driver dispatch */ |