feat: support auditIdentity X.509v3 extension

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24754)
This commit is contained in:
Jonathan M. Wilbur 2024-06-27 20:29:49 +00:00 committed by Matt Caswell
parent bce3a8d57e
commit 9216859f7b
8 changed files with 915 additions and 886 deletions

File diff suppressed because it is too large Load Diff

View File

@ -519,7 +519,7 @@ id-pkix-mod 100 : id-mod-cmp2021-02
id-pe 1 : authorityInfoAccess : Authority Information Access
id-pe 2 : biometricInfo : Biometric Info
id-pe 3 : qcStatements
id-pe 4 : ac-auditIdentity : X509v3 Audit Identity
id-pe 4 : ac-auditEntity : X509v3 Audit Identity
id-pe 5 : ac-targeting
id-pe 6 : aaControls
id-pe 7 : sbgp-ipAddrBlock

View File

@ -17,7 +17,7 @@ SOURCE[../../libcrypto]=\
v3_asid.c v3_addr.c v3_tlsf.c v3_admis.c v3_no_rev_avail.c \
v3_soa_id.c v3_no_ass.c v3_group_ac.c v3_single_use.c v3_ind_iss.c \
x509_acert.c x509aset.c t_acert.c x_ietfatt.c v3_ac_tgt.c v3_sda.c \
v3_usernotice.c v3_battcons.c
v3_usernotice.c v3_battcons.c v3_audit_id.c
IF[{- !$disabled{'deprecated-3.0'} -}]
SOURCE[../../libcrypto]=x509type.c

View File

@ -40,3 +40,4 @@ extern const X509V3_EXT_METHOD ossl_v3_acc_cert_policies;
extern const X509V3_EXT_METHOD ossl_v3_acc_priv_policies;
extern const X509V3_EXT_METHOD ossl_v3_user_notice;
extern const X509V3_EXT_METHOD ossl_v3_battcons;
extern const X509V3_EXT_METHOD ossl_v3_audit_identity;

View File

@ -87,6 +87,7 @@ static const X509V3_EXT_METHOD *standard_exts[] = {
&ossl_v3_group_ac,
&ossl_v3_holder_name_constraints,
&ossl_v3_associated_info,
&ossl_v3_audit_identity,
};
/* Number of standard extensions */

20
crypto/x509/v3_audit_id.c Normal file
View File

@ -0,0 +1,20 @@
/*
* Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <openssl/x509v3.h>
#include "ext_dat.h"
const X509V3_EXT_METHOD ossl_v3_audit_identity = {
NID_ac_auditIdentity, 0, ASN1_ITEM_ref(ASN1_OCTET_STRING),
0, 0, 0, 0,
(X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING,
(X509V3_EXT_S2I)s2i_ASN1_OCTET_STRING,
0, 0, 0, 0,
NULL
};

View File

@ -264,6 +264,7 @@ OBJ_id_mod_dvcs="\x2B\x06\x01\x05\x05\x07\x00\x0F"
OBJ_id_mod_cmp2000="\x2B\x06\x01\x05\x05\x07\x00\x10"
OBJ_biometricInfo="\x2B\x06\x01\x05\x05\x07\x01\x02"
OBJ_qcStatements="\x2B\x06\x01\x05\x05\x07\x01\x03"
OBJ_ac_auditEntity="\x2B\x06\x01\x05\x05\x07\x01\x04"
OBJ_ac_targeting="\x2B\x06\x01\x05\x05\x07\x01\x05"
OBJ_aaControls="\x2B\x06\x01\x05\x05\x07\x01\x06"
OBJ_sbgp_ipAddrBlock="\x2B\x06\x01\x05\x05\x07\x01\x07"

View File

@ -176,6 +176,12 @@ int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
void OBJ_sigid_free(void);
/* This is to correct for the auditIdentity OID having been assigned the wrong
name. */
#define SN_ac_auditIdentity "ac-auditIdentity"
#define LN_ac_auditIdentity LN_ac_auditEntity
#define NID_ac_auditIdentity NID_ac_auditEntity
#define OBJ_ac_auditIdentity OBJ_ac_auditEntity
# ifdef __cplusplus
}