Skip to content

Commit 7ca6c12

Browse files
authored
Merge pull request #6755 from anhu/GetASNInt
Expose GetASNInt as part of WOLFSSL_ASN_API
2 parents fc4e4f1 + fddda8f commit 7ca6c12

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,6 @@ int GetOctetString(const byte* input, word32* inOutIdx, int* len, word32 maxIdx)
25482548
return GetASNHeader(input, ASN_OCTET_STRING, inOutIdx, len, maxIdx);
25492549
}
25502550

2551-
#ifndef WOLFSSL_ASN_TEMPLATE
25522551
/* Get the DER/BER encoding of an ASN.1 INTEGER header.
25532552
*
25542553
* Removes the leading zero byte when found.
@@ -2562,7 +2561,7 @@ int GetOctetString(const byte* input, word32* inOutIdx, int* len, word32 maxIdx)
25622561
* or invalid use of or missing leading zero.
25632562
* Otherwise, 0 to indicate success.
25642563
*/
2565-
static int GetASNInt(const byte* input, word32* inOutIdx, int* len,
2564+
int GetASNInt(const byte* input, word32* inOutIdx, int* len,
25662565
word32 maxIdx)
25672566
{
25682567
int ret;
@@ -2598,6 +2597,7 @@ static int GetASNInt(const byte* input, word32* inOutIdx, int* len,
25982597
return 0;
25992598
}
26002599

2600+
#ifndef WOLFSSL_ASN_TEMPLATE
26012601
#ifndef NO_CERTS
26022602
/* Get the DER/BER encoding of an ASN.1 INTEGER that has a value of no more than
26032603
* 7 bits.

wolfssl/wolfcrypt/asn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,6 +2193,8 @@ WOLFSSL_LOCAL int GetMyVersion(const byte* input, word32* inOutIdx,
21932193
int* version, word32 maxIdx);
21942194
WOLFSSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
21952195
word32 maxIdx);
2196+
WOLFSSL_ASN_API int GetASNInt(const byte* input, word32* inOutIdx, int* len,
2197+
word32 maxIdx);
21962198

21972199
#ifdef HAVE_OID_ENCODING
21982200
WOLFSSL_API int wc_EncodeObjectId(const word16* in, word32 inSz,

0 commit comments

Comments
 (0)