aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2015-05-04 10:34:12 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-05-07 11:28:37 -0700
commitcc00d5dc8483e32158b2ba61ea44b0c38d790ed7 (patch)
tree533da635c6af5654dd5673b5b0449d1d9567091f /src/eap_server
parentd1c753ef9cb780f24f7b8000c3540ab1452bc7a9 (diff)
downloadandroid_external_wpa_supplicant_8-cc00d5dc8483e32158b2ba61ea44b0c38d790ed7.tar.gz
android_external_wpa_supplicant_8-cc00d5dc8483e32158b2ba61ea44b0c38d790ed7.tar.bz2
android_external_wpa_supplicant_8-cc00d5dc8483e32158b2ba61ea44b0c38d790ed7.zip
Cumulative security patch from commit 58606fd98722e92aaa4c2c7b8cb99cc92bd4308c
58606fd EAP-pwd server: Make sure in_frag_pos is cleared to zero on allocation 6aa5d95 EAP-pwd peer: Make sure in_frag_pos is cleared to zero on allocation 28a069a EAP-pwd peer: Fix asymmetric fragmentation behavior 3035cc2 EAP-pwd server: Fix Total-Length parsing for fragment reassembly 477c743 EAP-pwd peer: Fix Total-Length parsing for fragment reassembly e28a58b EAP-pwd server: Fix payload length validation for Commit and Confirm dd2f043 EAP-pwd peer: Fix payload length validation for Commit and Confirm ef566a4 AP WMM: Fix integer underflow in WMM Action frame parser 8640cf7 WPS: Add more debug prints to httpread 1bd0d57 WPS: Replace the httpread_debug design with standard debug prints 7da4f4b WPS: Check maximum HTTP body length earlier in the process af185d0 WPS: Extra validation step for HTTP reader 5acd23f WPS: Fix HTTP chunked transfer encoding parser a5da657 dbus: Stop ongoing scheduled scan when scan is requested 0c28071 Fix sending ANQP request to an unknown BSS while associated 74197e0 wpa_cli: Fix memory leak when tracking networks 4504621 TDLS: Add TDLS_LINK_STATUS command to the control interface 01e87ef IBSS: Check ibss_rsn init before starting new IBSS authentication 74d912f libtommath: Fix check mp_init_multi() result fd66aa6 Check Public Action length explicitly before reading Action Code ff4a6d4 EAP-SIM/AKA: Explicitly check for header to include Reserved field f5ed400 EAP-SAKE: Make attribute parser more readable 0dfb7be EAP-SAKE: Pass EAP identifier instead of full request 354e3f7 TLS: Fix debug dump of X.509 certificate 87fcb5a EAP-PAX: Fix PAX_STD-1 and PAX_STD-3 payload length validation c3c5615 EAP-GPSK: Pass EAP identifier instead of full request d36c803 EAP-TLS/PEAP/TTLS/FAST: Move more towards using struct wpabuf 8d9f3b8 EAP-FAST: Do not use type cast to remove const specification 07f9034 EAP-FAST: Pass EAP identifier instead of full request f153e41 EAP-EKE: Do not pass full request to eap_eke_build_fail() 53f376c Fix a typo in function documentation 5aeebc4 D-Bus Fix network_is_persistent_group() for P2P operations 5441da2 Fix wpas_notify_network_removed() e8181e2 dbus: Add a debug print on fill_dict_with_properties() getter failures 8a78e22 D-Bus: Fix operations when P2P management interface is used dea0d8e RADIUS: Fix a copy-paste error in variable name Change-Id: Ib70bf513c1f6c17974ef135806e44e120a5d5709 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/eap_server')
-rw-r--r--src/eap_server/eap_server_pwd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
index 66bd5d2e..cb83ff73 100644
--- a/src/eap_server/eap_server_pwd.c
+++ b/src/eap_server/eap_server_pwd.c
@@ -656,9 +656,21 @@ eap_pwd_process_commit_resp(struct eap_sm *sm, struct eap_pwd_data *data,
BIGNUM *x = NULL, *y = NULL, *cofactor = NULL;
EC_POINT *K = NULL, *point = NULL;
int res = 0;
+ size_t prime_len, order_len;
wpa_printf(MSG_DEBUG, "EAP-pwd: Received commit response");
+ prime_len = BN_num_bytes(data->grp->prime);
+ order_len = BN_num_bytes(data->grp->order);
+
+ if (payload_len != 2 * prime_len + order_len) {
+ wpa_printf(MSG_INFO,
+ "EAP-pwd: Unexpected Commit payload length %u (expected %u)",
+ (unsigned int) payload_len,
+ (unsigned int) (2 * prime_len + order_len));
+ goto fin;
+ }
+
if (((data->peer_scalar = BN_new()) == NULL) ||
((data->k = BN_new()) == NULL) ||
((cofactor = BN_new()) == NULL) ||
@@ -774,6 +786,13 @@ eap_pwd_process_confirm_resp(struct eap_sm *sm, struct eap_pwd_data *data,
u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr;
int offset;
+ if (payload_len != SHA256_MAC_LEN) {
+ wpa_printf(MSG_INFO,
+ "EAP-pwd: Unexpected Confirm payload length %u (expected %u)",
+ (unsigned int) payload_len, SHA256_MAC_LEN);
+ goto fin;
+ }
+
/* build up the ciphersuite: group | random_function | prf */
grp = htons(data->group_num);
ptr = (u8 *) &cs;
@@ -923,17 +942,28 @@ static void eap_pwd_process(struct eap_sm *sm, void *priv,
* the first fragment has a total length
*/
if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) {
+ if (len < 2) {
+ wpa_printf(MSG_DEBUG,
+ "EAP-pwd: Frame too short to contain Total-Length field");
+ return;
+ }
tot_len = WPA_GET_BE16(pos);
wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments, total "
"length = %d", tot_len);
if (tot_len > 15000)
return;
+ if (data->inbuf) {
+ wpa_printf(MSG_DEBUG,
+ "EAP-pwd: Unexpected new fragment start when previous fragment is still in use");
+ return;
+ }
data->inbuf = wpabuf_alloc(tot_len);
if (data->inbuf == NULL) {
wpa_printf(MSG_INFO, "EAP-pwd: Out of memory to "
"buffer fragments!");
return;
}
+ data->in_frag_pos = 0;
pos += sizeof(u16);
len -= sizeof(u16);
}