mirror of https://github.com/grpc/grpc.git
[Security - Revocation] Refactor how CRLs are checked internally (#36031)
This PR changes how CRLs are handled purely internally. After discussing with davidben@, there are various problems with the `X509_STORE_set_get_crl` API and we shouldn't use it. This change keeps the behavior and external API the same, but instead of bulk pushing CRL information into OpenSSL, we instead iterate through the built chain and check each certificate for revocation, as well as doing the CRL validation ourselves.
Closes #36031
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36031 from gtcooke94:CrlInternalRefactor 5f4c816648
PiperOrigin-RevId: 615139682
pull/36100/head
parent
e34c20cd13
commit
b7f9217633
11 changed files with 349 additions and 103 deletions
@ -0,0 +1,12 @@ |
|||||||
|
-----BEGIN X509 CRL----- |
||||||
|
MIIB0TCBugIBATANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJBVTETMBEGA1UE |
||||||
|
CAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRk |
||||||
|
MQ8wDQYDVQQDDAZ0ZXN0Y2EXDTI0MDMwNjIxMjE0M1oXDTM0MDMwNDIxMjE0M1qg |
||||||
|
MDAuMB8GA1UdIwQYMBaAFNRNe7qb2nAx+OXMM6aMHKZtclpDMAsGA1UdFAQEAgIQ |
||||||
|
ADANBgkqhkiG9w0BAQsFAAOCAQEAfynY04pFrcIOUmlKAqchQXlRfdfRHLKmXmRL |
||||||
|
L16p//b+Aq6jns8WOJ6DmfCBdy8h+kQwyh1HEB1yxYQGn3OJwR0NRK8riBhyhxkx |
||||||
|
akyP1TNMLYPsK/JUBqAvgIfk37oFLKhDO8etYDBndNcNdFs6hryKe40A6eULJXGE |
||||||
|
TXY8dTtT++fRX6VbeAaT02d0F+OHhuBEk/WncuGCe1StFEiLau8ZEalB02vv05Wy |
||||||
|
H8pn+O4P1oEMg0g/jeMWCqnrJQE3Ut7t2LSLBTgHGTk0cOXyYP2LcO0SVeAbjhtq |
||||||
|
qzUSWoxJu98N3y+hqu3FMJA/k0Z0d6PeZ50D3FjbUkT0ZM9f/g== |
||||||
|
-----END X509 CRL----- |
@ -0,0 +1,43 @@ |
|||||||
|
[req] |
||||||
|
distinguished_name = req_distinguished_name |
||||||
|
req_extensions = v3_req |
||||||
|
|
||||||
|
[req_distinguished_name] |
||||||
|
countryName = Country Name (2 letter code) |
||||||
|
countryName_default = AU |
||||||
|
stateOrProvinceName = State or Province Name (full name) |
||||||
|
stateOrProvinceName_default = Some-State |
||||||
|
organizationName = Organization Name (eg, company) |
||||||
|
organizationName_default = Internet Widgits Pty Ltd |
||||||
|
commonName = Common Name (eg, YOUR name) |
||||||
|
commonName_default = testca |
||||||
|
|
||||||
|
[crl_ext] |
||||||
|
authorityKeyIdentifier=keyid:always |
||||||
|
|
||||||
|
[v3_req] |
||||||
|
keyUsage = critical, digitalSignature, keyEncipherment, keyCertSign, cRLSign |
||||||
|
basicConstraints = critical, CA:true |
||||||
|
|
||||||
|
[ca] |
||||||
|
default_ca = CA_evil |
||||||
|
|
||||||
|
[CA_evil] |
||||||
|
dir = . |
||||||
|
certs = $dir/certs |
||||||
|
crl_dir = $dir/crl |
||||||
|
new_certs_dir = $dir/newcerts |
||||||
|
database = $dir/index.txt |
||||||
|
serial = $dir/serial |
||||||
|
RANDFILE = $dir/private/.rand |
||||||
|
private_key = $dir/evil_ca.key |
||||||
|
certificate = $dir/evil_ca.pem |
||||||
|
crl = $dir/evil.crl |
||||||
|
|
||||||
|
# For certificate revocation lists. |
||||||
|
crlnumber = $dir/crlnumber |
||||||
|
crl = $dir/crl/evil.crl |
||||||
|
crl_extensions = crl_ext |
||||||
|
default_crl_days = 3650 |
||||||
|
|
||||||
|
default_md = sha256 |
@ -1,28 +1,28 @@ |
|||||||
-----BEGIN PRIVATE KEY----- |
-----BEGIN PRIVATE KEY----- |
||||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7RwHo8bWaioeI |
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwgg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QFNIHu7zVdXy |
MkV2WseGb7CBlFQjLKYVXJsiNCf5O5ME+cckT2bK1aX0/h8dOtXirwuQ4OVw2c+n |
||||||
4xwQpVw2CN7iufRYN7kOcDo= |
7/MDH+S5WiEX51Cu4zdVMis= |
||||||
-----END PRIVATE KEY----- |
-----END PRIVATE KEY----- |
||||||
|
@ -1,21 +1,21 @@ |
|||||||
-----BEGIN CERTIFICATE----- |
-----BEGIN CERTIFICATE----- |
||||||
MIIDeTCCAmGgAwIBAgIUULA9nt1NB3W1i4RevrKeRQQLkaIwDQYJKoZIhvcNAQEL |
MIIDeTCCAmGgAwIBAgIURqastxiKmyjvJwoaXfh8hA1mccIwDQYJKoZIhvcNAQEL |
||||||
BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM |
BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM |
||||||
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTI0 |
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTI0 |
||||||
MDEyMjIxNDAyMFoXDTM0MDExOTIxNDAyMFowVjELMAkGA1UEBhMCQVUxEzARBgNV |
MDMwNjE5NDcwMVoXDTM0MDMwNDE5NDcwMVowVjELMAkGA1UEBhMCQVUxEzARBgNV |
||||||
BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 |
BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 |
||||||
ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC |
ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC |
||||||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uFruRmqZb2lET/NiVzazq/ |
||||||
g7MyUzn2gQJUiYx74BKmjv6W/sLzNxqR0wZQUr4d/7HX+Lm0xCCYdIUELEM8lZ30 |
s3FNNFKTc8DOQzWYhxF5kMSd0+pL7zK7qAkTi+/Gxc7bJpyFvxQZ6FvVgtz2skv1 |
||||||
maBJ599cQnLXDB1ZFEekj3DMM6jL7OQnBaDs5jW4GcDcuwd5cgXfgIaZVjBVJ11Y |
8MD3FIcfq3VhbHQnmbp8AY1YGM2uvduSReLEWTz7SIx8bZxDxl8g6K5V71XIWM5X |
||||||
CFAhIuh5CM8xhqxWYWY+h0VLU64s8WCNrBEy1OU5KpQRfpd4cvpoWn7E1SfhK1Iq |
CHuk7GybN5gemI+WE1a+1wXcL6FVaWCQHrJVT2ZNS1r5rVXOObf8Ubh5gR2kaVY8 |
||||||
Bp+1k4oDBpGGw4NLXI3i1aU8x1+KoXxNRg5dOED0OLgppvaWB2yIpqBlcZDaNpq4 |
f69OkJ0+XDCOXQw3zmTafnKBtXYdYdT/lMIh8OiseX08W33EiBDczJqFeS/crJZ+ |
||||||
P+WFGBiSUpWU5yYwCDvQAgTWtWkmyflVwslHaGs= |
Tlj+UK1Mtt1NyFu1YV/C7dmGSAZUsdTVM0nY5HA= |
||||||
-----END CERTIFICATE----- |
-----END CERTIFICATE----- |
||||||
|
Loading…
Reference in new issue