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>
This commit is contained in:
parent
94f1fe6f63
commit
af851914f8
8 changed files with 110 additions and 108 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue