]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Fix crypto_bignum_sub()
authorJouni Malinen <jouni@codeaurora.org>
Mon, 14 Oct 2019 16:27:47 +0000 (19:27 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 14 Oct 2019 16:38:41 +0000 (19:38 +0300)
The initial crypto wrapper implementation for wolfSSL seems to have
included a copy-paste error in crypto_bignum_sub() implementation that
was identical to crypto_bignum_add() while mp_sub() should have been
used instead of mp_add().

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

index e9894b335e539f9384cfe13eeb3fe84696eb4913..3069b4a7a7f10461c755fd290ce85aaa6f05f8dc 100644 (file)
@@ -1171,7 +1171,7 @@ int crypto_bignum_sub(const struct crypto_bignum *a,
        if (TEST_FAIL())
                return -1;
 
-       return mp_add((mp_int *) a, (mp_int *) b,
+       return mp_sub((mp_int *) a, (mp_int *) b,
                      (mp_int *) r) == MP_OKAY ? 0 : -1;
 }