Skip to content

Commit 557e43b

Browse files
committed
dual alg: peer review cleanup, and more function comments.
1 parent 937d6d4 commit 557e43b

2 files changed

Lines changed: 32 additions & 16 deletions

File tree

src/x509.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8088,10 +8088,11 @@ int wolfSSL_i2d_X509(WOLFSSL_X509* x509, unsigned char** out)
80888088
/* Generate a der preTBS from a decoded cert, and write
80898089
* to buffer.
80908090
*
8091-
* @param[in] cert The decoded cert to parse.
8092-
* @param[out] der The der buffer to write in.
8093-
* @param[in] derZ The der buffer size.
8094-
* @return preTBS der size on success.
8091+
* @param [in] cert The decoded cert to parse.
8092+
* @param [out] der The der buffer to write in.
8093+
* @param [in] derSz The der buffer size.
8094+
*
8095+
* @return preTBS der size on success.
80958096
* */
80968097
int wc_GeneratePreTBS(DecodedCert* cert, byte *der, int derSz) {
80978098
int ret = 0;
@@ -15743,6 +15744,17 @@ int wolfSSL_X509_ACERT_verify(WOLFSSL_X509_ACERT* x509, WOLFSSL_EVP_PKEY* pkey)
1574315744
return ret == 0 ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
1574415745
}
1574515746

15747+
/* Loads an x509 attribute certificate from buffer, and returns
15748+
* pointer to new WOLFSSL_X509_ACERT struct on success.
15749+
*
15750+
* @param [in] buf The acert buffer to load.
15751+
* @param [in] sz The size of the buffer.
15752+
* @param [in] format The format of the buffer data.
15753+
* @param [in] heap Dynamic memory allocation hint.
15754+
*
15755+
* @return pointer to WOLFSSL_X509_ACERT on success.
15756+
* @return NULL on error.
15757+
* */
1574615758
WOLFSSL_X509_ACERT * wolfSSL_X509_ACERT_load_certificate_buffer_ex(
1574715759
const unsigned char* buf, int sz, int format, void * heap)
1574815760
{

wolfcrypt/src/asn.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32147,9 +32147,11 @@ static int SignCert(int requestSz, int sType, byte* buf, word32 buffSz,
3214732147
* @param [in] buf The input buf to sign.
3214832148
* @param [in] bufSz The buffer size
3214932149
* @param [in] keyType The key type.
32150+
* @param [in] key Key data.
3215032151
* @param [in] rng Random number generator.
32151-
* @return Size of signature on success.
32152-
* @return < 0 on error.
32152+
*
32153+
* @return Size of signature on success.
32154+
* @return < 0 on error.
3215332155
* */
3215432156
int wc_MakeSigWithBitStr(byte *sig, int sigSz, int sType, byte* buf,
3215532157
word32 bufSz, int keyType, void* key, WC_RNG* rng)
@@ -32282,14 +32284,16 @@ int wc_MakeSigWithBitStr(byte *sig, int sigSz, int sType, byte* buf,
3228232284
/* Sign an x509 Certificate v3 from cert input using any
3228332285
* key type, and write to buffer.
3228432286
*
32285-
* @param [in] requestSz Size of requested data to sign.
32286-
* @param [in] sType The signature type.
32287-
* @param [in] derSz Der buffer size.
32288-
* @param [in] keyType The type of key.
32289-
* @param [in] key Key data.
32290-
* @param [in] rng Random number generator.
32291-
* @return Size of signature on success.
32292-
* @return < 0 on error
32287+
* @param [in] requestSz Size of requested data to sign.
32288+
* @param [in] sType The signature type.
32289+
* @param [in,out] buf Der buffer to sign.
32290+
* @param [in] buffSz Der buffer size.
32291+
* @param [in] keyType The type of key.
32292+
* @param [in] key Key data.
32293+
* @param [in] rng Random number generator.
32294+
*
32295+
* @return Size of signature on success.
32296+
* @return < 0 on error
3229332297
* */
3229432298
int wc_SignCert_ex(int requestSz, int sType, byte* buf, word32 buffSz,
3229532299
int keyType, void* key, WC_RNG* rng)
@@ -40940,7 +40944,7 @@ static int DecodeAcertGeneralName(const byte* input, word32* inOutIdx,
4094040944
* @param [in] input Buffer holding encoded data.
4094140945
* @param [in] sz Size of encoded data in bytes.
4094240946
* @param [in] tag ASN.1 tag value expected in header.
40943-
* @param [in, out] acert Decoded certificate object.
40947+
* @param [in, out] acert Decoded attribute certificate object.
4094440948
* @param [in, out] entries Linked list of DNS name entries.
4094540949
*
4094640950
* @return 0 on success.
@@ -41069,7 +41073,7 @@ enum {
4106941073
*
4107041074
* @param [in] input Buffer containing encoded Holder field.
4107141075
* @param [in] len Length of Holder field.
41072-
* @param [in, out] acert Decoded certificate object.
41076+
* @param [in, out] acert Decoded attribute certificate object.
4107341077
*
4107441078
* @return 0 on success.
4107541079
* @return ASN_PARSE_E when BER encoded data does not match ASN.1 items or

0 commit comments

Comments
 (0)