]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
LEAP: Check whether MD5 operation succeeded
authorJouni Malinen <j@w1.fi>
Sat, 18 Oct 2025 08:22:09 +0000 (11:22 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 18 Oct 2025 15:13:00 +0000 (18:13 +0300)
md5_vector() could theoretically fail, so check for that.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_peer/eap_leap.c

index 02daddfb4413e1db034367870d9ef344b35fb15a..47c069a07917de24840a6002c5cf2ec7e1fb47c2 100644 (file)
@@ -386,7 +386,10 @@ static u8 * eap_leap_getKey(struct eap_sm *sm, void *priv, size_t *len)
        elen[3] = LEAP_CHALLENGE_LEN;
        addr[4] = data->peer_response;
        elen[4] = LEAP_RESPONSE_LEN;
-       md5_vector(5, addr, elen, key);
+       if (md5_vector(5, addr, elen, key)) {
+               os_free(key);
+               return NULL;
+       }
        wpa_hexdump_key(MSG_DEBUG, "EAP-LEAP: master key", key, LEAP_KEY_LEN);
        *len = LEAP_KEY_LEN;