From 62304411dd5e5bffabdd0c3e2812b3349641eb72 Mon Sep 17 00:00:00 2001 From: TakayukiMatsuo Date: Fri, 19 Mar 2021 14:48:46 +0900 Subject: [PATCH] Remove wc_EccPublicKeyDecode_ex --- wolfcrypt/src/asn.c | 64 --------------------------------------------- 1 file changed, 64 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 135a11075..33dbbafcf 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -16169,70 +16169,6 @@ static int EccKeyParamCopy(char** dst, char* src) return ret; } #endif /* WOLFSSL_CUSTOM_CURVES */ -/* wc_EccPublicKeyDecode_ex gets ECC public key data in DER format via "input" - * and returns the curve id to "curveId" and the point position to "pointIdx". - * Returns 0 on success, negative values on failure. - */ -int wc_EccPublicKeyDecode_ex(const byte* input, - word32* inOutIdx, int* curveId, - word32* pointIdx, int* pointSz, word32 inSz) -{ - int ret; - int version, length; - word32 oidSum, localIdx; - byte tag; - - if (input == NULL || inOutIdx == NULL || curveId == NULL || - pointIdx == NULL || pointSz == NULL || inSz == 0) - return BAD_FUNC_ARG; - - if (GetSequence(input, inOutIdx, &length, inSz) < 0) - return ASN_PARSE_E; - - if (GetMyVersion(input, inOutIdx, &version, inSz) >= 0) - return ASN_PARSE_E; - - if (GetSequence(input, inOutIdx, &length, inSz) < 0) - return ASN_PARSE_E; - - ret = SkipObjectId(input, inOutIdx, inSz); - if (ret != 0) - return ret; - - if (*inOutIdx >= inSz) { - return BUFFER_E; - } - - localIdx = *inOutIdx; - - if (GetASNTag(input, &localIdx, &tag, inSz) == 0 && - tag == (ASN_SEQUENCE | ASN_CONSTRUCTED)) { - return BAD_FUNC_ARG; /* given key is not a public key*/ - } - - /* ecc params information */ - ret = GetObjectId(input, inOutIdx, &oidSum, oidIgnoreType, inSz); - if (ret != 0) - return ret; - - /* get curve id */ - if ((ret = CheckCurve(oidSum)) < 0) - return ECC_CURVE_OID_E; - else { - *curveId = ret; - } - - /* key header */ - ret = CheckBitString(input, inOutIdx, &length, inSz, 1, NULL); - if (ret != 0) - return ret; - - *pointIdx = *inOutIdx; - *pointSz = length; - *inOutIdx += length; - - return 0; -} int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key, word32 inSz)