]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Indicate that password might be wrong when decrypting key
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 20 Apr 2020 19:59:14 +0000 (22:59 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 4 May 2020 07:21:40 +0000 (07:21 +0000)
src/lib-ssl-iostream/iostream-openssl-context.c

index cf33db24fc5ed9744b724aac92e0ea7301518546..a5a9cf3e8d5de0c8c8a7a7c8719c25f379d879bb 100644 (file)
@@ -97,8 +97,12 @@ int openssl_iostream_load_key(const struct ssl_iostream_cert *set,
        pkey = PEM_read_bio_PrivateKey(bio, NULL, pem_password_callback, &ctx);
        if (pkey == NULL && ctx.error == NULL) {
                ctx.error = t_strdup_printf(
-                       "Couldn't parse private SSL key (%s setting): %s",
-                       set_name, openssl_iostream_error());
+                       "Couldn't parse private SSL key (%s setting)%s: %s",
+                       set_name,
+                       ctx.password != NULL ?
+                               " (maybe ssl_key_password is wrong?)" :
+                               "",
+                       openssl_iostream_error());
        }
        BIO_free(bio);