From 56af895c680953a333b46d5569b4da7e623751aa Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 14 Oct 2015 10:48:37 -0700 Subject: [PATCH] make sure pubkey in ecc private key has size --- wolfcrypt/src/asn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 0b41d5d58..5eeae21d4 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -8100,6 +8100,10 @@ int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key, else if (GetLength(input, inOutIdx, &length, inSz) < 0) { ret = ASN_PARSE_E; } + else if (length <= 0) { + /* pubkey needs some size */ + ret = ASN_INPUT_E; + } else { b = input[*inOutIdx]; *inOutIdx += 1;