|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
ASN.1 Distinguished Encoding Rules: one TLV at a time, over the caller's bytes. More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | DerTlv |
| One value in the caller's bytes: what it is, where its content is, and what follows. More... | |
| struct | DerReadArgs |
| The bytes a read walks, and where in them it starts. More... | |
| struct | DerOidArgs |
| An object identifier a comparison names, in its encoded form (X.690 sec 8.19). More... | |
| struct | DerVars |
| struct | DerNs |
| The entries. More... | |
Macros | |
| #define | PROTOCORE_DER_CONSTRUCTED 0x20u |
| X.690 sec 8.1.2.5: the constructed bit, set on a value that holds other values. | |
| #define | PROTOCORE_DER_CONTEXT(n) (0x80u | (uint8_t)(n)) |
| X.690 sec 8.1.2.2: a context-specific tag, as an X.509 field's [n]. | |
| #define | PROTOCORE_DER_CONTEXT_CONSTRUCTED(n) (0xA0u | (uint8_t)(n)) |
X.690 sec 8.1.2 identifier octets: the universal tags this profile reads. | |
| #define | PROTOCORE_DER_BOOLEAN 0x01u |
| #define | PROTOCORE_DER_INTEGER 0x02u |
| #define | PROTOCORE_DER_BIT_STRING 0x03u |
| #define | PROTOCORE_DER_OCTET_STRING 0x04u |
| #define | PROTOCORE_DER_NULL 0x05u |
| #define | PROTOCORE_DER_OID 0x06u |
| #define | PROTOCORE_DER_UTF8_STRING 0x0Cu |
| #define | PROTOCORE_DER_PRINTABLE_STRING 0x13u |
| #define | PROTOCORE_DER_IA5_STRING 0x16u |
| #define | PROTOCORE_DER_UTC_TIME 0x17u |
| #define | PROTOCORE_DER_GENERALIZED_TIME 0x18u |
| #define | PROTOCORE_DER_SEQUENCE 0x30u |
| #define | PROTOCORE_DER_SET 0x31u |
Functions | |
| void | protocore_der_read (uint8_t *work) |
| void | protocore_der_enter (uint8_t *work) |
| void | protocore_der_uint (uint8_t *work) |
| void | protocore_der_bitstring (uint8_t *work) |
| void | protocore_der_oid_eq (uint8_t *work) |
| void | protocore_der_time (uint8_t *work) |
Variables | |
| DerVars | DerV |
| The operands and the outcome. | |
ASN.1 Distinguished Encoding Rules: one TLV at a time, over the caller's bytes.
X.690 sec 10 makes DER a canonical subset of BER: every length is definite, and the shortest form that fits. That is the whole of what this reads - an indefinite length, a redundant long form, or a length that runs past the caller's buffer is refused rather than guessed at, because a parser that accepts more than the encoding allows accepts two encodings of the same certificate and signature verification covers only one of them.
Nothing is copied and nothing is allocated. A read reports a tag, a pointer into the caller's own bytes, a length, and where the next value begins, so walking a structure is a sequence of reads against one buffer that outlives them all.
The caller holds the position. A chain walk has two certificates open at once, so the cursor is a value on the call rather than state in this module.
Definition in file der.h.
| #define PROTOCORE_DER_CONSTRUCTED 0x20u |
| #define PROTOCORE_DER_CONTEXT | ( | n | ) | (0x80u | (uint8_t)(n)) |
| #define PROTOCORE_DER_CONTEXT_CONSTRUCTED | ( | n | ) | (0xA0u | (uint8_t)(n)) |
| void protocore_der_read | ( | uint8_t * | work | ) |
| void protocore_der_enter | ( | uint8_t * | work | ) |
| void protocore_der_uint | ( | uint8_t * | work | ) |
| void protocore_der_bitstring | ( | uint8_t * | work | ) |
| void protocore_der_oid_eq | ( | uint8_t * | work | ) |
| void protocore_der_time | ( | uint8_t * | work | ) |
|
extern |
The operands and the outcome.