aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Quartulli <a@unstable.cc>2020-04-28 12:06:58 +0200
committerDaniel Golle <daniel@makrotopia.org>2020-05-01 16:19:47 +0100
commit2df0ea042d14dbfc2735b843eb82a0ae0d8bec19 (patch)
tree822864bd18015aeb684773a23dc9aa628bc8811f
parentec6cb33452fe61112c42ddda471730aed9a624a3 (diff)
downloadupstream-2df0ea042d14dbfc2735b843eb82a0ae0d8bec19.tar.gz
upstream-2df0ea042d14dbfc2735b843eb82a0ae0d8bec19.tar.bz2
upstream-2df0ea042d14dbfc2735b843eb82a0ae0d8bec19.zip
wpad-wolfssl: fix crypto_bignum_sub()
Backport patch from hostapd.git master that fixes copy/paste error in crypto_bignum_sub() in crypto_wolfssl.c. This missing fix was discovered while testing SAE over a mesh interface. With this fix applied and wolfssl >3.14.4 mesh+SAE works fine with wpad-mesh-wolfssl. Cc: Sean Parkinson <sean@wolfssl.com> Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 4b3b8ec81cd1965d0bd548fa31db491295b83354)
-rw-r--r--package/network/services/hostapd/patches/090-wolfssl-fix-crypto_bignum_sum.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/package/network/services/hostapd/patches/090-wolfssl-fix-crypto_bignum_sum.patch b/package/network/services/hostapd/patches/090-wolfssl-fix-crypto_bignum_sum.patch
new file mode 100644
index 0000000000..7cc0dec3fe
--- /dev/null
+++ b/package/network/services/hostapd/patches/090-wolfssl-fix-crypto_bignum_sum.patch
@@ -0,0 +1,26 @@
+From 1766e608ba1114220f3b3598e77aa53b50c38a6e Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <jouni@codeaurora.org>
+Date: Mon, 14 Oct 2019 19:27:47 +0300
+Subject: [PATCH] wolfSSL: Fix crypto_bignum_sub()
+
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/crypto/crypto_wolfssl.c
++++ b/src/crypto/crypto_wolfssl.c
+@@ -1151,7 +1151,7 @@ int crypto_bignum_sub(const struct crypt
+ 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;
+ }
+