Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IPAddrBlock and ASIdentifiers extensions (RFC 3779) #4699

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions src/build-data/oids.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@
2.5.29.36 = X509v3.PolicyConstraints
2.5.29.37 = X509v3.ExtendedKeyUsage
1.3.6.1.5.5.7.1.1 = PKIX.AuthorityInformationAccess
# the following are taken from RFC 3779 https://www.rfc-editor.org/rfc/rfc3779.html
1.3.6.1.5.5.7.1.7 = PKIX.IpAddrBlocks
1.3.6.1.5.5.7.1.8 = PKIX.AutonomousSysIds
1.3.6.1.5.5.7.1.26 = PKIX.TNAuthList

2.5.29.32.0 = X509v3.AnyPolicy
Expand Down
6 changes: 5 additions & 1 deletion src/lib/asn1/oid_maps.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* OID maps
*
* This file was automatically generated by ./src/scripts/dev_tools/gen_oids.py on 2025-03-17
* This file was automatically generated by src/scripts/dev_tools/gen_oids.py on 2025-03-26
*
* All manual edits to this file will be lost. Edit the script
* then regenerate this source file.
Expand Down Expand Up @@ -236,6 +236,8 @@ std::unordered_map<OID, std::string> OID_Map::load_oid2str_map() {
{{1, 3, 6, 1, 4, 1, 8301, 3, 1, 2, 9, 0, 38}, "secp521r1"},
{{1, 3, 6, 1, 5, 5, 7, 1, 1}, "PKIX.AuthorityInformationAccess"},
{{1, 3, 6, 1, 5, 5, 7, 1, 26}, "PKIX.TNAuthList"},
{{1, 3, 6, 1, 5, 5, 7, 1, 7}, "PKIX.IpAddrBlocks"},
{{1, 3, 6, 1, 5, 5, 7, 1, 8}, "PKIX.AutonomousSysIds"},
{{1, 3, 6, 1, 5, 5, 7, 3, 1}, "PKIX.ServerAuth"},
{{1, 3, 6, 1, 5, 5, 7, 3, 2}, "PKIX.ClientAuth"},
{{1, 3, 6, 1, 5, 5, 7, 3, 3}, "PKIX.CodeSigning"},
Expand Down Expand Up @@ -504,13 +506,15 @@ std::unordered_map<std::string, OID> OID_Map::load_str2oid_map() {
{"PKCS9.MessageDigest", {1, 2, 840, 113549, 1, 9, 4}},
{"PKCS9.UnstructuredName", {1, 2, 840, 113549, 1, 9, 2}},
{"PKIX.AuthorityInformationAccess", {1, 3, 6, 1, 5, 5, 7, 1, 1}},
{"PKIX.AutonomousSysIds", {1, 3, 6, 1, 5, 5, 7, 1, 8}},
{"PKIX.CertificateAuthorityIssuers", {1, 3, 6, 1, 5, 5, 7, 48, 2}},
{"PKIX.ClientAuth", {1, 3, 6, 1, 5, 5, 7, 3, 2}},
{"PKIX.CodeSigning", {1, 3, 6, 1, 5, 5, 7, 3, 3}},
{"PKIX.EmailProtection", {1, 3, 6, 1, 5, 5, 7, 3, 4}},
{"PKIX.IPsecEndSystem", {1, 3, 6, 1, 5, 5, 7, 3, 5}},
{"PKIX.IPsecTunnel", {1, 3, 6, 1, 5, 5, 7, 3, 6}},
{"PKIX.IPsecUser", {1, 3, 6, 1, 5, 5, 7, 3, 7}},
{"PKIX.IpAddrBlocks", {1, 3, 6, 1, 5, 5, 7, 1, 7}},
{"PKIX.OCSP", {1, 3, 6, 1, 5, 5, 7, 48, 1}},
{"PKIX.OCSP.BasicResponse", {1, 3, 6, 1, 5, 5, 7, 48, 1, 1}},
{"PKIX.OCSP.NoCheck", {1, 3, 6, 1, 5, 5, 7, 48, 1, 5}},
Expand Down
4 changes: 4 additions & 0 deletions src/lib/x509/cert_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ const char* to_string(Certificate_Status_Code code) {
return "Certificate does not match provided name";
case Certificate_Status_Code::NAME_CONSTRAINT_ERROR:
return "Certificate does not pass name constraint";
case Certificate_Status_Code::IPADDR_BLOCK_ERROR:
return "IP Address Blocks extension invalid";
case Certificate_Status_Code::ASBLOCKS_ERROR:
return "AS Number Blocks extension invalid";
case Certificate_Status_Code::UNKNOWN_CRITICAL_EXTENSION:
return "Unknown critical extension encountered";
case Certificate_Status_Code::DUPLICATE_CERT_EXTENSION:
Expand Down
2 changes: 2 additions & 0 deletions src/lib/x509/pkix_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ enum class Certificate_Status_Code {
CERT_CHAIN_TOO_LONG = 4002,
CA_CERT_NOT_FOR_CERT_ISSUER = 4003,
NAME_CONSTRAINT_ERROR = 4004,
IPADDR_BLOCK_ERROR = 4011,
ASBLOCKS_ERROR = 4012,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weren't really sure what to call the errors, nor what kind of error messages to use. We think it's definitely a validation error, but unfortunately there wasn't any space left within the enum, so now the numbers are kind of awkward.


// Revocation errors
CA_CERT_NOT_FOR_CRL_ISSUER = 4005,
Expand Down
Loading
Loading