If public point is not found, it is computed automatically.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-03-07 23:45:10 +01:00
parent 1e90699a3f
commit 963456051e

View File

@@ -704,8 +704,11 @@ int dkek_decode_key(uint8_t id,
len = get_uint16_t(kb, ofs); ofs += 2; len = get_uint16_t(kb, ofs); ofs += 2;
r = mbedtls_ecp_point_read_binary(&ecdsa->grp, &ecdsa->Q, kb + ofs, len); r = mbedtls_ecp_point_read_binary(&ecdsa->grp, &ecdsa->Q, kb + ofs, len);
if (r != 0) { if (r != 0) {
mbedtls_ecdsa_free(ecdsa); r = mbedtls_ecp_mul(&ecdsa->grp, &ecdsa->Q, &ecdsa->d, &ecdsa->grp.G, random_gen, NULL);
return CCID_EXEC_ERROR; if (r != 0) {
mbedtls_ecdsa_free(ecdsa);
return CCID_EXEC_ERROR;
}
} }
r = mbedtls_ecp_check_pub_priv(ecdsa, ecdsa, random_gen, NULL); r = mbedtls_ecp_check_pub_priv(ecdsa, ecdsa, random_gen, NULL);
if (r != 0) { if (r != 0) {