[gnutls-devel] GnuTLS | Should a certificate with two SAN instances be rejected? (#872)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Thu Dec 12 16:15:20 CET 2019
julia created an issue: https://gitlab.com/gnutls/gnutls/issues/872
I recently created a faked certificate, which happens to have an “empty”subject and two subject alternative name instances. The certificate is not rejected during path validation.
I can understand that the public key relies on the subject name and the alternative name. The problem is, which subject alternative name needs to be bound to the public key?
The version of Gnutls: 3.6.8.
The command I used is:
certtool --verify --load-ca-certificate='rootCA_key_cert.pem' < 5009.pem
The extension part is:
Basic Constraints (critical):
Certificate Authority (CA): TRUE
Subject Alternative Name (critical):
DNSname: motherless.com
Subject Alternative Name (critical):
DNSname: www.flipkart.com
DNSname: flipkart.com
DNSname: secure.flipkart.com
The verification returns:
Loaded CAs (1 available)
Subject: (null)
Issuer: CN=DDST CA,O=SJTU DDST,ST=SH,C=CN
Checked against: CN=DDST CA,O=SJTU DDST,ST=SH,C=CN
Signature algorithm: RSA-SHA256
Output: Verified. The certificate is trusted.
Chain verification output: Verified. The certificate is trusted.
The rootCA_key_cert.pem (self-signed root CA):
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA1QUBgnureUishKtOaMYYaI+MXommBYHrdWk5RLhwlBTMRWUN
vb2UkN1dYU8SNQ91DsEM2Vs+eHWLkVvluK3ug2upsJdbG8GmFkScSMz4/oY6Mv59
8ib28uWA8F/ipu/DQhEHG2Nrccss9bBLOW7J0+Haj2UfZPZjQ1gxRwBO4Y4ZRKTw
xcxvEkk5AFsLr89B8kcqn385FrJqgFcnzWSfDNqK32xaoCu1gctpzNH4x76HEGGH
1N37v++HHa73EW6UrrDRsx4FkKOjG4iyXi8I7IUzHRyY6GRihJTLwrxBSDkPkS69
FfjYZqlb/dGszQG9MUGGLh2pyDMlSPzCu1knswIDAQABAoIBAEidADq+dWFOiKBg
1MWaYU+jPzIqsdFGzEClscPfK2EPBeLR47E+IpqPGvnEvmwf7MMuw3aER/M//md6
cABYKenalWmA7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VeMCZdcbrHJXDC
7Ft4nf+pJmSbltJA3c6kFJ+dBHhcWyJNZRHFgtYmu3X37GXHwFhD1xut1IAGqlHt
EfcWCowhmRvMpPyePp77rn8RtysPQfa+K3eL/cd191svP6FnVnmRrlpTT02uCk4w
tfT6QuVqoUITXogM6kUkNyAq54cbjWb/SeFNhhApXZ8KhDMUljsMC58tlUiushTq
GxtLrn/iHy+vjj+F49sKhicHZQ1HqHO89UIhT6Wqd1DFJifVkj8r7A3J1gJ8r64j
AiRG5REvmpwpps2jqBhOMebMhl5YAhJNHDkCceEFC1Q7BPD0MFJh0wIDAQABo3Qw
cjAPBgNVHRMBAf8EBTADAQH/MBwGA1UdEQEB/wQSMBCCDm1vdGhlcmxlc3MuY29t
MEEGA1UdEQEB/wQ3MDWCEHd3dy5mbGlwa2FydC5jb22CDGZsaXBrYXJ0LmNvbYIT
c2VjdXJlLmZsaXBrYXJ0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAcBlUfXcKN+qz
HV3uMVkqBYlCoM4Mrp83rFWgGbzggcu1Q9RLRHe+N5N4QQZUTUOaP/ZtbrGBjJfE
GoFJaJ0KBfjyaSotSj9W4tVQGtVt9c3kGWVSi8AQ5peaLQn3jmOQXrvHP2/behkm
40Ino7R5wbpGQ8V+2EhQufaBf9nfgCveBHvfY+QWSCrmKdZEKbQjCcAXMcRWRzCS
H8Y8eKKuna7cgndXudcQY7JQYhzB7Rf2F1k15JeSShhe4CbfpP+rjAVaewnJogS2
R8Y2tYnD/VVXR9p74S/M/MEXRMQb56gQsfw1V709M42/WDqHyU0z59P/nASQMQD/
zTFdEaCLtQ==
-----END CERTIFICATE-----
[rootCA_key_cert.pem](/uploads/ea3d5695fb35f7d2fed38916b8563992/rootCA_key_cert.pem)
[5009.pem](/uploads/3cb189d2c81df6123378d6ea080200ad/5009.pem)
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/872
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20191212/f24d7e41/attachment-0001.html>
More information about the Gnutls-devel
mailing list