diff options
Diffstat (limited to 'meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0010-SAE-Fix-confirm-message-validation-in-error-cases.patch')
-rw-r--r-- | meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0010-SAE-Fix-confirm-message-validation-in-error-cases.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0010-SAE-Fix-confirm-message-validation-in-error-cases.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0010-SAE-Fix-confirm-message-validation-in-error-cases.patch new file mode 100644 index 0000000000..9d2c6983d4 --- /dev/null +++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0010-SAE-Fix-confirm-message-validation-in-error-cases.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From ac8fa9ef198640086cf2ce7c94673be2b6a018a0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <jouni@codeaurora.org> | ||
3 | Date: Tue, 5 Mar 2019 23:43:25 +0200 | ||
4 | Subject: [PATCH 10/14] SAE: Fix confirm message validation in error cases | ||
5 | |||
6 | Explicitly verify that own and peer commit scalar/element are available | ||
7 | when trying to check SAE confirm message. It could have been possible to | ||
8 | hit a NULL pointer dereference if the peer element could not have been | ||
9 | parsed. (CVE-2019-9496) | ||
10 | |||
11 | Signed-off-by: Jouni Malinen <jouni@codeaurora.org> | ||
12 | Signed-off-by: Adrian Bunk <bunk@stusta.de> | ||
13 | Upstream-Status: Backport | ||
14 | CVE: CVE-2019-9496 | ||
15 | --- | ||
16 | src/common/sae.c | 14 +++++++++++--- | ||
17 | 1 file changed, 11 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/src/common/sae.c b/src/common/sae.c | ||
20 | index eaf825d..5a50294 100644 | ||
21 | --- a/src/common/sae.c | ||
22 | +++ b/src/common/sae.c | ||
23 | @@ -1487,23 +1487,31 @@ int sae_check_confirm(struct sae_data *sae, const u8 *data, size_t len) | ||
24 | |||
25 | wpa_printf(MSG_DEBUG, "SAE: peer-send-confirm %u", WPA_GET_LE16(data)); | ||
26 | |||
27 | - if (sae->tmp == NULL) { | ||
28 | + if (!sae->tmp || !sae->peer_commit_scalar || | ||
29 | + !sae->tmp->own_commit_scalar) { | ||
30 | wpa_printf(MSG_DEBUG, "SAE: Temporary data not yet available"); | ||
31 | return -1; | ||
32 | } | ||
33 | |||
34 | - if (sae->tmp->ec) | ||
35 | + if (sae->tmp->ec) { | ||
36 | + if (!sae->tmp->peer_commit_element_ecc || | ||
37 | + !sae->tmp->own_commit_element_ecc) | ||
38 | + return -1; | ||
39 | sae_cn_confirm_ecc(sae, data, sae->peer_commit_scalar, | ||
40 | sae->tmp->peer_commit_element_ecc, | ||
41 | sae->tmp->own_commit_scalar, | ||
42 | sae->tmp->own_commit_element_ecc, | ||
43 | verifier); | ||
44 | - else | ||
45 | + } else { | ||
46 | + if (!sae->tmp->peer_commit_element_ffc || | ||
47 | + !sae->tmp->own_commit_element_ffc) | ||
48 | + return -1; | ||
49 | sae_cn_confirm_ffc(sae, data, sae->peer_commit_scalar, | ||
50 | sae->tmp->peer_commit_element_ffc, | ||
51 | sae->tmp->own_commit_scalar, | ||
52 | sae->tmp->own_commit_element_ffc, | ||
53 | verifier); | ||
54 | + } | ||
55 | |||
56 | if (os_memcmp_const(verifier, data + 2, SHA256_MAC_LEN) != 0) { | ||
57 | wpa_printf(MSG_DEBUG, "SAE: Confirm mismatch"); | ||
58 | -- | ||
59 | 2.7.4 | ||
60 | |||