diff --git a/src/fido/cbor_get_info.c b/src/fido/cbor_get_info.c index b6e277a..683503d 100644 --- a/src/fido/cbor_get_info.c +++ b/src/fido/cbor_get_info.c @@ -102,9 +102,13 @@ int cbor_get_info() { #ifdef MBEDTLS_EDDSA_C curves++; #endif +#ifndef ENABLE_EMULATION if (phy_data.enabled_curves & PHY_CURVE_SECP256K1) { +#endif curves++; +#ifndef ENABLE_EMULATION } +#endif CBOR_CHECK(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, curves)); CBOR_CHECK(COSE_public_key(FIDO2_ALG_ES256, &arrayEncoder, &mapEncoder2)); #ifdef MBEDTLS_EDDSA_C @@ -112,9 +116,13 @@ int cbor_get_info() { #endif CBOR_CHECK(COSE_public_key(FIDO2_ALG_ES384, &arrayEncoder, &mapEncoder2)); CBOR_CHECK(COSE_public_key(FIDO2_ALG_ES512, &arrayEncoder, &mapEncoder2)); +#ifndef ENABLE_EMULATION if (!phy_data.enabled_curves_present || (phy_data.enabled_curves & PHY_CURVE_SECP256K1)) { +#endif CBOR_CHECK(COSE_public_key(FIDO2_ALG_ES256K, &arrayEncoder, &mapEncoder2)); +#ifndef ENABLE_EMULATION } +#endif CBOR_CHECK(cbor_encoder_close_container(&mapEncoder, &arrayEncoder)); diff --git a/src/fido/cbor_make_credential.c b/src/fido/cbor_make_credential.c index 34eb30b..35a9770 100644 --- a/src/fido/cbor_make_credential.c +++ b/src/fido/cbor_make_credential.c @@ -217,7 +217,11 @@ int cbor_make_credential(const uint8_t *data, size_t len) { curve = FIDO2_CURVE_P521; } } - else if (pubKeyCredParams[i].alg == FIDO2_ALG_ES256K && (phy_data.enabled_curves & PHY_CURVE_SECP256K1)) { + else if (pubKeyCredParams[i].alg == FIDO2_ALG_ES256K +#ifndef ENABLE_EMULATION + && (phy_data.enabled_curves & PHY_CURVE_SECP256K1) +#endif + ) { if (curve <= 0) { curve = FIDO2_CURVE_P256K1; }