Lines Matching +full:- +full:a

8  *  SPDX-License-Identifier: Apache-2.0
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
43 * ASN1 is a standard to specify data structures.
46 #define MBEDTLS_ERR_ASN1_OUT_OF_DATA -0x0060 /**< Out of data when parsing an…
47 #define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -0x0062 /**< ASN1 tag was of an unexpect…
48 #define MBEDTLS_ERR_ASN1_INVALID_LENGTH -0x0064 /**< Error when trying to determ…
49 #define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH -0x0066 /**< Actual length differs from …
50 #define MBEDTLS_ERR_ASN1_INVALID_DATA -0x0068 /**< Data is invalid. */
51 #define MBEDTLS_ERR_ASN1_ALLOC_FAILED -0x006A /**< Memory allocation failed */
52 #define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -0x006C /**< Buffer too small when writi…
61 * - 0x02 -- tag indicating INTEGER
62 * - 0x01 -- length in octets
63 * - 0x05 -- value
88 /* Slightly smaller way to check if tag is a string tag
106 * +-------+-----+------------+
108 * +-------+-----+------------+
118 #define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1)
121 * Compares an mbedtls_asn1_buf structure to a reference OID.
123 * Only works for 'defined' oid_str values (MBEDTLS_OID_HMAC_SHA1), you cannot use a
127 ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) || \
128 memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 )
144 * Type-length-value structure that allows for ASN1 using DER.
166 * Container for a sequence of ASN.1 items
176 * Container for a sequence or list of 'named' ASN.1 data items
235 * \brief Retrieve a boolean ASN.1 tag and its value.
247 * a valid ASN.1 BOOLEAN.
266 * a valid ASN.1 INTEGER.
287 * a valid ASN.1 ENUMERATED.
296 * \brief Retrieve a bitstring ASN.1 tag and its value.
308 * extra data after a valid BIT STRING.
310 * a valid ASN.1 BIT STRING.
316 * \brief Retrieve a bitstring ASN.1 tag without unused bits and its
329 * a valid BIT STRING with a nonzero number of unused bits.
331 * a valid ASN.1 BIT STRING.
344 * \note On error, this function may return a partial list in \p cur.
345 * You must set `cur->next = NULL` before calling this function!
346 * Otherwise it is impossible to distinguish a previously non-null
347 * pointer from a pointer to an object allocated by this function.
350 * \c *cur. If the sequence is valid and non-empty, this
351 * function sets `cur->buf.tag` to \p tag. This allows
353 * a one-element sequence.
359 * \param cur A ::mbedtls_asn1_sequence which this function fills.
360 * When this function returns, \c *cur is the head of a linked
366 * first element, `*cur->next` describes the second element, etc.
376 * extra data after a valid SEQUENCE OF \p tag.
378 * an ASN.1 SEQUENCE in which an element has a tag that
380 * \return #MBEDTLS_ERR_ASN1_ALLOC_FAILED if a memory allocation failed.
382 * a valid ASN.1 SEQUENCE.
389 * \brief Free a heap-allocated linked list presentation of
393 * of a parsed ASN.1 sequence:
394 * - Allocate a head node `mbedtls_asn1_sequence *head` with mbedtls_calloc().
398 * - Allocate a head node `mbedtls_asn1_sequence *head` in any manner,
399 * for example on the stack. Make sure that `head->next == NULL`.
402 * call mbedtls_asn1_sequence_free() on `head->cur`,
413 * call a callback for each entry.
415 * This function checks that the input is a SEQUENCE of elements that
416 * each have a "must" tag, and calls a callback function on the elements
417 * that have a "may" tag.
419 * For example, to validate that the input is a SEQUENCE of `tag1` and call
425 * To validate that the input is a SEQUENCE of ANY and call `cb` on
431 * To validate that the input is a SEQUENCE of CHOICE {NULL, OCTET STRING}
437 * The callback is called on the elements with a "may" tag from left to
438 * right. If the input is not a valid SEQUENCE of elements with a "must" tag,
448 * on a successful invocation.
450 * \param tag_must_mask A mask to be applied to the ASN.1 tags found within
455 * For example, a value of \c 0 for both \p tag_must_mask
457 * while a value of \c 0xFF for \p tag_must_mask means
459 * \param tag_may_mask A mask to be applied to the ASN.1 tags found within
464 * For example, a value of \c 0 for \p tag_may_mask and
466 * while a value of \c 0xFF for \p tag_may_mask means
473 * - \p ctx.
474 * - The tag of the current element.
475 * - A pointer to the start of the current element's
477 * - The length of the content of the current element.
478 * If the callback returns a non-zero value,
486 * contains extra data after a valid SEQUENCE
489 * with an ASN.1 SEQUENCE in which an element has a tag
492 * a valid ASN.1 SEQUENCE.
493 * \return A non-zero error code forwarded from the callback
494 * \p cb in case the latter returns a non-zero value.
519 * a valid ASN.1 INTEGER.
543 * \return 0 if successful or a specific ASN.1 or MPI error code.
562 * \return 0 if successful or a specific ASN.1 or MPI error code.
569 * \brief Find a specific named_data entry in a sequence or list based on
576 * \return NULL if not found, or a pointer to the existing entry.
582 * \brief Free a mbedtls_asn1_named_data entry
586 * `entry->oid.p` and `entry->val.p`.
591 * \brief Free all entries in a mbedtls_asn1_named_data list.