]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Copy key password correctly
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 20 Apr 2020 08:11:28 +0000 (11:11 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 4 May 2020 07:21:39 +0000 (07:21 +0000)
OpenSSL failed to decrypt key because the password context
was copied instead of the password.

Broken in e98de01b564

src/lib-ssl-iostream/iostream-openssl-context.c

index ebb7c0c3cafd63827d12f441475d496a9cf24190..cf33db24fc5ed9744b724aac92e0ea7301518546 100644 (file)
@@ -66,7 +66,7 @@ pem_password_callback(char *buf, int size, int rwflag ATTR_UNUSED,
                return 0;
        }
 
-       if (i_strocpy(buf, userdata, size) < 0) {
+       if (i_strocpy(buf, ctx->password, size) < 0) {
                ctx->error = "SSL private key password is too long";
                return 0;
        }