handshake: add OWE to get_ptk_size

OWE defines KEK/KCK lengths depending on group. This change adds a
case into handshake_get_key_sizes. With OWE we can determine the
key lengths based on the PMK length in the handshake.
This commit is contained in:
James Prestwood 2019-01-17 12:25:35 -08:00 committed by Denis Kenzior
parent 532c9a5521
commit 90c39afd61
1 changed files with 29 additions and 0 deletions

View File

@ -302,6 +302,35 @@ static bool handshake_get_key_sizes(struct handshake_state *s, size_t *ptk_size,
case IE_RSN_AKM_SUITE_FT_OVER_8021X_SHA384:
kck = 24;
kek = 32;
break;
case IE_RSN_AKM_SUITE_OWE:
/*
* RFC 8110 Section 4.4 Table 2
*
* Luckily with OWE we can deduce the key lengths from the PMK
* size, since the PMK size maps to unique KCK/KEK lengths.
*/
switch (s->pmk_len) {
case 32:
/* SHA-256 used for PMK */
kck = 16;
kek = 16;
break;
case 48:
/* SHA-384 used for PMK */
kck = 24;
kek = 32;
break;
case 64:
/* SHA-512 used for PMK */
kck = 32;
kek = 32;
break;
default:
l_error("Invalid PMK length for OWE %zu\n", s->pmk_len);
return false;
}
break;
default:
kck = 16;