diff options
author | Jack Lloyd <[email protected]> | 2018-02-07 15:21:46 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-07 15:21:46 -0500 |
commit | dc5b0ab629942d6675f70b5450f7fd12c05320ed (patch) | |
tree | 02862367894fe95f4ad0a9110469ec7c383adbee | |
parent | 8fb4037b351d757945bf42f771c54b593f8e0191 (diff) |
Use new literal syntax for OIDs
Reduces size of oid_maps object file by a ~16K
-rw-r--r-- | src/lib/asn1/oid_maps.cpp | 392 | ||||
-rw-r--r-- | src/lib/asn1/oids.cpp | 22 | ||||
-rwxr-xr-x | src/scripts/oids.py | 7 |
3 files changed, 215 insertions, 206 deletions
diff --git a/src/lib/asn1/oid_maps.cpp b/src/lib/asn1/oid_maps.cpp index c291a9cd6..d0d961e27 100644 --- a/src/lib/asn1/oid_maps.cpp +++ b/src/lib/asn1/oid_maps.cpp @@ -1,7 +1,7 @@ /* * OID maps * -* This file was automatically generated by src/scripts/oids.py on 2018-01-09 +* This file was automatically generated by ./src/scripts/oids.py on 2018-02-07 * * All manual edits to this file will be lost. Edit the script * then regenerate this source file. @@ -221,201 +221,201 @@ std::unordered_map<std::string, std::string> OIDS::load_oid2str_map() std::unordered_map<std::string, OID> OIDS::load_str2oid_map() { return std::unordered_map<std::string,OID>{ - { "AES-128/CBC", OID("2.16.840.1.101.3.4.1.2") }, - { "AES-128/CCM", OID("2.16.840.1.101.3.4.1.7") }, - { "AES-128/GCM", OID("2.16.840.1.101.3.4.1.6") }, - { "AES-128/OCB", OID("1.3.6.1.4.1.25258.3.2.1") }, - { "AES-192/CBC", OID("2.16.840.1.101.3.4.1.22") }, - { "AES-192/CCM", OID("2.16.840.1.101.3.4.1.27") }, - { "AES-192/GCM", OID("2.16.840.1.101.3.4.1.26") }, - { "AES-192/OCB", OID("1.3.6.1.4.1.25258.3.2.2") }, - { "AES-256/CBC", OID("2.16.840.1.101.3.4.1.42") }, - { "AES-256/CCM", OID("2.16.840.1.101.3.4.1.47") }, - { "AES-256/GCM", OID("2.16.840.1.101.3.4.1.46") }, - { "AES-256/OCB", OID("1.3.6.1.4.1.25258.3.2.3") }, - { "CAST-128/CBC", OID("1.2.840.113533.7.66.10") }, - { "Compression.Zlib", OID("1.2.840.113549.1.9.16.3.8") }, - { "Curve25519", OID("1.3.101.110") }, - { "DES/CBC", OID("1.3.14.3.2.7") }, - { "DH", OID("1.2.840.10046.2.1") }, - { "DSA", OID("1.2.840.10040.4.1") }, - { "DSA/EMSA1(SHA-160)", OID("1.2.840.10040.4.3") }, - { "DSA/EMSA1(SHA-224)", OID("2.16.840.1.101.3.4.3.1") }, - { "DSA/EMSA1(SHA-256)", OID("2.16.840.1.101.3.4.3.2") }, - { "DSA/EMSA1(SHA-3(224))", OID("2.16.840.1.101.3.4.3.5") }, - { "DSA/EMSA1(SHA-3(256))", OID("2.16.840.1.101.3.4.3.6") }, - { "DSA/EMSA1(SHA-3(384))", OID("2.16.840.1.101.3.4.3.7") }, - { "DSA/EMSA1(SHA-3(512))", OID("2.16.840.1.101.3.4.3.8") }, - { "DSA/EMSA1(SHA-384)", OID("2.16.840.1.101.3.4.3.3") }, - { "DSA/EMSA1(SHA-512)", OID("2.16.840.1.101.3.4.3.4") }, - { "ECDH", OID("1.3.132.1.12") }, - { "ECDSA", OID("1.2.840.10045.2.1") }, - { "ECDSA/EMSA1(SHA-160)", OID("1.2.840.10045.4.1") }, - { "ECDSA/EMSA1(SHA-224)", OID("1.2.840.10045.4.3.1") }, - { "ECDSA/EMSA1(SHA-256)", OID("1.2.840.10045.4.3.2") }, - { "ECDSA/EMSA1(SHA-3(224))", OID("2.16.840.1.101.3.4.3.9") }, - { "ECDSA/EMSA1(SHA-3(256))", OID("2.16.840.1.101.3.4.3.10") }, - { "ECDSA/EMSA1(SHA-3(384))", OID("2.16.840.1.101.3.4.3.11") }, - { "ECDSA/EMSA1(SHA-3(512))", OID("2.16.840.1.101.3.4.3.12") }, - { "ECDSA/EMSA1(SHA-384)", OID("1.2.840.10045.4.3.3") }, - { "ECDSA/EMSA1(SHA-512)", OID("1.2.840.10045.4.3.4") }, - { "ECGDSA", OID("1.3.36.3.3.2.5.2.1") }, - { "ECGDSA/EMSA1(RIPEMD-160)", OID("1.3.36.3.3.2.5.4.1") }, - { "ECGDSA/EMSA1(SHA-160)", OID("1.3.36.3.3.2.5.4.2") }, - { "ECGDSA/EMSA1(SHA-224)", OID("1.3.36.3.3.2.5.4.3") }, - { "ECGDSA/EMSA1(SHA-256)", OID("1.3.36.3.3.2.5.4.4") }, - { "ECGDSA/EMSA1(SHA-384)", OID("1.3.36.3.3.2.5.4.5") }, - { "ECGDSA/EMSA1(SHA-512)", OID("1.3.36.3.3.2.5.4.6") }, - { "ECKCDSA", OID("1.0.14888.3.0.5") }, - { "ECKCDSA/EMSA1(SHA-1)", OID("1.2.410.200004.1.100.4.3") }, - { "ECKCDSA/EMSA1(SHA-224)", OID("1.2.410.200004.1.100.4.4") }, - { "ECKCDSA/EMSA1(SHA-256)", OID("1.2.410.200004.1.100.4.5") }, - { "Ed25519", OID("1.3.101.112") }, - { "ElGamal", OID("1.3.6.1.4.1.3029.1.2.1") }, - { "GOST-34.10", OID("1.2.643.2.2.19") }, - { "GOST-34.10/EMSA1(GOST-R-34.11-94)", OID("1.2.643.2.2.3") }, - { "GOST-34.10/EMSA1(SHA-256)", OID("1.3.6.1.4.1.25258.1.6.1") }, - { "HMAC(SHA-160)", OID("1.2.840.113549.2.7") }, - { "HMAC(SHA-224)", OID("1.2.840.113549.2.8") }, - { "HMAC(SHA-256)", OID("1.2.840.113549.2.9") }, - { "HMAC(SHA-384)", OID("1.2.840.113549.2.10") }, - { "HMAC(SHA-512)", OID("1.2.840.113549.2.11") }, - { "KeyWrap.AES-128", OID("2.16.840.1.101.3.4.1.5") }, - { "KeyWrap.AES-192", OID("2.16.840.1.101.3.4.1.25") }, - { "KeyWrap.AES-256", OID("2.16.840.1.101.3.4.1.45") }, - { "KeyWrap.CAST-128", OID("1.2.840.113533.7.66.15") }, - { "KeyWrap.RC2", OID("1.2.840.113549.1.9.16.3.7") }, - { "KeyWrap.TripleDES", OID("1.2.840.113549.1.9.16.3.6") }, - { "MD5", OID("1.2.840.113549.2.5") }, - { "MGF1", OID("1.2.840.113549.1.1.8") }, - { "McEliece", OID("1.3.6.1.4.1.25258.1.3") }, - { "Microsoft SmartcardLogon", OID("1.3.6.1.4.1.311.20.2.2") }, - { "PBE-PKCS5v20", OID("1.2.840.113549.1.5.13") }, - { "PKCS5.PBKDF2", OID("1.2.840.113549.1.5.12") }, - { "PKCS9.ChallengePassword", OID("1.2.840.113549.1.9.7") }, - { "PKCS9.ContentType", OID("1.2.840.113549.1.9.3") }, - { "PKCS9.EmailAddress", OID("1.2.840.113549.1.9.1") }, - { "PKCS9.ExtensionRequest", OID("1.2.840.113549.1.9.14") }, - { "PKCS9.MessageDigest", OID("1.2.840.113549.1.9.4") }, - { "PKCS9.UnstructuredName", OID("1.2.840.113549.1.9.2") }, - { "PKIX.AuthorityInformationAccess", OID("1.3.6.1.5.5.7.1.1") }, - { "PKIX.CertificateAuthorityIssuers", OID("1.3.6.1.5.5.7.48.2") }, - { "PKIX.ClientAuth", OID("1.3.6.1.5.5.7.3.2") }, - { "PKIX.CodeSigning", OID("1.3.6.1.5.5.7.3.3") }, - { "PKIX.EmailProtection", OID("1.3.6.1.5.5.7.3.4") }, - { "PKIX.IPsecEndSystem", OID("1.3.6.1.5.5.7.3.5") }, - { "PKIX.IPsecTunnel", OID("1.3.6.1.5.5.7.3.6") }, - { "PKIX.IPsecUser", OID("1.3.6.1.5.5.7.3.7") }, - { "PKIX.OCSP", OID("1.3.6.1.5.5.7.48.1") }, - { "PKIX.OCSP.BasicResponse", OID("1.3.6.1.5.5.7.48.1.1") }, - { "PKIX.OCSPSigning", OID("1.3.6.1.5.5.7.3.9") }, - { "PKIX.ServerAuth", OID("1.3.6.1.5.5.7.3.1") }, - { "PKIX.TimeStamping", OID("1.3.6.1.5.5.7.3.8") }, - { "PKIX.XMPPAddr", OID("1.3.6.1.5.5.7.8.5") }, - { "RC2/CBC", OID("1.2.840.113549.3.2") }, - { "RIPEMD-160", OID("1.3.36.3.2.1") }, - { "RSA", OID("1.2.840.113549.1.1.1") }, - { "RSA/EMSA3(MD5)", OID("1.2.840.113549.1.1.4") }, - { "RSA/EMSA3(RIPEMD-160)", OID("1.3.36.3.3.1.2") }, - { "RSA/EMSA3(SHA-160)", OID("1.2.840.113549.1.1.5") }, - { "RSA/EMSA3(SHA-224)", OID("1.2.840.113549.1.1.14") }, - { "RSA/EMSA3(SHA-256)", OID("1.2.840.113549.1.1.11") }, - { "RSA/EMSA3(SHA-3(224))", OID("2.16.840.1.101.3.4.3.13") }, - { "RSA/EMSA3(SHA-3(256))", OID("2.16.840.1.101.3.4.3.14") }, - { "RSA/EMSA3(SHA-3(384))", OID("2.16.840.1.101.3.4.3.15") }, - { "RSA/EMSA3(SHA-3(512))", OID("2.16.840.1.101.3.4.3.16") }, - { "RSA/EMSA3(SHA-384)", OID("1.2.840.113549.1.1.12") }, - { "RSA/EMSA3(SHA-512)", OID("1.2.840.113549.1.1.13") }, - { "RSA/EMSA3(SHA-512-256)", OID("1.2.840.113549.1.1.16") }, - { "RSA/EMSA3(SM3)", OID("1.2.156.10197.1.504") }, - { "RSA/EMSA4", OID("1.2.840.113549.1.1.10") }, - { "RSA/OAEP", OID("1.2.840.113549.1.1.7") }, - { "SEED/CBC", OID("1.2.410.200004.1.4") }, - { "SHA-160", OID("1.3.14.3.2.26") }, - { "SHA-224", OID("2.16.840.1.101.3.4.2.4") }, - { "SHA-256", OID("2.16.840.1.101.3.4.2.1") }, - { "SHA-3(224)", OID("2.16.840.1.101.3.4.2.7") }, - { "SHA-3(256)", OID("2.16.840.1.101.3.4.2.8") }, - { "SHA-3(384)", OID("2.16.840.1.101.3.4.2.9") }, - { "SHA-3(512)", OID("2.16.840.1.101.3.4.2.10") }, - { "SHA-384", OID("2.16.840.1.101.3.4.2.2") }, - { "SHA-512", OID("2.16.840.1.101.3.4.2.3") }, - { "SHA-512-256", OID("2.16.840.1.101.3.4.2.6") }, - { "SHAKE-128", OID("2.16.840.1.101.3.4.2.11") }, - { "SHAKE-256", OID("2.16.840.1.101.3.4.2.12") }, - { "SM2_Enc", OID("1.2.156.10197.1.301.3") }, - { "SM2_Kex", OID("1.2.156.10197.1.301.2") }, - { "SM2_Sig", OID("1.2.156.10197.1.301.1") }, - { "SM3", OID("1.2.156.10197.1.401") }, - { "Serpent/CBC", OID("1.3.6.1.4.1.25258.3.1") }, - { "Serpent/GCM", OID("1.3.6.1.4.1.25258.3.101") }, - { "Serpent/OCB", OID("1.3.6.1.4.1.25258.3.2.4") }, - { "Streebog-256", OID("1.2.643.7.1.1.2.2") }, - { "Streebog-512", OID("1.2.643.7.1.1.2.3") }, - { "Threefish-512/CBC", OID("1.3.6.1.4.1.25258.3.2") }, - { "Tiger(24,3)", OID("1.3.6.1.4.1.11591.12.2") }, - { "TripleDES/CBC", OID("1.2.840.113549.3.7") }, - { "Twofish/CBC", OID("1.3.6.1.4.1.25258.3.3") }, - { "Twofish/GCM", OID("1.3.6.1.4.1.25258.3.102") }, - { "Twofish/OCB", OID("1.3.6.1.4.1.25258.3.2.5") }, - { "X509v3.AnyPolicy", OID("2.5.29.32.0") }, - { "X509v3.AuthorityKeyIdentifier", OID("2.5.29.35") }, - { "X509v3.BasicConstraints", OID("2.5.29.19") }, - { "X509v3.CRLDistributionPoints", OID("2.5.29.31") }, - { "X509v3.CRLIssuingDistributionPoint", OID("2.5.29.28") }, - { "X509v3.CRLNumber", OID("2.5.29.20") }, - { "X509v3.CertificatePolicies", OID("2.5.29.32") }, - { "X509v3.ExtendedKeyUsage", OID("2.5.29.37") }, - { "X509v3.HoldInstructionCode", OID("2.5.29.23") }, - { "X509v3.InvalidityDate", OID("2.5.29.24") }, - { "X509v3.IssuerAlternativeName", OID("2.5.29.18") }, - { "X509v3.KeyUsage", OID("2.5.29.15") }, - { "X509v3.NameConstraints", OID("2.5.29.30") }, - { "X509v3.PolicyConstraints", OID("2.5.29.36") }, - { "X509v3.ReasonCode", OID("2.5.29.21") }, - { "X509v3.SubjectAlternativeName", OID("2.5.29.17") }, - { "X509v3.SubjectKeyIdentifier", OID("2.5.29.14") }, - { "X520.CommonName", OID("2.5.4.3") }, - { "X520.Country", OID("2.5.4.6") }, - { "X520.DNQualifier", OID("2.5.4.46") }, - { "X520.GenerationalQualifier", OID("2.5.4.44") }, - { "X520.GivenName", OID("2.5.4.42") }, - { "X520.Initials", OID("2.5.4.43") }, - { "X520.Locality", OID("2.5.4.7") }, - { "X520.Organization", OID("2.5.4.10") }, - { "X520.OrganizationalUnit", OID("2.5.4.11") }, - { "X520.Pseudonym", OID("2.5.4.65") }, - { "X520.SerialNumber", OID("2.5.4.5") }, - { "X520.State", OID("2.5.4.8") }, - { "X520.Surname", OID("2.5.4.4") }, - { "X520.Title", OID("2.5.4.12") }, - { "XMSS", OID("1.3.6.1.4.1.25258.1.5") }, - { "brainpool160r1", OID("1.3.36.3.3.2.8.1.1.1") }, - { "brainpool192r1", OID("1.3.36.3.3.2.8.1.1.3") }, - { "brainpool224r1", OID("1.3.36.3.3.2.8.1.1.5") }, - { "brainpool256r1", OID("1.3.36.3.3.2.8.1.1.7") }, - { "brainpool320r1", OID("1.3.36.3.3.2.8.1.1.9") }, - { "brainpool384r1", OID("1.3.36.3.3.2.8.1.1.11") }, - { "brainpool512r1", OID("1.3.36.3.3.2.8.1.1.13") }, - { "frp256v1", OID("1.2.250.1.223.101.256.1") }, - { "gost_256A", OID("1.2.643.2.2.35.1") }, - { "secp160k1", OID("1.3.132.0.9") }, - { "secp160r1", OID("1.3.132.0.8") }, - { "secp160r2", OID("1.3.132.0.30") }, - { "secp192k1", OID("1.3.132.0.31") }, - { "secp192r1", OID("1.2.840.10045.3.1.1") }, - { "secp224k1", OID("1.3.132.0.32") }, - { "secp224r1", OID("1.3.132.0.33") }, - { "secp256k1", OID("1.3.132.0.10") }, - { "secp256r1", OID("1.2.840.10045.3.1.7") }, - { "secp384r1", OID("1.3.132.0.34") }, - { "secp521r1", OID("1.3.132.0.35") }, - { "sm2p256v1", OID("1.2.156.10197.1.301") }, - { "x962_p192v2", OID("1.2.840.10045.3.1.2") }, - { "x962_p192v3", OID("1.2.840.10045.3.1.3") }, - { "x962_p239v1", OID("1.2.840.10045.3.1.4") }, - { "x962_p239v2", OID("1.2.840.10045.3.1.5") }, - { "x962_p239v3", OID("1.2.840.10045.3.1.6") } + { "AES-128/CBC", OID({2,16,840,1,101,3,4,1,2}) }, + { "AES-128/CCM", OID({2,16,840,1,101,3,4,1,7}) }, + { "AES-128/GCM", OID({2,16,840,1,101,3,4,1,6}) }, + { "AES-128/OCB", OID({1,3,6,1,4,1,25258,3,2,1}) }, + { "AES-192/CBC", OID({2,16,840,1,101,3,4,1,22}) }, + { "AES-192/CCM", OID({2,16,840,1,101,3,4,1,27}) }, + { "AES-192/GCM", OID({2,16,840,1,101,3,4,1,26}) }, + { "AES-192/OCB", OID({1,3,6,1,4,1,25258,3,2,2}) }, + { "AES-256/CBC", OID({2,16,840,1,101,3,4,1,42}) }, + { "AES-256/CCM", OID({2,16,840,1,101,3,4,1,47}) }, + { "AES-256/GCM", OID({2,16,840,1,101,3,4,1,46}) }, + { "AES-256/OCB", OID({1,3,6,1,4,1,25258,3,2,3}) }, + { "CAST-128/CBC", OID({1,2,840,113533,7,66,10}) }, + { "Compression.Zlib", OID({1,2,840,113549,1,9,16,3,8}) }, + { "Curve25519", OID({1,3,101,110}) }, + { "DES/CBC", OID({1,3,14,3,2,7}) }, + { "DH", OID({1,2,840,10046,2,1}) }, + { "DSA", OID({1,2,840,10040,4,1}) }, + { "DSA/EMSA1(SHA-160)", OID({1,2,840,10040,4,3}) }, + { "DSA/EMSA1(SHA-224)", OID({2,16,840,1,101,3,4,3,1}) }, + { "DSA/EMSA1(SHA-256)", OID({2,16,840,1,101,3,4,3,2}) }, + { "DSA/EMSA1(SHA-3(224))", OID({2,16,840,1,101,3,4,3,5}) }, + { "DSA/EMSA1(SHA-3(256))", OID({2,16,840,1,101,3,4,3,6}) }, + { "DSA/EMSA1(SHA-3(384))", OID({2,16,840,1,101,3,4,3,7}) }, + { "DSA/EMSA1(SHA-3(512))", OID({2,16,840,1,101,3,4,3,8}) }, + { "DSA/EMSA1(SHA-384)", OID({2,16,840,1,101,3,4,3,3}) }, + { "DSA/EMSA1(SHA-512)", OID({2,16,840,1,101,3,4,3,4}) }, + { "ECDH", OID({1,3,132,1,12}) }, + { "ECDSA", OID({1,2,840,10045,2,1}) }, + { "ECDSA/EMSA1(SHA-160)", OID({1,2,840,10045,4,1}) }, + { "ECDSA/EMSA1(SHA-224)", OID({1,2,840,10045,4,3,1}) }, + { "ECDSA/EMSA1(SHA-256)", OID({1,2,840,10045,4,3,2}) }, + { "ECDSA/EMSA1(SHA-3(224))", OID({2,16,840,1,101,3,4,3,9}) }, + { "ECDSA/EMSA1(SHA-3(256))", OID({2,16,840,1,101,3,4,3,10}) }, + { "ECDSA/EMSA1(SHA-3(384))", OID({2,16,840,1,101,3,4,3,11}) }, + { "ECDSA/EMSA1(SHA-3(512))", OID({2,16,840,1,101,3,4,3,12}) }, + { "ECDSA/EMSA1(SHA-384)", OID({1,2,840,10045,4,3,3}) }, + { "ECDSA/EMSA1(SHA-512)", OID({1,2,840,10045,4,3,4}) }, + { "ECGDSA", OID({1,3,36,3,3,2,5,2,1}) }, + { "ECGDSA/EMSA1(RIPEMD-160)", OID({1,3,36,3,3,2,5,4,1}) }, + { "ECGDSA/EMSA1(SHA-160)", OID({1,3,36,3,3,2,5,4,2}) }, + { "ECGDSA/EMSA1(SHA-224)", OID({1,3,36,3,3,2,5,4,3}) }, + { "ECGDSA/EMSA1(SHA-256)", OID({1,3,36,3,3,2,5,4,4}) }, + { "ECGDSA/EMSA1(SHA-384)", OID({1,3,36,3,3,2,5,4,5}) }, + { "ECGDSA/EMSA1(SHA-512)", OID({1,3,36,3,3,2,5,4,6}) }, + { "ECKCDSA", OID({1,0,14888,3,0,5}) }, + { "ECKCDSA/EMSA1(SHA-1)", OID({1,2,410,200004,1,100,4,3}) }, + { "ECKCDSA/EMSA1(SHA-224)", OID({1,2,410,200004,1,100,4,4}) }, + { "ECKCDSA/EMSA1(SHA-256)", OID({1,2,410,200004,1,100,4,5}) }, + { "Ed25519", OID({1,3,101,112}) }, + { "ElGamal", OID({1,3,6,1,4,1,3029,1,2,1}) }, + { "GOST-34.10", OID({1,2,643,2,2,19}) }, + { "GOST-34.10/EMSA1(GOST-R-34.11-94)", OID({1,2,643,2,2,3}) }, + { "GOST-34.10/EMSA1(SHA-256)", OID({1,3,6,1,4,1,25258,1,6,1}) }, + { "HMAC(SHA-160)", OID({1,2,840,113549,2,7}) }, + { "HMAC(SHA-224)", OID({1,2,840,113549,2,8}) }, + { "HMAC(SHA-256)", OID({1,2,840,113549,2,9}) }, + { "HMAC(SHA-384)", OID({1,2,840,113549,2,10}) }, + { "HMAC(SHA-512)", OID({1,2,840,113549,2,11}) }, + { "KeyWrap.AES-128", OID({2,16,840,1,101,3,4,1,5}) }, + { "KeyWrap.AES-192", OID({2,16,840,1,101,3,4,1,25}) }, + { "KeyWrap.AES-256", OID({2,16,840,1,101,3,4,1,45}) }, + { "KeyWrap.CAST-128", OID({1,2,840,113533,7,66,15}) }, + { "KeyWrap.RC2", OID({1,2,840,113549,1,9,16,3,7}) }, + { "KeyWrap.TripleDES", OID({1,2,840,113549,1,9,16,3,6}) }, + { "MD5", OID({1,2,840,113549,2,5}) }, + { "MGF1", OID({1,2,840,113549,1,1,8}) }, + { "McEliece", OID({1,3,6,1,4,1,25258,1,3}) }, + { "Microsoft SmartcardLogon", OID({1,3,6,1,4,1,311,20,2,2}) }, + { "PBE-PKCS5v20", OID({1,2,840,113549,1,5,13}) }, + { "PKCS5.PBKDF2", OID({1,2,840,113549,1,5,12}) }, + { "PKCS9.ChallengePassword", OID({1,2,840,113549,1,9,7}) }, + { "PKCS9.ContentType", OID({1,2,840,113549,1,9,3}) }, + { "PKCS9.EmailAddress", OID({1,2,840,113549,1,9,1}) }, + { "PKCS9.ExtensionRequest", OID({1,2,840,113549,1,9,14}) }, + { "PKCS9.MessageDigest", OID({1,2,840,113549,1,9,4}) }, + { "PKCS9.UnstructuredName", OID({1,2,840,113549,1,9,2}) }, + { "PKIX.AuthorityInformationAccess", OID({1,3,6,1,5,5,7,1,1}) }, + { "PKIX.CertificateAuthorityIssuers", OID({1,3,6,1,5,5,7,48,2}) }, + { "PKIX.ClientAuth", OID({1,3,6,1,5,5,7,3,2}) }, + { "PKIX.CodeSigning", OID({1,3,6,1,5,5,7,3,3}) }, + { "PKIX.EmailProtection", OID({1,3,6,1,5,5,7,3,4}) }, + { "PKIX.IPsecEndSystem", OID({1,3,6,1,5,5,7,3,5}) }, + { "PKIX.IPsecTunnel", OID({1,3,6,1,5,5,7,3,6}) }, + { "PKIX.IPsecUser", OID({1,3,6,1,5,5,7,3,7}) }, + { "PKIX.OCSP", OID({1,3,6,1,5,5,7,48,1}) }, + { "PKIX.OCSP.BasicResponse", OID({1,3,6,1,5,5,7,48,1,1}) }, + { "PKIX.OCSPSigning", OID({1,3,6,1,5,5,7,3,9}) }, + { "PKIX.ServerAuth", OID({1,3,6,1,5,5,7,3,1}) }, + { "PKIX.TimeStamping", OID({1,3,6,1,5,5,7,3,8}) }, + { "PKIX.XMPPAddr", OID({1,3,6,1,5,5,7,8,5}) }, + { "RC2/CBC", OID({1,2,840,113549,3,2}) }, + { "RIPEMD-160", OID({1,3,36,3,2,1}) }, + { "RSA", OID({1,2,840,113549,1,1,1}) }, + { "RSA/EMSA3(MD5)", OID({1,2,840,113549,1,1,4}) }, + { "RSA/EMSA3(RIPEMD-160)", OID({1,3,36,3,3,1,2}) }, + { "RSA/EMSA3(SHA-160)", OID({1,2,840,113549,1,1,5}) }, + { "RSA/EMSA3(SHA-224)", OID({1,2,840,113549,1,1,14}) }, + { "RSA/EMSA3(SHA-256)", OID({1,2,840,113549,1,1,11}) }, + { "RSA/EMSA3(SHA-3(224))", OID({2,16,840,1,101,3,4,3,13}) }, + { "RSA/EMSA3(SHA-3(256))", OID({2,16,840,1,101,3,4,3,14}) }, + { "RSA/EMSA3(SHA-3(384))", OID({2,16,840,1,101,3,4,3,15}) }, + { "RSA/EMSA3(SHA-3(512))", OID({2,16,840,1,101,3,4,3,16}) }, + { "RSA/EMSA3(SHA-384)", OID({1,2,840,113549,1,1,12}) }, + { "RSA/EMSA3(SHA-512)", OID({1,2,840,113549,1,1,13}) }, + { "RSA/EMSA3(SHA-512-256)", OID({1,2,840,113549,1,1,16}) }, + { "RSA/EMSA3(SM3)", OID({1,2,156,10197,1,504}) }, + { "RSA/EMSA4", OID({1,2,840,113549,1,1,10}) }, + { "RSA/OAEP", OID({1,2,840,113549,1,1,7}) }, + { "SEED/CBC", OID({1,2,410,200004,1,4}) }, + { "SHA-160", OID({1,3,14,3,2,26}) }, + { "SHA-224", OID({2,16,840,1,101,3,4,2,4}) }, + { "SHA-256", OID({2,16,840,1,101,3,4,2,1}) }, + { "SHA-3(224)", OID({2,16,840,1,101,3,4,2,7}) }, + { "SHA-3(256)", OID({2,16,840,1,101,3,4,2,8}) }, + { "SHA-3(384)", OID({2,16,840,1,101,3,4,2,9}) }, + { "SHA-3(512)", OID({2,16,840,1,101,3,4,2,10}) }, + { "SHA-384", OID({2,16,840,1,101,3,4,2,2}) }, + { "SHA-512", OID({2,16,840,1,101,3,4,2,3}) }, + { "SHA-512-256", OID({2,16,840,1,101,3,4,2,6}) }, + { "SHAKE-128", OID({2,16,840,1,101,3,4,2,11}) }, + { "SHAKE-256", OID({2,16,840,1,101,3,4,2,12}) }, + { "SM2_Enc", OID({1,2,156,10197,1,301,3}) }, + { "SM2_Kex", OID({1,2,156,10197,1,301,2}) }, + { "SM2_Sig", OID({1,2,156,10197,1,301,1}) }, + { "SM3", OID({1,2,156,10197,1,401}) }, + { "Serpent/CBC", OID({1,3,6,1,4,1,25258,3,1}) }, + { "Serpent/GCM", OID({1,3,6,1,4,1,25258,3,101}) }, + { "Serpent/OCB", OID({1,3,6,1,4,1,25258,3,2,4}) }, + { "Streebog-256", OID({1,2,643,7,1,1,2,2}) }, + { "Streebog-512", OID({1,2,643,7,1,1,2,3}) }, + { "Threefish-512/CBC", OID({1,3,6,1,4,1,25258,3,2}) }, + { "Tiger(24,3)", OID({1,3,6,1,4,1,11591,12,2}) }, + { "TripleDES/CBC", OID({1,2,840,113549,3,7}) }, + { "Twofish/CBC", OID({1,3,6,1,4,1,25258,3,3}) }, + { "Twofish/GCM", OID({1,3,6,1,4,1,25258,3,102}) }, + { "Twofish/OCB", OID({1,3,6,1,4,1,25258,3,2,5}) }, + { "X509v3.AnyPolicy", OID({2,5,29,32,0}) }, + { "X509v3.AuthorityKeyIdentifier", OID({2,5,29,35}) }, + { "X509v3.BasicConstraints", OID({2,5,29,19}) }, + { "X509v3.CRLDistributionPoints", OID({2,5,29,31}) }, + { "X509v3.CRLIssuingDistributionPoint", OID({2,5,29,28}) }, + { "X509v3.CRLNumber", OID({2,5,29,20}) }, + { "X509v3.CertificatePolicies", OID({2,5,29,32}) }, + { "X509v3.ExtendedKeyUsage", OID({2,5,29,37}) }, + { "X509v3.HoldInstructionCode", OID({2,5,29,23}) }, + { "X509v3.InvalidityDate", OID({2,5,29,24}) }, + { "X509v3.IssuerAlternativeName", OID({2,5,29,18}) }, + { "X509v3.KeyUsage", OID({2,5,29,15}) }, + { "X509v3.NameConstraints", OID({2,5,29,30}) }, + { "X509v3.PolicyConstraints", OID({2,5,29,36}) }, + { "X509v3.ReasonCode", OID({2,5,29,21}) }, + { "X509v3.SubjectAlternativeName", OID({2,5,29,17}) }, + { "X509v3.SubjectKeyIdentifier", OID({2,5,29,14}) }, + { "X520.CommonName", OID({2,5,4,3}) }, + { "X520.Country", OID({2,5,4,6}) }, + { "X520.DNQualifier", OID({2,5,4,46}) }, + { "X520.GenerationalQualifier", OID({2,5,4,44}) }, + { "X520.GivenName", OID({2,5,4,42}) }, + { "X520.Initials", OID({2,5,4,43}) }, + { "X520.Locality", OID({2,5,4,7}) }, + { "X520.Organization", OID({2,5,4,10}) }, + { "X520.OrganizationalUnit", OID({2,5,4,11}) }, + { "X520.Pseudonym", OID({2,5,4,65}) }, + { "X520.SerialNumber", OID({2,5,4,5}) }, + { "X520.State", OID({2,5,4,8}) }, + { "X520.Surname", OID({2,5,4,4}) }, + { "X520.Title", OID({2,5,4,12}) }, + { "XMSS", OID({1,3,6,1,4,1,25258,1,5}) }, + { "brainpool160r1", OID({1,3,36,3,3,2,8,1,1,1}) }, + { "brainpool192r1", OID({1,3,36,3,3,2,8,1,1,3}) }, + { "brainpool224r1", OID({1,3,36,3,3,2,8,1,1,5}) }, + { "brainpool256r1", OID({1,3,36,3,3,2,8,1,1,7}) }, + { "brainpool320r1", OID({1,3,36,3,3,2,8,1,1,9}) }, + { "brainpool384r1", OID({1,3,36,3,3,2,8,1,1,11}) }, + { "brainpool512r1", OID({1,3,36,3,3,2,8,1,1,13}) }, + { "frp256v1", OID({1,2,250,1,223,101,256,1}) }, + { "gost_256A", OID({1,2,643,2,2,35,1}) }, + { "secp160k1", OID({1,3,132,0,9}) }, + { "secp160r1", OID({1,3,132,0,8}) }, + { "secp160r2", OID({1,3,132,0,30}) }, + { "secp192k1", OID({1,3,132,0,31}) }, + { "secp192r1", OID({1,2,840,10045,3,1,1}) }, + { "secp224k1", OID({1,3,132,0,32}) }, + { "secp224r1", OID({1,3,132,0,33}) }, + { "secp256k1", OID({1,3,132,0,10}) }, + { "secp256r1", OID({1,2,840,10045,3,1,7}) }, + { "secp384r1", OID({1,3,132,0,34}) }, + { "secp521r1", OID({1,3,132,0,35}) }, + { "sm2p256v1", OID({1,2,156,10197,1,301}) }, + { "x962_p192v2", OID({1,2,840,10045,3,1,2}) }, + { "x962_p192v3", OID({1,2,840,10045,3,1,3}) }, + { "x962_p239v1", OID({1,2,840,10045,3,1,4}) }, + { "x962_p239v2", OID({1,2,840,10045,3,1,5}) }, + { "x962_p239v3", OID({1,2,840,10045,3,1,6}) } }; } diff --git a/src/lib/asn1/oids.cpp b/src/lib/asn1/oids.cpp index 47d1c1c4b..b9ba1f858 100644 --- a/src/lib/asn1/oids.cpp +++ b/src/lib/asn1/oids.cpp @@ -42,28 +42,34 @@ class OID_Map std::string lookup(const OID& oid) { + const std::string oid_str = oid.as_string(); + +#if defined(BOTAN_HOUSE_ECC_CURVE_NAME) + if(oid_str == BOTAN_HOUSE_ECC_CURVE_OID) + return BOTAN_HOUSE_ECC_CURVE_NAME; +#endif + lock_guard_type<mutex_type> lock(m_mutex); - auto i = m_oid2str.find(oid.as_string()); + auto i = m_oid2str.find(oid_str); if(i != m_oid2str.end()) return i->second; -#if defined(BOTAN_HOUSE_ECC_CURVE_NAME) - if(oid_str == BOTAN_HOUSE_ECC_CURVE_OID) return BOTAN_HOUSE_ECC_CURVE_NAME; -#endif return ""; } OID lookup(const std::string& str) { +#if defined(BOTAN_HOUSE_ECC_CURVE_NAME) + if(str == BOTAN_HOUSE_ECC_CURVE_NAME) + return OID(BOTAN_HOUSE_ECC_CURVE_OID); +#endif + lock_guard_type<mutex_type> lock(m_mutex); auto i = m_str2oid.find(str); if(i != m_str2oid.end()) return i->second; -#if defined(BOTAN_HOUSE_ECC_CURVE_NAME) - if(name == BOTAN_HOUSE_ECC_CURVE_NAME) return OID(BOTAN_HOUSE_ECC_CURVE_OID); -#endif return OID(); } @@ -136,4 +142,4 @@ bool name_of(const OID& oid, const std::string& name) } -}
\ No newline at end of file +} diff --git a/src/scripts/oids.py b/src/scripts/oids.py index 882104d7b..61a31a6f6 100755 --- a/src/scripts/oids.py +++ b/src/scripts/oids.py @@ -12,6 +12,9 @@ import datetime import re from collections import defaultdict +def format_oid(oid): + #return '"' + oid + '"' + return "{" + oid.replace('.', ',') + '}' def format_map(m, for_oid = False): s = '' @@ -22,7 +25,7 @@ def format_map(m, for_oid = False): s += ' ' if for_oid: - s += '{ "%s", OID("%s") },\n' % (k,v) + s += '{ "%s", OID(%s) },\n' % (k,format_oid(v)) else: s += '{ "%s", "%s" },\n' % (k,v) @@ -73,7 +76,7 @@ def format_if(m, nm,t=False): v = m[k] if t: - s += ' if(%s == "%s") return OID("%s");\n' % (nm,k, v) + s += ' if(%s == "%s") return OID(%s);\n' % (nm,k, format_oid(v)) else: s += ' if(%s == "%s") return "%s";\n' % (nm,k, v) |