From: Aki Tuomi Date: Mon, 20 Apr 2020 08:11:28 +0000 (+0300) Subject: lib-ssl-iostream: Copy key password correctly X-Git-Tag: 2.3.11.2~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=001982e04471090804dd0ffb9189425cee98f0df;p=thirdparty%2Fdovecot%2Fcore.git lib-ssl-iostream: Copy key password correctly OpenSSL failed to decrypt key because the password context was copied instead of the password. Broken in e98de01b564 --- diff --git a/src/lib-ssl-iostream/iostream-openssl-context.c b/src/lib-ssl-iostream/iostream-openssl-context.c index ebb7c0c3ca..cf33db24fc 100644 --- a/src/lib-ssl-iostream/iostream-openssl-context.c +++ b/src/lib-ssl-iostream/iostream-openssl-context.c @@ -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; }