static int eap_fast_derive_msk(struct eap_fast_data *data) { eap_fast_derive_eap_msk(data->simck, data->key_data); eap_fast_derive_eap_emsk(data->simck, data->emsk); data->success = 1; return 0; }
static int eap_fast_derive_msk(struct eap_fast_data *data) { if (eap_fast_derive_eap_msk(data->simck, data->key_data) < 0 || eap_fast_derive_eap_emsk(data->simck, data->emsk) < 0) return -1; data->success = 1; return 0; }
static u8 * eap_fast_getKey(struct eap_sm *sm, void *priv, size_t *len) { struct eap_fast_data *data = priv; u8 *eapKeyData; if (data->state != SUCCESS) return NULL; eapKeyData = os_malloc(EAP_FAST_KEY_LEN); if (eapKeyData == NULL) return NULL; eap_fast_derive_eap_msk(data->simck, eapKeyData); *len = EAP_FAST_KEY_LEN; return eapKeyData; }