Skip to content

Commit 78e5ae3

Browse files
committed
Address review comments
1 parent a96f20e commit 78e5ae3

2 files changed

Lines changed: 30 additions & 12 deletions

File tree

doc/dox_comments/header_files/asn_public.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,15 +3378,20 @@ int wc_GetSubjectPubKeyInfoDerFromCert(const byte* certDer,
33783378
\brief Retrieves the subject name from a decoded certificate.
33793379
33803380
This function copies the subject name string from a DecodedCert
3381-
structure into the provided buffer. If buf is NULL, the required
3382-
buffer size is returned in bufSz and LENGTH_ONLY_E is returned.
3381+
structure into the provided buffer. The string uses a one-line
3382+
distinguished name format with "/" delimiters
3383+
(e.g. "/C=US/O=Org/CN=example.com"). The output is NOT
3384+
NUL-terminated; the caller should append a NUL byte if needed.
3385+
If buf is NULL, the required buffer size is returned
3386+
in bufSz and LENGTH_ONLY_E is returned.
33833387
33843388
\param cert Pointer to the DecodedCert (must have been parsed).
33853389
\param buf Output buffer to receive the subject name string,
33863390
or NULL to query the required size.
33873391
\param bufSz Pointer to the buffer size. On input, the available
33883392
buffer size. On output, the number of bytes written
3389-
or the required size if buf is NULL.
3393+
(excluding any NUL terminator) or the required size
3394+
if buf is NULL.
33903395
33913396
\return 0 on success.
33923397
\return LENGTH_ONLY_E when buf is NULL (bufSz contains required size).
@@ -3407,15 +3412,20 @@ int wc_GetDecodedCertSubject(const struct DecodedCert* cert,
34073412
\brief Retrieves the issuer name from a decoded certificate.
34083413
34093414
This function copies the issuer name string from a DecodedCert
3410-
structure into the provided buffer. If buf is NULL, the required
3411-
buffer size is returned in bufSz and LENGTH_ONLY_E is returned.
3415+
structure into the provided buffer. The string uses a one-line
3416+
distinguished name format with "/" delimiters
3417+
(e.g. "/C=US/O=Org/CN=example.com"). The output is NOT
3418+
NUL-terminated; the caller should append a NUL byte if needed.
3419+
If buf is NULL, the required buffer size is returned
3420+
in bufSz and LENGTH_ONLY_E is returned.
34123421
34133422
\param cert Pointer to the DecodedCert (must have been parsed).
34143423
\param buf Output buffer to receive the issuer name string,
34153424
or NULL to query the required size.
34163425
\param bufSz Pointer to the buffer size. On input, the available
34173426
buffer size. On output, the number of bytes written
3418-
or the required size if buf is NULL.
3427+
(excluding any NUL terminator) or the required size
3428+
if buf is NULL.
34193429
34203430
\return 0 on success.
34213431
\return LENGTH_ONLY_E when buf is NULL (bufSz contains required size).

doc/dox_comments/header_files/ocsp.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ OcspRequest* wc_OcspRequest_new(void* heap);
7474
\brief Frees an OcspRequest structure.
7575
7676
This function releases all resources associated with an OcspRequest
77-
that was allocated with wc_OcspRequest_new(). It calls the internal
78-
FreeOcspRequest() before freeing the structure itself.
77+
that was allocated with wc_OcspRequest_new(). It frees any internal
78+
allocations associated with the request before freeing the structure
79+
itself.
7980
8081
\param request Pointer to the OcspRequest to free. May be NULL,
8182
in which case this function is a no-op.
@@ -161,8 +162,9 @@ OcspResponse* wc_OcspResponse_new(void* heap);
161162
\brief Frees an OcspResponse structure.
162163
163164
This function releases all resources associated with an OcspResponse
164-
that was allocated with wc_OcspResponse_new(). It calls the internal
165-
FreeOcspResponse() before freeing the structure itself.
165+
that was allocated with wc_OcspResponse_new(). It frees any internal
166+
allocations associated with the response before freeing the structure
167+
itself.
166168
167169
\param response Pointer to the OcspResponse to free. May be NULL,
168170
in which case this function is a no-op.
@@ -281,8 +283,14 @@ int wc_OcspResponder_AddSigner(OcspResponder* responder,
281283
Requires HAVE_OCSP_RESPONDER to be defined.
282284
283285
\param responder Pointer to the OcspResponder.
284-
\param caSubject The subject name string of the issuing CA.
285-
\param caSubjectSz Length of the caSubject string.
286+
\param caSubject The issuing CA subject name in the one-line
287+
distinguished name format used internally by
288+
the library (e.g. "/C=US/O=Org/CN=CA"). To
289+
avoid mismatches,
290+
obtain this value from wc_GetDecodedCertSubject()
291+
rather than constructing the string manually.
292+
\param caSubjectSz Length of the caSubject string in bytes,
293+
not including any NUL terminator.
286294
\param serial Pointer to the certificate serial number bytes.
287295
\param serialSz Size of the serial number in bytes.
288296
\param status Certificate status: CERT_GOOD, CERT_REVOKED,

0 commit comments

Comments
 (0)