removed DecodeAsymKeyXXX_Assign_ex function, functionality now included in original _Assign function

This commit is contained in:
Brett Nicholas
2024-11-15 10:25:10 -07:00
parent f672105d55
commit 2207791aab
3 changed files with 10 additions and 32 deletions

View File

@@ -35308,7 +35308,7 @@ enum {
|| defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || defined(HAVE_SPHINCS)) || defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || defined(HAVE_SPHINCS))
int DecodeAsymKey_Assign_ex(const byte* input, word32* inOutIdx, word32 inSz, int DecodeAsymKey_Assign(const byte* input, word32* inOutIdx, word32 inSz,
const byte** privKey, word32* privKeyLen, const byte** privKey, word32* privKeyLen,
const byte** pubKey, word32* pubKeyLen, int* inOutKeyType) const byte** pubKey, word32* pubKeyLen, int* inOutKeyType)
{ {
@@ -35462,15 +35462,6 @@ int DecodeAsymKey_Assign_ex(const byte* input, word32* inOutIdx, word32 inSz,
#endif /* WOLFSSL_ASN_TEMPLATE */ #endif /* WOLFSSL_ASN_TEMPLATE */
} }
int DecodeAsymKey_Assign(const byte* input, word32* inOutIdx, word32 inSz,
const byte** privKey, word32* privKeyLen,
const byte** pubKey, word32* pubKeyLen, int keyType)
{
return DecodeAsymKey_Assign_ex(input, inOutIdx, inSz, privKey, privKeyLen,
pubKey, pubKeyLen, &keyType);
}
int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz, int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
byte* privKey, word32* privKeyLen, byte* privKey, word32* privKeyLen,
byte* pubKey, word32* pubKeyLen, int keyType) byte* pubKey, word32* pubKeyLen, int keyType)
@@ -35487,7 +35478,7 @@ int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
if (ret == 0) { if (ret == 0) {
ret = DecodeAsymKey_Assign(input, inOutIdx, inSz, &privKeyPtr, ret = DecodeAsymKey_Assign(input, inOutIdx, inSz, &privKeyPtr,
&privKeyPtrLen, &pubKeyPtr, &pubKeyPtrLen, keyType); &privKeyPtrLen, &pubKeyPtr, &pubKeyPtrLen, &keyType);
} }
if ((ret == 0) && (privKeyPtrLen > *privKeyLen)) { if ((ret == 0) && (privKeyPtrLen > *privKeyLen)) {
ret = BUFFER_E; ret = BUFFER_E;
@@ -35509,7 +35500,7 @@ int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
return ret; return ret;
} }
int DecodeAsymKeyPublic_Assign_ex(const byte* input, word32* inOutIdx, word32 inSz, int DecodeAsymKeyPublic_Assign(const byte* input, word32* inOutIdx, word32 inSz,
const byte** pubKey, word32* pubKeyLen, int *inOutKeyType) const byte** pubKey, word32* pubKeyLen, int *inOutKeyType)
{ {
int ret = 0; int ret = 0;
@@ -35611,13 +35602,6 @@ int DecodeAsymKeyPublic_Assign_ex(const byte* input, word32* inOutIdx, word32 in
} }
int DecodeAsymKeyPublic_Assign(const byte* input, word32* inOutIdx, word32 inSz,
const byte** pubKey, word32* pubKeyLen, int keyType)
{
return DecodeAsymKeyPublic_Assign_ex(input, inOutIdx, inSz, pubKey,
pubKeyLen, &keyType);
}
int DecodeAsymKeyPublic(const byte* input, word32* inOutIdx, word32 inSz, int DecodeAsymKeyPublic(const byte* input, word32* inOutIdx, word32 inSz,
byte* pubKey, word32* pubKeyLen, int keyType) byte* pubKey, word32* pubKeyLen, int keyType)
{ {
@@ -35631,7 +35615,7 @@ int DecodeAsymKeyPublic(const byte* input, word32* inOutIdx, word32 inSz,
if (ret == 0) { if (ret == 0) {
ret = DecodeAsymKeyPublic_Assign(input, inOutIdx, inSz, &pubKeyPtr, ret = DecodeAsymKeyPublic_Assign(input, inOutIdx, inSz, &pubKeyPtr,
&pubKeyPtrLen, keyType); &pubKeyPtrLen, &keyType);
} }
if ((ret == 0) && (pubKeyPtrLen > *pubKeyLen)) { if ((ret == 0) && (pubKeyPtrLen > *pubKeyLen)) {
ret = BUFFER_E; ret = BUFFER_E;

View File

@@ -9594,7 +9594,7 @@ int wc_Dilithium_PrivateKeyDecode(const byte* input, word32* inOutIdx,
if (ret == 0) { if (ret == 0) {
/* Decode the asymmetric key and get out private and public key data. */ /* Decode the asymmetric key and get out private and public key data. */
ret = DecodeAsymKey_Assign_ex(input, inOutIdx, inSz, ret = DecodeAsymKey_Assign(input, inOutIdx, inSz,
&privKey, &privKeyLen, &privKey, &privKeyLen,
&pubKey, &pubKeyLen, &keytype); &pubKey, &pubKeyLen, &keytype);
if (ret == 0 if (ret == 0
@@ -9873,7 +9873,7 @@ int wc_Dilithium_PublicKeyDecode(const byte* input, word32* inOutIdx,
} }
if (ret == 0) { if (ret == 0) {
/* Decode the asymmetric key and get out public key data. */ /* Decode the asymmetric key and get out public key data. */
ret = DecodeAsymKeyPublic_Assign_ex(input, inOutIdx, inSz, ret = DecodeAsymKeyPublic_Assign(input, inOutIdx, inSz,
&pubKey, &pubKeyLen, &pubKey, &pubKeyLen,
&keytype); &keytype);
if (ret == 0 if (ret == 0

View File

@@ -2540,9 +2540,6 @@ WOLFSSL_LOCAL void FreeSignatureCtx(SignatureCtx* sigCtx);
WOLFSSL_LOCAL int SetAsymKeyDerPublic(const byte* pubKey, word32 pubKeyLen, WOLFSSL_LOCAL int SetAsymKeyDerPublic(const byte* pubKey, word32 pubKeyLen,
byte* output, word32 outLen, int keyType, int withHeader); byte* output, word32 outLen, int keyType, int withHeader);
WOLFSSL_LOCAL int DecodeAsymKeyPublic_Assign(const byte* input, WOLFSSL_LOCAL int DecodeAsymKeyPublic_Assign(const byte* input,
word32* inOutIdx, word32 inSz, const byte** pubKey, word32* pubKeyLen,
int keyType);
WOLFSSL_LOCAL int DecodeAsymKeyPublic_Assign_ex(const byte* input,
word32* inOutIdx, word32 inSz, const byte** pubKey, word32* pubKeyLen, word32* inOutIdx, word32 inSz, const byte** pubKey, word32* pubKeyLen,
int* keyType); int* keyType);
@@ -2899,9 +2896,6 @@ WOLFSSL_LOCAL int VerifyX509Acert(const byte* cert, word32 certSz,
|| (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) \ || (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) \
|| defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || defined(HAVE_SPHINCS)) || defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || defined(HAVE_SPHINCS))
WOLFSSL_LOCAL int DecodeAsymKey_Assign(const byte* input, word32* inOutIdx, WOLFSSL_LOCAL int DecodeAsymKey_Assign(const byte* input, word32* inOutIdx,
word32 inSz, const byte** privKey, word32* privKeyLen, const byte** pubKey,
word32* pubKeyLen, int keyType);
WOLFSSL_LOCAL int DecodeAsymKey_Assign_ex(const byte* input, word32* inOutIdx,
word32 inSz, const byte** privKey, word32* privKeyLen, const byte** pubKey, word32 inSz, const byte** privKey, word32* privKeyLen, const byte** pubKey,
word32* pubKeyLen, int* inOutKeyType); word32* pubKeyLen, int* inOutKeyType);