Add ESSCertIDv2 ASN.1 boilerplate
authorkn <kn@openbsd.org>
Sat, 16 Jul 2022 18:36:36 +0000 (18:36 +0000)
committerkn <kn@openbsd.org>
Sat, 16 Jul 2022 18:36:36 +0000 (18:36 +0000)
commitba539a43659d46be5767f3629998d4a3bef0809e
tree67db5828a83ff20d0acad935074cdf4e0ffcf116
parent1f6d7615c6bc7fa506da4ca61a1c5c52fe06dfc1
Add ESSCertIDv2 ASN.1 boilerplate

Guard the new code under LIBRESSL_INTERNAL to defer symbol addition and
minor library bump (thanks tb).

ts/ts.h bits from
RFC 5035 Enhanced Security Services (ESS) Update:
    Adding CertID Algorithm Agility

ts/ts_asn1.c bits expanded from
ASN1_SEQUENCE(ESS_CERT_ID_V2) = {
        ASN1_OPT(ESS_CERT_ID_V2, hash_alg, X509_ALGOR),
        ASN1_SIMPLE(ESS_CERT_ID_V2, hash, ASN1_OCTET_STRING),
        ASN1_OPT(ESS_CERT_ID_V2, issuer_serial, ESS_ISSUER_SERIAL)
} static_ASN1_SEQUENCE_END(ESS_CERT_ID_V2)

IMPLEMENT_ASN1_FUNCTIONS_const(ESS_CERT_ID_V2)
IMPLEMENT_ASN1_DUP_FUNCTION(ESS_CERT_ID_V2)

ASN1_SEQUENCE(ESS_SIGNING_CERT_V2) = {
        ASN1_SEQUENCE_OF(ESS_SIGNING_CERT_V2, cert_ids, ESS_CERT_ID_V2),
        ASN1_SEQUENCE_OF_OPT(ESS_SIGNING_CERT_V2, policy_info, POLICYINFO)
} static_ASN1_SEQUENCE_END(ESS_SIGNING_CERT_V2)

IMPLEMENT_ASN1_FUNCTIONS_const(ESS_SIGNING_CERT_V2)
IMPLEMENT_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT_V2)

Feedback OK tb
lib/libcrypto/ts/ts.h
lib/libcrypto/ts/ts_asn1.c