forked from wolfSSL/wolfssl
Make wc_BuildEccKeyDer non-static
This commit is contained in:
@ -32639,7 +32639,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx,
|
||||
#if defined(HAVE_ECC_KEY_EXPORT) && !defined(NO_ASN_CRYPT)
|
||||
/* build DER formatted ECC key, include optional public key if requested,
|
||||
* return length on success, negative on error */
|
||||
static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 *inLen,
|
||||
int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 *inLen,
|
||||
int pubIn, int curveIn)
|
||||
{
|
||||
#ifndef WOLFSSL_ASN_TEMPLATE
|
||||
@ -32955,14 +32955,6 @@ int wc_EccPrivateKeyToDer(ecc_key* key, byte* output, word32 inLen)
|
||||
return wc_BuildEccKeyDer(key, output, &inLen, 0, 1);
|
||||
}
|
||||
|
||||
/* Write only private ecc key to DER format,
|
||||
* length on success else < 0 */
|
||||
int wc_EccPrivateKeyToDerNoCurve(ecc_key* key, byte* output, word32 inLen)
|
||||
{
|
||||
return wc_BuildEccKeyDer(key, output, &inLen, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_PKCS8
|
||||
|
||||
/* Write only private ecc key or both private and public parts to unencrypted
|
||||
|
@ -202,7 +202,7 @@ int wc_AriaSign(byte* in, word32 inSz, byte* out, word32* outSz, ecc_key* key)
|
||||
rv = MC_SetApiMode(hSession, gApimode);
|
||||
|
||||
if (rv == MC_OK) {
|
||||
int ret = wc_EccPrivateKeyToDerNoCurve(key,keyAsn1,keyAsn1Sz);
|
||||
int ret = wc_BuildEccKeyDer(key,keyAsn1,&keyAsn1Sz,0,0);
|
||||
if (ret < 0) { rv = ret; }
|
||||
else { keyAsn1Sz = ret; }
|
||||
}
|
||||
@ -369,7 +369,7 @@ int wc_AriaDerive(ecc_key* private_key, ecc_key* public_key, byte* out, word32*
|
||||
mcAlg.nParam=pubAsn1Sz;
|
||||
|
||||
if (rv == MC_OK) {
|
||||
int ret = wc_EccPrivateKeyToDerNoCurve(private_key,privAsn1,privAsn1Sz);
|
||||
int ret = wc_BuildEccKeyDer(private_key,privAsn1,&privAsn1Sz,0,0);
|
||||
if (ret < 0) {
|
||||
rv = ret;
|
||||
} else {
|
||||
|
@ -746,12 +746,12 @@ WOLFSSL_API int wc_DhPrivKeyToDer(DhKey* key, byte* out, word32* outSz);
|
||||
WOLFSSL_ABI
|
||||
WOLFSSL_API int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx,
|
||||
ecc_key* key, word32 inSz);
|
||||
WOLFSSL_LOCAL int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 *inLen,
|
||||
int pubIn, int curveIn);
|
||||
WOLFSSL_ABI
|
||||
WOLFSSL_API int wc_EccKeyToDer(ecc_key* key, byte* output, word32 inLen);
|
||||
WOLFSSL_API int wc_EccPrivateKeyToDer(ecc_key* key, byte* output,
|
||||
word32 inLen);
|
||||
WOLFSSL_API int wc_EccPrivateKeyToDerNoCurve(ecc_key* key, byte* output,
|
||||
word32 inLen);
|
||||
WOLFSSL_API int wc_EccKeyDerSize(ecc_key* key, int pub);
|
||||
WOLFSSL_API int wc_EccPrivateKeyToPKCS8(ecc_key* key, byte* output,
|
||||
word32* outLen);
|
||||
|
Reference in New Issue
Block a user