Make public wc_ api for EncodeObjectId

This commit is contained in:
Lealem Amedie
2023-06-30 14:14:27 -06:00
parent c45f7c87b0
commit 5ba579397d
2 changed files with 9 additions and 2 deletions

View File

@ -5438,13 +5438,18 @@ static int CheckCurve(word32 oid)
* @return BAD_FUNC_ARG when in or outSz is NULL.
* @return BUFFER_E when buffer too small.
*/
int wc_EncodeObjectId(const word16* in, word32 inSz, byte* out, word32* outSz)
{
return EncodeObjectId(in, inSz, out, outSz);
}
int EncodeObjectId(const word16* in, word32 inSz, byte* out, word32* outSz)
{
int i, x, len;
word32 d, t;
/* check args */
if (in == NULL || outSz == NULL) {
if (in == NULL || outSz == NULL || inSz <= 0) {
return BAD_FUNC_ARG;
}

View File

@ -2169,7 +2169,9 @@ WOLFSSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
word32 maxIdx);
#ifdef HAVE_OID_ENCODING
WOLFSSL_API int EncodeObjectId(const word16* in, word32 inSz,
WOLFSSL_API int wc_EncodeObjectId(const word16* in, word32 inSz,
byte* out, word32* outSz);
WOLFSSL_LOCAL int EncodeObjectId(const word16* in, word32 inSz,
byte* out, word32* outSz);
#endif
#if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) || \