diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-12-02 10:52:21 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-12-02 10:52:21 +0000 |
commit | 63c5690ab11850647c7ed440c9833fd2f438a67e (patch) | |
tree | 119e9b472ba12f23bd66581f9c2f1439eb5498a4 /imap | |
parent | 2904d2a62d62b443f6a05df1666e587a32754561 (diff) |
SSL fixes from Tommi Kommulainen.
Diffstat (limited to 'imap')
-rw-r--r-- | imap/imap_ssl.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/imap/imap_ssl.c b/imap/imap_ssl.c index e6b99c8b..09c35473 100644 --- a/imap/imap_ssl.c +++ b/imap/imap_ssl.c @@ -29,6 +29,11 @@ #include "mutt_curses.h" #include "imap_ssl.h" +#if OPENSSL_VERSION_NUMBER >= 0x00904000L +#define READ_X509_KEY(fp, key) PEM_read_X509(fp, key, NULL, NULL) +#else +#define READ_X509_KEY(fp, key) PEM_read_X509(fp, key, NULL) +#endif char *SslCertFile = NULL; @@ -176,7 +181,7 @@ static int ssl_check_certificate (sslsockdata * data) EVP_PKEY *peer = X509_get_pubkey (data->cert); X509 *savedkey = NULL; int pass = 0; - while ((savedkey = PEM_read_X509 (fp, &savedkey, NULL))) + while ((savedkey = READ_X509_KEY (fp, &savedkey))) { if (X509_verify (savedkey, peer)) { @@ -218,9 +223,17 @@ static int ssl_check_certificate (sslsockdata * data) snprintf (menu->dialog[14], SHORT_STRING, _("Fingerprint: %s"), buf); menu->title = _("SSL Certificate check"); - menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always"); - menu->keys = _("roa"); - + if (SslCertFile) + { + menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always"); + menu->keys = _("roa"); + } + else + { + menu->prompt = _("(r)eject, accept (o)nce"); + menu->keys = _("ro"); + } + helpstr[0] = '\0'; mutt_make_help (buf, sizeof (buf), _("Exit "), MENU_GENERIC, OP_EXIT); strncat (helpstr, buf, sizeof (helpstr)); |