@@ -100,6 +100,7 @@ int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
100
100
* \param p The reference to the current position pointer.
101
101
* \param start The start of the buffer, for bounds-checking.
102
102
* \param X The MPI to write.
103
+ * It must be non-negative.
103
104
*
104
105
* \return The number of bytes written to \p p on success.
105
106
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
@@ -184,6 +185,7 @@ int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start,
184
185
* \param p The reference to the current position pointer.
185
186
* \param start The start of the buffer, for bounds-checking.
186
187
* \param val The integer value to write.
188
+ * It must be non-negative.
187
189
*
188
190
* \return The number of bytes written to \p p on success.
189
191
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
@@ -232,7 +234,7 @@ int mbedtls_asn1_write_printable_string( unsigned char **p,
232
234
233
235
/**
234
236
* \brief Write a UTF8 string in ASN.1 format using the UTF8String
235
- * string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING ).
237
+ * string encoding tag (#MBEDTLS_ASN1_UTF8_STRING ).
236
238
*
237
239
* \note This function works backwards in data buffer.
238
240
*
@@ -332,9 +334,13 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
332
334
* through (will be updated in case of a new entry).
333
335
* \param oid The OID to look for.
334
336
* \param oid_len The size of the OID.
335
- * \param val The data to store (can be \c NULL if you want to fill
336
- * it by hand) .
337
+ * \param val The associated data to store. If this is \c NULL,
338
+ * no data is copied to the new or existing buffer .
337
339
* \param val_len The minimum length of the data buffer needed.
340
+ * If this is 0, do not allocate a buffer for the associated
341
+ * data.
342
+ * If the OID was already present, enlarge, shrink or free
343
+ * the existing buffer to fit \p val_len.
338
344
*
339
345
* \return A pointer to the new / existing entry on success.
340
346
* \return \c NULL if if there was a memory allocation error.
0 commit comments