]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Fix BN_rshift() argument order
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 30 Nov 2022 15:05:42 +0000 (17:05 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 30 Nov 2022 17:06:30 +0000 (19:06 +0200)
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 <andrei.otcheretianski@intel.com>
src/crypto/crypto_openssl.c

index 8f220bb1a88038753342636b9af9775a75eec217..31d9d6131a83e87ef1f101de7d08df3c8dee49d1 100644 (file)
@@ -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;
 }