From 8c256298ae90848d565e4b6b9d441a2b63d6927a Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Tue, 17 Sep 2019 00:06:45 +0800 Subject: [PATCH] default up to enabled --- fido2/ctap.c | 4 ++-- fido2/ctap_parse.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fido2/ctap.c b/fido2/ctap.c index 3a46a650..05770c3c 100644 --- a/fido2/ctap.c +++ b/fido2/ctap.c @@ -755,7 +755,7 @@ uint8_t ctap_make_credential(CborEncoder * encoder, uint8_t * request, int lengt } } - if (MC.up) + if (MC.up == 1 || MC.up == 0) { return CTAP2_ERR_INVALID_OPTION; } @@ -1248,7 +1248,7 @@ uint8_t ctap_get_assertion(CborEncoder * encoder, uint8_t * request, int length) else #endif { - device_disable_up(!GA.up); + device_disable_up(GA.up == 0); ret = ctap_make_auth_data(&GA.rp, &map, auth_data_buf, &auth_data_buf_sz, NULL); device_disable_up(false); check_retr(ret); diff --git a/fido2/ctap_parse.c b/fido2/ctap_parse.c index 0825bba1..9c155d27 100644 --- a/fido2/ctap_parse.c +++ b/fido2/ctap_parse.c @@ -715,6 +715,7 @@ uint8_t ctap_parse_make_credential(CTAP_makeCredential * MC, CborEncoder * encod CborValue it,map; memset(MC, 0, sizeof(CTAP_makeCredential)); + MC->up = 0xff; ret = cbor_parser_init(request, length, CborValidateCanonicalFormat, &parser, &it); check_retr(ret); @@ -1010,6 +1011,7 @@ uint8_t ctap_parse_get_assertion(CTAP_getAssertion * GA, uint8_t * request, int memset(GA, 0, sizeof(CTAP_getAssertion)); GA->creds = getAssertionState.creds; // Save stack memory + GA->up = 0xff; ret = cbor_parser_init(request, length, CborValidateCanonicalFormat, &parser, &it); check_ret(ret);