summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0011-EAP-pwd-server-Verify-received-scalar-and-element.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0011-EAP-pwd-server-Verify-received-scalar-and-element.patch')
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0011-EAP-pwd-server-Verify-received-scalar-and-element.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0011-EAP-pwd-server-Verify-received-scalar-and-element.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0011-EAP-pwd-server-Verify-received-scalar-and-element.patch
new file mode 100644
index 0000000000..87095bf7f4
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0011-EAP-pwd-server-Verify-received-scalar-and-element.patch
@@ -0,0 +1,61 @@
1From 70ff850e89fbc8bc7da515321b4d15b5eef70581 Mon Sep 17 00:00:00 2001
2From: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
3Date: Sun, 31 Mar 2019 17:13:06 +0200
4Subject: [PATCH 11/14] EAP-pwd server: Verify received scalar and element
5
6When processing an EAP-pwd Commit frame, the peer's scalar and element
7(elliptic curve point) were not validated. This allowed an adversary to
8bypass authentication, and impersonate any user if the crypto
9implementation did not verify the validity of the EC point.
10
11Fix this vulnerability by assuring the received scalar lies within the
12valid range, and by checking that the received element is not the point
13at infinity and lies on the elliptic curve being used. (CVE-2019-9498)
14
15The vulnerability is only exploitable if OpenSSL version 1.0.2 or lower
16is used, or if LibreSSL or wolfssl is used. Newer versions of OpenSSL
17(and also BoringSSL) implicitly validate the elliptic curve point in
18EC_POINT_set_affine_coordinates_GFp(), preventing the attack.
19
20Signed-off-by: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
21Signed-off-by: Adrian Bunk <bunk@stusta.de>
22Upstream-Status: Backport
23CVE: CVE-2019-9498
24---
25 src/eap_server/eap_server_pwd.c | 20 ++++++++++++++++++++
26 1 file changed, 20 insertions(+)
27
28diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
29index d0fa54a..74979da 100644
30--- a/src/eap_server/eap_server_pwd.c
31+++ b/src/eap_server/eap_server_pwd.c
32@@ -718,6 +718,26 @@ eap_pwd_process_commit_resp(struct eap_sm *sm, struct eap_pwd_data *data,
33 goto fin;
34 }
35
36+ /* verify received scalar */
37+ if (crypto_bignum_is_zero(data->peer_scalar) ||
38+ crypto_bignum_is_one(data->peer_scalar) ||
39+ crypto_bignum_cmp(data->peer_scalar,
40+ crypto_ec_get_order(data->grp->group)) >= 0) {
41+ wpa_printf(MSG_INFO,
42+ "EAP-PWD (server): received scalar is invalid");
43+ goto fin;
44+ }
45+
46+ /* verify received element */
47+ if (!crypto_ec_point_is_on_curve(data->grp->group,
48+ data->peer_element) ||
49+ crypto_ec_point_is_at_infinity(data->grp->group,
50+ data->peer_element)) {
51+ wpa_printf(MSG_INFO,
52+ "EAP-PWD (server): received element is invalid");
53+ goto fin;
54+ }
55+
56 /* check to ensure peer's element is not in a small sub-group */
57 if (!crypto_bignum_is_one(cofactor)) {
58 if (crypto_ec_point_mul(data->grp->group, data->peer_element,
59--
602.7.4
61