@@ -100,6 +100,7 @@ int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
100100 * \param p The reference to the current position pointer.
101101 * \param start The start of the buffer, for bounds-checking.
102102 * \param X The MPI to write.
103+ * It must be non-negative.
103104 *
104105 * \return The number of bytes written to \p p on success.
105106 * \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,
184185 * \param p The reference to the current position pointer.
185186 * \param start The start of the buffer, for bounds-checking.
186187 * \param val The integer value to write.
188+ * It must be non-negative.
187189 *
188190 * \return The number of bytes written to \p p on success.
189191 * \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,
232234
233235/**
234236 * \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 ).
236238 *
237239 * \note This function works backwards in data buffer.
238240 *
@@ -332,9 +334,13 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
332334 * through (will be updated in case of a new entry).
333335 * \param oid The OID to look for.
334336 * \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 .
337339 * \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.
338344 *
339345 * \return A pointer to the new / existing entry on success.
340346 * \return \c NULL if if there was a memory allocation error.
0 commit comments