Skip to content

Commit 5ba5793

Browse files
author
Lealem Amedie
committed
Make public wc_ api for EncodeObjectId
1 parent c45f7c8 commit 5ba5793

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5438,13 +5438,18 @@ static int CheckCurve(word32 oid)
54385438
* @return BAD_FUNC_ARG when in or outSz is NULL.
54395439
* @return BUFFER_E when buffer too small.
54405440
*/
5441+
int wc_EncodeObjectId(const word16* in, word32 inSz, byte* out, word32* outSz)
5442+
{
5443+
return EncodeObjectId(in, inSz, out, outSz);
5444+
}
5445+
54415446
int EncodeObjectId(const word16* in, word32 inSz, byte* out, word32* outSz)
54425447
{
54435448
int i, x, len;
54445449
word32 d, t;
54455450

54465451
/* check args */
5447-
if (in == NULL || outSz == NULL) {
5452+
if (in == NULL || outSz == NULL || inSz <= 0) {
54485453
return BAD_FUNC_ARG;
54495454
}
54505455

wolfssl/wolfcrypt/asn.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,9 @@ WOLFSSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
21692169
word32 maxIdx);
21702170

21712171
#ifdef HAVE_OID_ENCODING
2172-
WOLFSSL_API int EncodeObjectId(const word16* in, word32 inSz,
2172+
WOLFSSL_API int wc_EncodeObjectId(const word16* in, word32 inSz,
2173+
byte* out, word32* outSz);
2174+
WOLFSSL_LOCAL int EncodeObjectId(const word16* in, word32 inSz,
21732175
byte* out, word32* outSz);
21742176
#endif
21752177
#if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) || \

0 commit comments

Comments
 (0)