From bee17a3fbe89949cd6bd29d346762a7c7cabdc55 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Fri, 26 Oct 2018 00:54:32 -0400 Subject: [PATCH] update pc version --- fido2/crypto.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fido2/crypto.c b/fido2/crypto.c index 3a52097..35cf333 100644 --- a/fido2/crypto.c +++ b/fido2/crypto.c @@ -53,11 +53,9 @@ static const uint8_t * _signing_key = NULL; static int _key_len = 0; // Secrets for testing only -static uint8_t master_secret[32] = "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff" - "\xff\xee\xdd\xcc\xbb\xaa\x99\x88\x77\x66\x55\x44\x33\x22\x11\x00"; +static uint8_t master_secret[32]; -static uint8_t transport_secret[32] = "\x10\x01\x22\x33\x44\x55\x66\x77\x87\x90\x0a\xbb\x3c\xd8\xee\xff" - "\xff\xee\x8d\x1c\x3b\xfa\x99\x88\x77\x86\x55\x44\xd3\xff\x33\x00"; +static uint8_t transport_secret[32]; @@ -71,6 +69,11 @@ void crypto_reset_master_secret() ctap_generate_rng(master_secret, 32); } +void crypto_load_master_secret(uint8_t * key) +{ + memmove(master_secret, key, 32); + memmove(transport_secret, key+32, 32); +} void crypto_sha256_update(uint8_t * data, size_t len) { @@ -353,5 +356,3 @@ const uint16_t attestation_key_size = sizeof(attestation_key)-1; #else #error "No crypto implementation defined" #endif - -