Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crypto/x509/ext_dat.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ extern const X509V3_EXT_METHOD ossl_v3_single_use;
extern const X509V3_EXT_METHOD ossl_v3_targeting_information;
extern const X509V3_EXT_METHOD ossl_v3_audit_identity;
extern const X509V3_EXT_METHOD ossl_v3_bacons;
extern const X509V3_EXT_METHOD ossl_v3_delegated_name_constraints;
1 change: 1 addition & 0 deletions crypto/x509/standard_exts.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static const X509V3_EXT_METHOD *standard_exts[] = {
&ossl_v3_tls_feature,
&ossl_v3_ext_admission,
&ossl_v3_bacons,
&ossl_v3_delegated_name_constraints,
&ossl_v3_soa_identifier,
&ossl_v3_no_assertion,
&ossl_v3_single_use,
Expand Down
10 changes: 10 additions & 0 deletions crypto/x509/v3_ncons.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ const X509V3_EXT_METHOD ossl_v3_name_constraints = {
NULL
};

const X509V3_EXT_METHOD ossl_v3_delegated_name_constraints = {
NID_delegated_name_constraints, 0,
ASN1_ITEM_ref(NAME_CONSTRAINTS),
0, 0, 0, 0,
0, 0,
0, v2i_NAME_CONSTRAINTS,
i2r_NAME_CONSTRAINTS, 0,
NULL
};

ASN1_SEQUENCE(GENERAL_SUBTREE) = {
ASN1_SIMPLE(GENERAL_SUBTREE, base, GENERAL_NAME),
ASN1_IMP_OPT(GENERAL_SUBTREE, minimum, ASN1_INTEGER, 0),
Expand Down
12 changes: 12 additions & 0 deletions test/certs/ext-delegatedNameConstraints.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIB2jCCAcagAwIBAgIDAQIDMAsGCSqGSIb3DQEBBTAAMCIYDzIwMjEwODMxMDIx
ODAyWhgPMjAyMTA4MzEwMjE4MDJaMAAwggEgMAsGCSqGSIb3DQEBAQOCAQ8AMIIB
CgKCAQEAtnjLm1ts1hC4fNNt3UnQD9y73bDXgioTyWYSI3ca/KNfuTydjFTEYAmq
nuGrBOUfgbmH3PRQ0AmpqljgWTb3d3K8H4UFvDWQTPSS21IMjm8oqd19nE5GxWir
Gu0oDRzhWLHe1RZ7ZrohCPg/1Ocsy47QZuK2laFB0rEmrRWBmEYbDl3/wxf5XfqI
qpOynJB02thXrTCcTM7Rz1FqCFt/ZVZB5hKY2S+CTdE9OIVKlr4WHMfuvUYeOj06
GkwLFJHNv2tU+tovI3mYRxUuY4UupkS3MC+Otey7XKm1P+INjWWoegm6iCAt3Vus
pVz+6pU2xgl3nrAVMQHB4fReQPH0pQIDAQABo2EwXzBdBgNVHSoEVjBUoCgwJqQe
MBwxGjAYBgNVBAMMEVdpbGRib2FyIFNvZnR3YXJlgAEBgQEDoSgwJqQeMBwxGjAY
BgNVBAMMEVdpbGRib2FyIFNvZnR3YXJlgAECgQEEMAsGCSqGSIb3DQEBBQMBAA==
-----END CERTIFICATE-----
13 changes: 12 additions & 1 deletion test/recipes/25-test_x509.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;

setup("test_x509");

plan tests => 45;
plan tests => 48;

# Prevent MSys2 filename munging for arguments that look like file paths but
# aren't
Expand Down Expand Up @@ -162,6 +162,17 @@ cert_contains($bacons_cert,
"pathlen:3",
1, 'X.509 Basic Attribute Constraints Path Length');

my $dncons_cert = srctop_file(@certs, "ext-delegatedNameConstraints.pem");
cert_contains($dncons_cert,
"DirName:CN = Wil",
1, 'X.509 Delegated Name Constraints');
cert_contains($dncons_cert,
"Permitted:",
1, 'X.509 Delegated Name Constraints');
cert_contains($dncons_cert,
"Excluded:",
1, 'X.509 Delegated Name Constraints');

sub test_errors { # actually tests diagnostics of OSSL_STORE
my ($expected, $cert, @opts) = @_;
my $infile = srctop_file(@certs, $cert);
Expand Down