Browse Source

EAP-TLS: Merge common error paths

There is no need to keep these identical error paths separate.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 9 years ago
parent
commit
18704f6cdc
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/eap_peer/eap_tls_common.c

+ 2 - 4
src/eap_peer/eap_tls_common.c

@@ -356,10 +356,8 @@ u8 * eap_peer_tls_derive_session_id(struct eap_sm *sm,
 	struct tls_random keys;
 	u8 *out;
 
-	if (tls_connection_get_random(sm->ssl_ctx, data->conn, &keys))
-		return NULL;
-
-	if (keys.client_random == NULL || keys.server_random == NULL)
+	if (tls_connection_get_random(sm->ssl_ctx, data->conn, &keys) ||
+	    keys.client_random == NULL || keys.server_random == NULL)
 		return NULL;
 
 	*len = 1 + keys.client_random_len + keys.server_random_len;