aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-03-31 13:15:39 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-01 09:56:54 (GMT)
commitaf851914f810978909dd8598ab88030fe43d0051 (patch)
treef67f630c24e69a9e8d1a1b4be2abb3470b66557b /src/eap_common
parent94f1fe6f6384a2ef379ef5b8cdc32a2fa01f8d13 (diff)
downloadhostap-af851914f810978909dd8598ab88030fe43d0051.zip
hostap-af851914f810978909dd8598ab88030fe43d0051.tar.gz
hostap-af851914f810978909dd8598ab88030fe43d0051.tar.bz2
Make tls_connection_get_keyblock_size() internal to tls_*.c
This function exposes internal state of the TLS negotiated parameters for the sole purpose of being able to implement PRF for EAP-FAST. Since tls_connection_prf() is now taking care of all TLS-based key derivation cases, it is cleaner to keep this detail internal to each tls_*.c wrapper implementation. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/eap_common')
-rw-r--r--src/eap_common/eap_fast_common.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/eap_common/eap_fast_common.c b/src/eap_common/eap_fast_common.c
index 5b41189..151cc78 100644
--- a/src/eap_common/eap_fast_common.c
+++ b/src/eap_common/eap_fast_common.c
@@ -97,24 +97,16 @@ u8 * eap_fast_derive_key(void *ssl_ctx, struct tls_connection *conn,
const char *label, size_t len)
{
u8 *out;
- int block_size;
- block_size = tls_connection_get_keyblock_size(ssl_ctx, conn);
- if (block_size < 0)
- return NULL;
-
- out = os_malloc(block_size + len);
+ out = os_malloc(len);
if (out == NULL)
return NULL;
- if (tls_connection_prf(ssl_ctx, conn, label, 1, out, block_size + len))
- {
+ if (tls_connection_prf(ssl_ctx, conn, label, 1, 1, out, len)) {
os_free(out);
return NULL;
}
- os_memmove(out, out + block_size, len);
- os_memset(out + len, 0, block_size);
return out;
}