Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Issue 8568040: Refuse to accept certificate chains containing any RSA public key smaller (Closed)

Created:
9 years, 1 month ago by palmer
Modified:
9 years ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Chris Evans
Visibility:
Public.

Description

Reject certificate chains containing small RSA and DSA keys. "Small" means less than 1024 bits. BUG=102949 TEST=net_unittests, X509CertificateTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114709

Patch Set 1 #

Total comments: 7

Patch Set 2 : '' #

Total comments: 7

Patch Set 3 : '' #

Total comments: 4

Patch Set 4 : '' #

Total comments: 5

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 11

Patch Set 7 : '' #

Total comments: 12

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 12

Patch Set 11 : '' #

Total comments: 9

Patch Set 12 : '' #

Patch Set 13 : '' #

Total comments: 2

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Patch Set 19 : '' #

Patch Set 20 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1815 lines, -5 lines) Patch
M net/base/cert_status_flags.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M net/base/cert_status_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +4 lines, -0 lines 0 comments Download
M net/base/net_error_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -1 line 0 comments Download
M net/base/x509_certificate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +16 lines, -0 lines 0 comments Download
M net/base/x509_certificate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +39 lines, -0 lines 0 comments Download
M net/base/x509_certificate_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +46 lines, -1 line 0 comments Download
M net/base/x509_certificate_nss.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +34 lines, -0 lines 1 comment Download
M net/base/x509_certificate_openssl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +31 lines, -0 lines 0 comments Download
M net/base/x509_certificate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +93 lines, -3 lines 0 comments Download
M net/base/x509_certificate_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +36 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/1024-rsa-ee-by-1024-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +50 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/1024-rsa-ee-by-2048-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +59 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/1024-rsa-ee-by-768-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +47 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/1024-rsa-ee-by-prime256v1-ecdsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/1024-rsa-ee-by-secp256k1-ecdsa-intermediate.pem View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/1024-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +63 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-ee-by-1024-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +61 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-ee-by-2048-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +71 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-ee-by-768-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +59 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-ee-by-prime256v1-ecdsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +56 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-ee-by-secp256k1-ecdsa-intermediate.pem View 1 2 3 4 5 6 1 chunk +56 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +75 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/2048-rsa-root.pem View 1 2 3 4 5 6 7 1 chunk +17 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/768-rsa-ee-by-1024-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +47 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/768-rsa-ee-by-2048-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +56 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/768-rsa-ee-by-768-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/768-rsa-ee-by-prime256v1-ecdsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +42 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/768-rsa-ee-by-secp256k1-ecdsa-intermediate.pem View 1 2 3 4 5 6 1 chunk +42 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/768-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +60 lines, -0 lines 0 comments Download
M net/data/ssl/certificates/README View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +9 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/prime256v1-ecdsa-ee-by-1024-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/prime256v1-ecdsa-ee-by-2048-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +54 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/prime256v1-ecdsa-ee-by-768-rsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +41 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/prime256v1-ecdsa-ee-by-prime256v1-ecdsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +39 lines, -0 lines 0 comments Download
A net/data/ssl/certificates/prime256v1-ecdsa-intermediate.pem View 1 2 3 4 5 6 7 1 chunk +58 lines, -0 lines 0 comments Download
A net/data/ssl/scripts/ca.cnf View 1 2 3 4 5 6 1 chunk +86 lines, -0 lines 0 comments Download
A net/data/ssl/scripts/ee.cnf View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +18 lines, -0 lines 0 comments Download
A net/data/ssl/scripts/generate-weak-test-chains.sh View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +168 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
palmer
This is NOT intended to be commitable code yet — for now, I am just ...
9 years, 1 month ago (2011-11-16 03:30:45 UTC) #1
Ryan Sleevi
Looking good so far. The nit brigade, as you develop. I'm also wondering whether the ...
9 years, 1 month ago (2011-11-16 03:46:11 UTC) #2
Ryan Sleevi
http://codereview.chromium.org/8568040/diff/1/net/base/x509_certificate_mac.cc File net/base/x509_certificate_mac.cc (right): http://codereview.chromium.org/8568040/diff/1/net/base/x509_certificate_mac.cc#newcode1461 net/base/x509_certificate_mac.cc:1461: status = CSSM_QueryKeySizeInBits(crypto::GetSharedCSPHandle(), NULL, cssm_key, On 2011/11/16 03:46:11, Ryan ...
9 years, 1 month ago (2011-11-16 03:47:03 UTC) #3
agl
http://codereview.chromium.org/8568040/diff/8/net/base/x509_certificate.h File net/base/x509_certificate.h (right): http://codereview.chromium.org/8568040/diff/8/net/base/x509_certificate.h#newcode82 net/base/x509_certificate.h:82: DH, OTHER? (For example, ECDH. I wouldn't want code ...
9 years, 1 month ago (2011-11-16 15:57:55 UTC) #4
palmer
> I'm also wondering whether the API should be NOTREACHED()ing? Only _mac.cc does, and other ...
9 years, 1 month ago (2011-11-16 23:02:41 UTC) #5
palmer
> net/base/x509_certificate.h:82: DH, > OTHER? Yep, it's now kPublicKeyTypeUnknown instead of NONE, and added kPublicKeyTypeECDH ...
9 years, 1 month ago (2011-11-16 23:06:35 UTC) #6
Ryan Sleevi
I feel like the unit tests may be missing a bit of coverage, which may ...
9 years, 1 month ago (2011-11-16 23:40:53 UTC) #7
Ryan Sleevi
> > SecKeyRef key; > > OSStatus status = SecCertificateCopyPublicKey(cert_handle, &key); > > if (status ...
9 years, 1 month ago (2011-11-16 23:44:57 UTC) #8
palmer
> If you want, I can pass along the scripts I used to generate the ...
9 years, 1 month ago (2011-11-17 01:18:03 UTC) #9
Ryan Sleevi
On 2011/11/17 01:18:03, Chris P. wrote: > > If you want, I can pass along ...
9 years, 1 month ago (2011-11-17 01:50:10 UTC) #10
wtc
Patch Set 6 LGTM. palmer: I am giving you an owner's LGTM in advance because ...
9 years, 1 month ago (2011-11-17 02:52:18 UTC) #11
Ryan Sleevi
http://codereview.chromium.org/8568040/diff/13006/net/base/x509_certificate_mac.cc File net/base/x509_certificate_mac.cc (right): http://codereview.chromium.org/8568040/diff/13006/net/base/x509_certificate_mac.cc#newcode1450 net/base/x509_certificate_mac.cc:1450: ScopedCFTypeRef<SecKeyRef> scoped_key; ScopedCFTypeRef<SecKeyRef> scoped_key(key); http://codereview.chromium.org/8568040/diff/13006/net/base/x509_certificate_openssl.cc File net/base/x509_certificate_openssl.cc (right): http://codereview.chromium.org/8568040/diff/13006/net/base/x509_certificate_openssl.cc#newcode628 ...
9 years, 1 month ago (2011-11-17 03:20:33 UTC) #12
Ryan Sleevi
http://codereview.chromium.org/8568040/diff/16001/net/base/x509_certificate.cc File net/base/x509_certificate.cc (right): http://codereview.chromium.org/8568040/diff/16001/net/base/x509_certificate.cc#newcode579 net/base/x509_certificate.cc:579: static bool IsWeakKey(X509Certificate::PublicKeyType type, size_t size_bits) { nit: Given ...
9 years ago (2011-12-13 05:45:34 UTC) #13
palmer
http://codereview.chromium.org/8568040/diff/13006/net/base/x509_certificate_openssl.cc File net/base/x509_certificate_openssl.cc (right): http://codereview.chromium.org/8568040/diff/13006/net/base/x509_certificate_openssl.cc#newcode628 net/base/x509_certificate_openssl.cc:628: *size_bits = EVP_PKEY_size(key) * 8; On 2011/11/17 03:20:33, Ryan ...
9 years ago (2011-12-13 18:55:44 UTC) #14
palmer
> net/base/x509_certificate.cc:579: static bool > IsWeakKey(X509Certificate::PublicKeyType type, size_t size_bits) { > nit: Given that this ...
9 years ago (2011-12-13 19:45:38 UTC) #15
wtc
Patch Set 10 LGTM. I have some suggested changes below. Please also make sure rsleevi ...
9 years ago (2011-12-13 21:56:17 UTC) #16
palmer
> You should update the CL's commit message to mention DSA. Done. > http://codereview.chromium.org/8568040/diff/26005/net/base/cert_status_flags.cc#newcode55 > ...
9 years ago (2011-12-13 23:23:20 UTC) #17
Ryan Sleevi
LGTM. A few notes below. If the trybots are happy, commit! http://codereview.chromium.org/8568040/diff/26008/net/base/cert_status_flags.cc File net/base/cert_status_flags.cc (right): ...
9 years ago (2011-12-13 23:54:16 UTC) #18
wtc
Patch Set 11 LGTM. Just some nits, and one important comment that you may handle ...
9 years ago (2011-12-14 00:18:03 UTC) #19
palmer
> Just a reminder that you will want to update the localized error pages in ...
9 years ago (2011-12-14 01:04:23 UTC) #20
palmer
> http://codereview.chromium.org/8568040/diff/26008/net/base/x509_certificate.cc#newcode233 > net/base/x509_certificate.cc:233: return false; > > Nit: I think it's important to document ...
9 years ago (2011-12-14 02:22:44 UTC) #21
Ryan Sleevi
http://codereview.chromium.org/8568040/diff/37013/net/base/x509_certificate_unittest.cc File net/base/x509_certificate_unittest.cc (right): http://codereview.chromium.org/8568040/diff/37013/net/base/x509_certificate_unittest.cc#newcode642 net/base/x509_certificate_unittest.cc:642: key_types.push_back("prime256v1-ecdsa"); Quick follow-up: This ("prime256v1-ecdsa") will probably fail the ...
9 years ago (2011-12-14 03:11:01 UTC) #22
wtc
Patch Set 16 LGTM. http://codereview.chromium.org/8568040/diff/37013/net/base/x509_certificate_unittest.cc File net/base/x509_certificate_unittest.cc (right): http://codereview.chromium.org/8568040/diff/37013/net/base/x509_certificate_unittest.cc#newcode642 net/base/x509_certificate_unittest.cc:642: key_types.push_back("prime256v1-ecdsa"); On 2011/12/14 03:11:01, Ryan ...
9 years ago (2011-12-15 02:10:36 UTC) #23
Ryan Sleevi
On 2011/12/15 02:10:36, wtc wrote: > Patch Set 16 LGTM. > > http://codereview.chromium.org/8568040/diff/37013/net/base/x509_certificate_unittest.cc > File ...
9 years ago (2011-12-15 02:20:18 UTC) #24
palmer
> Palmer: See base::mac::IsSnowLeopardOrLater(), similar to the > base::win::GetVersion() check suggested Just added that while ...
9 years ago (2011-12-15 02:25:42 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/palmer@chromium.org/8568040/59001
9 years ago (2011-12-15 21:22:49 UTC) #26
commit-bot: I haz the power
Presubmit check for 8568040-59001 failed and returned exit status 1. Running presubmit commit checks ...
9 years ago (2011-12-15 21:23:41 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/palmer@chromium.org/8568040/61005
9 years ago (2011-12-15 21:28:03 UTC) #28
commit-bot: I haz the power
Change committed as 114709
9 years ago (2011-12-15 22:40:02 UTC) #29
Timur Iskhodzhanov
9 years ago (2011-12-16 08:35:39 UTC) #30
This has introduced a leak,
http://code.google.com/p/chromium/issues/detail?id=107841

http://codereview.chromium.org/8568040/diff/61005/net/base/x509_certificate_n...
File net/base/x509_certificate_nss.cc (right):

http://codereview.chromium.org/8568040/diff/61005/net/base/x509_certificate_n...
net/base/x509_certificate_nss.cc:1176: }
forgotten to SECKEY_DestroyPublicKey(key) ?

Powered by Google App Engine
This is Rietveld 408576698