]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Fix crypto_bignum_rshift() wrapper
authorJouni Malinen <jouni@codeaurora.org>
Thu, 17 May 2018 19:02:02 +0000 (22:02 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 17 May 2018 19:02:02 +0000 (22:02 +0300)
The n argument to this function is number of bits, not bytes, to shift.
As such, need to use mp_rshb() instead of mp_rshd(). This fixes EAP-pwd
with P-521 curve.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/crypto/crypto_wolfssl.c

index bc4fd6a2a57b55e3ca588a404e974dd241c3dbbf..b5a1e3fa31bc1ba58cd4e50e691876d2f4b78686 100644 (file)
@@ -1181,7 +1181,7 @@ int crypto_bignum_rshift(const struct crypto_bignum *a, int n,
 {
        if (mp_copy((mp_int *) a, (mp_int *) r) != MP_OKAY)
                return -1;
-       mp_rshd((mp_int *) r, n);
+       mp_rshb((mp_int *) r, n);
        return 0;
 }