]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP peer: Clean up TLS Session-Id derivation function
authorJouni Malinen <j@w1.fi>
Sat, 29 Nov 2014 22:22:10 +0000 (00:22 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 30 Nov 2014 13:53:11 +0000 (15:53 +0200)
The comment about library not supporting Session-Id derivation was not
accurate and there is no need to check for master key that is not used
as part of derivation.

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

index 06fb10ee6d5cc138407a454b05b57b2a256ae5a4..124177ba3b999c8301ad7e019191ceb8a2cf15f5 100644 (file)
@@ -379,15 +379,10 @@ u8 * eap_peer_tls_derive_session_id(struct eap_sm *sm,
        struct tls_keys keys;
        u8 *out;
 
-       /*
-        * TLS library did not support session ID generation,
-        * so get the needed TLS session parameters
-        */
        if (tls_connection_get_keys(sm->ssl_ctx, data->conn, &keys))
                return NULL;
 
-       if (keys.client_random == NULL || keys.server_random == NULL ||
-           keys.master_key == NULL)
+       if (keys.client_random == NULL || keys.server_random == NULL)
                return NULL;
 
        *len = 1 + keys.client_random_len + keys.server_random_len;
@@ -399,7 +394,7 @@ u8 * eap_peer_tls_derive_session_id(struct eap_sm *sm,
        out[0] = eap_type;
        os_memcpy(out + 1, keys.client_random, keys.client_random_len);
        os_memcpy(out + 1 + keys.client_random_len, keys.server_random,
-                 keys.server_random_len);
+                 keys.server_random_len);
 
        return out;
 }