24#ifndef PROTOCORE_X509_VERIFY_H
25#define PROTOCORE_X509_VERIFY_H
33 PROTOCORE_X509_OK = 0,
34 PROTOCORE_X509_ERR_ARGS,
35 PROTOCORE_X509_ERR_ISSUER_NAME,
36 PROTOCORE_X509_ERR_NOT_YET_VALID,
37 PROTOCORE_X509_ERR_EXPIRED,
38 PROTOCORE_X509_ERR_NOT_A_CA,
39 PROTOCORE_X509_ERR_NO_CERT_SIGN,
40 PROTOCORE_X509_ERR_PATH_LEN,
41 PROTOCORE_X509_ERR_ALG_UNSUPPORTED,
42 PROTOCORE_X509_ERR_KEY_MALFORMED,
43 PROTOCORE_X509_ERR_SIG_MALFORMED,
44 PROTOCORE_X509_ERR_BAD_SIGNATURE,
72 protocore_x509_sig_alg
alg;
120 void (*
const link)(uint8_t *work);
136static const X509VerifyNs X509Verify __attribute__((unused)) = {
What an issuer check is given: the candidate, and how far down the chain it sits.
uint32_t depth
certificates below it in the path, 0 for the one that signs a leaf
const X509Cert * issuer
the candidate issuer
What a signature check is given: the certificate, and the one whose key signed it.
const X509Cert * cert
the certificate being checked
const X509Cert * issuer
the certificate whose subjectPublicKey signed it
What a message check is given: whose key verifies it, and the bytes it covers.
const uint8_t * msg
the bytes signed
const uint8_t * sig
the signature over them
const X509Cert * signer
the certificate whose subjectPublicKey verifies
protocore_x509_sig_alg alg
the scheme the signature is in
What a time check is given.
uint64_t now
seconds since the POSIX epoch
const X509Cert * cert
the certificate being checked
void(*const link)(uint8_t *work)
void(*const validity)(const uint8_t *work)
void(*const may_sign)(const uint8_t *work)
void(*const signature)(uint8_t *work)
void(*const message)(uint8_t *work)
X509MessageArgs message_args
protocore_x509_status status
X509IssuerArgs issuer_args
What a certificate SAYS, as types: the algorithm identifiers and the parsed view.
void protocore_x509_verify_may_sign(const uint8_t *work)
void protocore_x509_verify_signature(uint8_t *work)
X509VerifyVars X509VerifyV
The operands and the outcome.
uint8_t * protocore_x509_verify_span(void)
The PROTOCORE_X509_VERIFY_BORROW bytes a signature check runs out of.
void protocore_x509_verify_validity(const uint8_t *work)
EMBED_BEGIN_DECLS EMBED_ENUM_BYTE(protocore_x509_status, PROTOCORE_X509_OK=0, PROTOCORE_X509_ERR_ARGS, PROTOCORE_X509_ERR_ISSUER_NAME, PROTOCORE_X509_ERR_NOT_YET_VALID, PROTOCORE_X509_ERR_EXPIRED, PROTOCORE_X509_ERR_NOT_A_CA, PROTOCORE_X509_ERR_NO_CERT_SIGN, PROTOCORE_X509_ERR_PATH_LEN, PROTOCORE_X509_ERR_ALG_UNSUPPORTED, PROTOCORE_X509_ERR_KEY_MALFORMED, PROTOCORE_X509_ERR_SIG_MALFORMED, PROTOCORE_X509_ERR_BAD_SIGNATURE,)
Why a link was refused. A caller that only needs yes or no reads X509VerifyNs::ok.
void protocore_x509_verify_link(uint8_t *work)
void protocore_x509_verify_message(uint8_t *work)