Fix CALCULATE result.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-12-26 19:21:07 +01:00
parent 00f30ba00c
commit 6ebaa05523
No known key found for this signature in database
GPG Key ID: C0095B7870A4CCD3

View File

@ -269,7 +269,7 @@ int calculate_oath(uint8_t truncate, const uint8_t *key, size_t key_len, const u
if (md_info == NULL)
return SW_INCORRECT_PARAMS();
uint8_t hmac[64];
int r = mbedtls_md_hmac(md_info, key+1, key_len-1, chal, chal_len, hmac);
int r = mbedtls_md_hmac(md_info, key+2, key_len-2, chal, chal_len, hmac);
size_t hmac_size = mbedtls_md_get_size(md_info);
if (r != 0)
return CCID_EXEC_ERROR;