@@ -276,13 +276,28 @@ int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end
276
276
size_t * len );
277
277
278
278
/**
279
- * \brief Parses and splits an ASN.1 "SEQUENCE OF <tag>"
280
- * Updated the pointer to immediately behind the full sequence tag.
279
+ * \brief This function parses and splits an ASN.1 "SEQUENCE OF <tag>"
280
+ * and updates the source buffer pointer to immediately behind
281
+ * the full sequence.
281
282
*
282
- * \param p The position in the ASN.1 data
283
- * \param end End of data
284
- * \param cur First variable in the chain to fill
285
- * \param tag Type of sequence
283
+ * \param p The address of the pointer to the beginning of the
284
+ * ASN.1 SEQUENCE OF structure, including ASN.1 tag+length header.
285
+ * On success, `*p` is advanced to point to the first byte
286
+ * following the parsed ASN.1 sequence.
287
+ * \param end The end of the ASN.1 input buffer starting at \p p. This is
288
+ * used for bounds checking.
289
+ * \param cur The address at which to store the first entry in the parsed
290
+ * sequence. Further entries are heap-allocated and referenced
291
+ * from \p cur.
292
+ * \param tag The common tag of the entries in the ASN.1 sequence.
293
+ *
294
+ * \note Ownership for the heap-allocated elements \c cur->next,
295
+ * \c cur->next->next, ..., is passed to the caller. It
296
+ * is hence the caller's responsibility to free them when
297
+ * no longer needed, and mbedtls_asn1_sequence_free() can
298
+ * be used for that, passing \c cur->next as the \c seq
299
+ * argument (or \p cur if \p cur itself was heap-allocated
300
+ * by the caller).
286
301
*
287
302
* \return 0 if successful or a specific ASN.1 error code.
288
303
*/
0 commit comments