-
Notifications
You must be signed in to change notification settings - Fork 5.4k
tls: Add support for matching against OtherName SAN type #34471
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1c9c914
tls: Add support for matching against OtherName SAN type
arulthileeban d1f167f
tls: OtherName refactoring
arulthileeban 7d9fa67
Merge branch 'envoyproxy:main' into other_name_san
arulthileeban c95587b
tls: Add tests and certs for OtherName SAN Validation
arulthileeban 3aa7618
tls: Add docs for OtherName SAN matching
arulthileeban 27107f3
tls: Add UPN to spelling dictionary
arulthileeban fa8c908
jwt_authn: Remove PANIC for invalid oid
arulthileeban 8be3f1b
tls: Modify tests for othername SAN
arulthileeban 5004b55
tls: add logic to handle different othername type inputs from certs
arulthileeban 543aa7e
tls: Add Othername SAN value match docs and value failure test
arulthileeban 20a5d9f
Merge branch 'main' into other_name_san
arulthileeban 0318aa4
tls: add othername tests for various types
arulthileeban dfb8a23
tls: add test/doc for null othername type
arulthileeban 80e6037
tls: Modify handling of OtherName SAN value extraction
arulthileeban bef4d58
tls: fix switch - fall through on condition failure
arulthileeban 2d9bfb7
tls: split string case handling + tests
arulthileeban d800848
tls: change variable str to tmp_str for diff string types
arulthileeban 70a5cb9
minor fix
arulthileeban ded0296
tls: add comments for tests
arulthileeban 90a980e
Merge branch 'main' into other_name_san
arulthileeban d3c7937
add spelling fix
arulthileeban b1de297
add bmpstring change
arulthileeban 06d4848
add bmpstring test+code
arulthileeban c773c79
bmpstring spelling fix
arulthileeban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| [req] | ||
| distinguished_name = req_distinguished_name | ||
| req_extensions = v3_req | ||
|
|
||
| [req_distinguished_name] | ||
| countryName = US | ||
| countryName_default = US | ||
| stateOrProvinceName = California | ||
| stateOrProvinceName_default = California | ||
| localityName = San Francisco | ||
| localityName_default = San Francisco | ||
| organizationName = Lyft | ||
| organizationName_default = Lyft | ||
| organizationalUnitName = Lyft Engineering | ||
| organizationalUnitName_default = Lyft Engineering | ||
| commonName = Test Server | ||
| commonName_default = Test Server | ||
| commonName_max = 64 | ||
|
|
||
| [v3_req] | ||
| basicConstraints = CA:FALSE | ||
| keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| extendedKeyUsage = clientAuth, serverAuth | ||
| subjectAltName = @alt_names | ||
| subjectKeyIdentifier = hash | ||
|
|
||
| [v3_ca] | ||
| basicConstraints = critical, CA:FALSE | ||
| keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| extendedKeyUsage = clientAuth, serverAuth | ||
| subjectAltName = @alt_names | ||
| subjectKeyIdentifier = hash | ||
| authorityKeyIdentifier = keyid:always | ||
|
|
||
| [alt_names] | ||
| DNS.1 = server1.example.com | ||
| otherName.1 = 1.3.6.1.4.1.311.20.2.3;UTF8:server1.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIEQTCCAymgAwIBAgIUOdN440ZeucQGIFJ7uRJczkvWIIowDQYJKoZIhvcNAQEL | ||
| BQAwdjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcM | ||
| DVNhbiBGcmFuY2lzY28xDTALBgNVBAoMBEx5ZnQxGTAXBgNVBAsMEEx5ZnQgRW5n | ||
| aW5lZXJpbmcxEDAOBgNVBAMMB1Rlc3QgQ0EwHhcNMjQwNjAxMjIyMTMxWhcNMjYw | ||
| NjAxMjIyMTMxWjB6MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEW | ||
| MBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwETHlmdDEZMBcGA1UECwwQ | ||
| THlmdCBFbmdpbmVlcmluZzEUM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csjTpjOJgSSZ | ||
| dP2MpZEfAXL/taDEf2siOUxmjFO9gIoGTjlM4SoNvA5IVyHefw== | ||
| -----END CERTIFICATE----- |
13 changes: 13 additions & 0 deletions
13
test/common/tls/test_data/san_dns_and_othername_cert_info.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #pragma once | ||
|
|
||
| // NOLINT(namespace-envoy) | ||
| constexpr char TEST_SAN_DNS_AND_OTHERNAME_CERT_256_HASH[] = | ||
| "10b81b089fa82a542ef4637cd058e8a8ce9aac13703bc7c0f3b18eecd0bafa01"; | ||
| constexpr char TEST_SAN_DNS_AND_OTHERNAME_CERT_1_HASH[] = | ||
| "b2cdaab75e39c57abb9134271432a15a7078a83c"; | ||
| constexpr char TEST_SAN_DNS_AND_OTHERNAME_CERT_SPKI[] = | ||
| "orMj1YQ0Kw6uh/WkfJ/IITdlgbQTF+Lb1Jj+b6R+J+w="; | ||
| constexpr char TEST_SAN_DNS_AND_OTHERNAME_CERT_SERIAL[] = | ||
| "39d378e3465eb9c40620527bb9125cce4bd6208a"; | ||
| constexpr char TEST_SAN_DNS_AND_OTHERNAME_CERT_NOT_BEFORE[] = "Jun 1 22:21:31 2024 GMT"; | ||
| constexpr char TEST_SAN_DNS_AND_OTHERNAME_CERT_NOT_AFTER[] = "Jun 1 22:21:31 2026 GMT"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC4ciZSrbe8JTZi | ||
| vyiEUdTjPHpWZp3dNuqf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551btdTazoYe7EIyD | ||
| JZghnlx5VwKBgDrmAF71cUFOxqmmsNh0HVfzl38JSf5nYnuQCd8HGTWu262mkw6e | ||
| sdrxbwgUQCL+eUpUoncHn68NMk/9Xf1sOj8GOpMSD5HXTQHsIipm6zsV3OG82S7J | ||
| Hb6Yual2m7BinrE5lug3zeXn/DzWFVjHBisC6EHNGa8ojOz6veYGpWU7AoGAL2fF | ||
| rTXWlMLjrvNYo2u5J9cgTGSf5a/ob+4dQ/E8Lp1yIrdR7/5EKceppaITqWniH7jP | ||
| NebDerRYuM2bJ3BstdT4OrzT/CQRFf3E5qDmPBZ2Uuqb/FNVmQA8zjc02HTvzldZ | ||
| eXsbHj4wgQFD405VEVJnf7JcHXvDcvlcroRvKAECgYEA3aPHpiHEoXAPyUSAvZuh | ||
| OwM6+GIxWJpqZ+EFqIfTO7BPWnZT0skjxJlMAgTO+LJaczcU49ooXWeFcNFBr9sJ | ||
| iyd70CBXrmQQjMzRwafbAHach/o4LREphtr73Q6xvE2OCvFqCHQkB1mRRl9Ikoe5 | ||
| lO/82VvYXXW/iiNsFxvOQ+w= | ||
| -----END PRIVATE KEY----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| [req] | ||
| distinguished_name = req_distinguished_name | ||
| req_extensions = v3_req | ||
|
|
||
| [req_distinguished_name] | ||
| countryName = US | ||
| countryName_default = US | ||
| stateOrProvinceName = California | ||
| stateOrProvinceName_default = California | ||
| localityName = San Francisco | ||
| localityName_default = San Francisco | ||
| organizationName = Lyft | ||
| organizationName_default = Lyft | ||
| organizationalUnitName = Lyft Engineering | ||
| organizationalUnitName_default = Lyft Engineering | ||
| commonName = Test Server | ||
| commonName_default = Test Server | ||
| commonName_max = 64 | ||
|
|
||
| [v3_req] | ||
| basicConstraints = CA:FALSE | ||
| keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| extendedKeyUsage = clientAuth, serverAuth | ||
| subjectAltName = @alt_names | ||
| subjectKeyIdentifier = hash | ||
|
|
||
| [v3_ca] | ||
| basicConstraints = critical, CA:FALSE | ||
| keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| extendedKeyUsage = clientAuth, serverAuth | ||
| subjectAltName = @alt_names | ||
| subjectKeyIdentifier = hash | ||
| authorityKeyIdentifier = keyid:always | ||
|
|
||
| [alt_names] | ||
| otherName.1 = 1.3.6.1.4.1.311.20.2.3;UTF8:server1.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIELDCCAxSgAwIBAgIUOdN440ZeucQGIFJ7uRJczkvWIIkwDQYJKoZIhvcNAQEL | ||
| BQAwdjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcM | ||
| DVNhbiBGcmFuY2lzY28xDTALBgNVBAoMBEx5ZnQxGTAXBgNVBAsMEEx5ZnQgRW5n | ||
| aW5lZXJpbmcxEDAOBgNVBAMMB1Rlc3QgQ0EwHhcNMjQwNjAxMjIyMTMxWhcNMjYw | ||
| NjAxMjIyMTMxWjB6MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEW | ||
| MBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwETHlmdDEZMBcGA1UECwwQ | ||
| THlmdCBFbmdpbmVlcmluZzEUMBIGA1UEAwwLVGVzdCBTZXJ2ZXIwggEiMA0GCSqG | ||
| SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDKnvJaESqyoF10NLh5GlMhF3Zom7D1AxiK | ||
| RIrdkHW0w8NloVSgTZvNrBQi7Iz1xfMw9Ep63qmlJGaNZcl0jf8bU8MtVP6prJNf | ||
| tBMzl+nj6sK7xYHXl7CpDwX+rg5pYovgNGdaJAFmpbteuHhqZ8Yeh5tSSLWNdjmA | ||
| c5mdl219kh5stVjMyetgjr2qaZsx99ze0syERmmE83OpSMVGtswsBv8ElPVnlEVI | ||
| qLPBpHawFjbBrCiCoxYyLGnJ3ZAnaVrZ1J4VX2PfqEj90KtSRUwuIyUe0QgTh1dX | ||
| ui56DHQWjy5lIDJl8DzeS53FZcegmYqGSyAj52+g4JAdPeQp1pyxAgMBAAGjga0w | ||
| gaowDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUH | ||
| AwIGCCsGAQUFBwMBMC4GA1UdEQQnMCWgIwYKKwYBBAGCNxQCA6AVDBNzZXJ2ZXIx | ||
| LmV4YW1wbGUuY29tMB0GA1UdDgQWBBTD9LZP+nM7iX7wehpdAfg1ItRpnDAfBgNV | ||
| HSMEGDAWgBTQumAzod6zDNdAA8q1kU0sEGXwmzANBgkqhkiG9w0BAQsFAAOCAQEA | ||
| P4eYX5yZYGyOUEWVlozTazrytA/gjsVn3UXmFD/BBVCYMxzBF5VSmYFnfxHuqCjM | ||
| hkYT6aeToaEaCb0CUoQjZNun8/mTsq/m3FoZ9wTf4kdJuNk/ynlzHz5iYyGxvS0D | ||
| H5KyVRi5HHJDvi+caDov802MNi86IlT7qyQjqQ0tstgVFVnJdaaPyjlLjm6feYK5 | ||
| qs3/or6EoMowh3sWLE49RRjfN79m+1Ku+ttfyTFVR83uYGoMGHN30yFbajwo4OGV | ||
| Rmg8DCh/dZA8YZART7QM5T4gbu2SFCVvbH2+rBmJp04udHdaxLjdv4+uCejWAzID | ||
| UVEqd3E0cM8o9yEZxxVuKA== | ||
| -----END CERTIFICATE----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| // NOLINT(namespace-envoy) | ||
| constexpr char TEST_SAN_OTHERNAME_CERT_256_HASH[] = | ||
| "b7d8db1c1e02cc191acc30b6a1749b83c9e14e7a0059a67ca6b5344569731e22"; | ||
| constexpr char TEST_SAN_OTHERNAME_CERT_1_HASH[] = "b0f044fd07a9554b0ecca7376e5233199ab8d781"; | ||
| constexpr char TEST_SAN_OTHERNAME_CERT_SPKI[] = "PoqTwnrbRJFeMFOcDRfMJoeYUSuZLXAlYPQl6m4R/JE="; | ||
| constexpr char TEST_SAN_OTHERNAME_CERT_SERIAL[] = "39d378e3465eb9c40620527bb9125cce4bd62089"; | ||
| constexpr char TEST_SAN_OTHERNAME_CERT_NOT_BEFORE[] = "Jun 1 22:21:31 2024 GMT"; | ||
| constexpr char TEST_SAN_OTHERNAME_CERT_NOT_AFTER[] = "Jun 1 22:21:31 2026 GMT"; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.