From: Selva Nair Date: Fri, 26 Jul 2019 20:39:17 +0000 (-0400) Subject: Correct the return value of cryptoapi RSA signature callbacks X-Git-Tag: v2.5_beta1~296 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4ac6b780db2e0c3b60d180bd6545efe30a52059;p=thirdparty%2Fopenvpn.git Correct the return value of cryptoapi RSA signature callbacks Fixes the wrong check on siglen instead of *siglen for signing failures. Bug reported by: lilulo Signed-off-by: Selva Nair Acked-by: Steffan Karger Message-Id: <1564173557-11776-1-git-send-email-selva.nair@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18706.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/cryptoapi.c b/src/openvpn/cryptoapi.c index 0c11712ef..2f2eee771 100644 --- a/src/openvpn/cryptoapi.c +++ b/src/openvpn/cryptoapi.c @@ -499,7 +499,7 @@ rsa_sign_CNG(int type, const unsigned char *m, unsigned int m_len, *siglen = priv_enc_CNG(cd, alg, m, (int)m_len, sig, RSA_size(rsa), cng_padding_type(padding), 0); - return (siglen == 0) ? 0 : 1; + return (*siglen == 0) ? 0 : 1; } /* decrypt */ @@ -973,7 +973,7 @@ pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, *siglen = priv_enc_CNG(cd, alg, tbs, (int)tbslen, sig, *siglen, cng_padding_type(padding), (DWORD)saltlen); - return (siglen == 0) ? 0 : 1; + return (*siglen == 0) ? 0 : 1; } #endif /* OPENSSL_VERSION >= 1.1.0 */