From: Andrei Otcheretianski Date: Wed, 30 Nov 2022 15:05:42 +0000 (+0200) Subject: OpenSSL: Fix BN_rshift() argument order X-Git-Tag: hostap_2_11~1435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69725c4cf787cf2fce2199ab862ea6cc21d4dbb7;p=thirdparty%2Fhostap.git OpenSSL: Fix BN_rshift() argument order The arguments were swapped. Apparently all the calls to this function use the same value for both input and output parameters, so it went unnoticed. Fix it. Signed-off-by: Andrei Otcheretianski --- diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 8f220bb1a..31d9d6131 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -2149,9 +2149,7 @@ int crypto_bignum_sqrmod(const struct crypto_bignum *a, int crypto_bignum_rshift(const struct crypto_bignum *a, int n, struct crypto_bignum *r) { - /* Note: BN_rshift() does not modify the first argument even though it - * has not been marked const. */ - return BN_rshift((BIGNUM *) a, (BIGNUM *) r, n) == 1 ? 0 : -1; + return BN_rshift((BIGNUM *) r, (const BIGNUM *) a, n) == 1 ? 0 : -1; }