From d45f383b0150c2617c1e0b9169205eb2069e2711 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 20 Aug 2019 14:21:40 +0100 Subject: [PATCH] TinyCrypt PK parse: Impl. EC public key derivation in TC-based ECDSA --- library/pkparse.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/library/pkparse.c b/library/pkparse.c index dbef18a3e..fce5ad70a 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -978,7 +978,14 @@ static int pk_parse_key_sec1_der( mbedtls_uecc_keypair *keypair, } } - //TODO: Do we need to support derived public keys with uecc? + if( !pubkey_done ) + { + ret = uECC_compute_public_key( keypair->private_key, + keypair->public_key, + uECC_secp256r1() ); + if( ret == 0 ) + return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT ); + } return( 0 ); }