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

Unified Diff: net/cert/cert_verify_proc_ios.cc

Issue 2610903003: [refactor] Extract the CertVerifyResult assignment of has_md2, has_md4, (Closed)
Patch Set: moar Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert/cert_verify_proc_ios.cc
diff --git a/net/cert/cert_verify_proc_ios.cc b/net/cert/cert_verify_proc_ios.cc
index 2ab30ed07e48ed0a612365481316cf7cac15e017..eabc453f4f33765647f617a66fd5335519260c04 100644
--- a/net/cert/cert_verify_proc_ios.cc
+++ b/net/cert/cert_verify_proc_ios.cc
@@ -125,7 +125,6 @@ void GetCertChainInfo(CFArrayRef cert_chain, CertVerifyResult* verify_result) {
if (!X509Certificate::GetDEREncoded(chain_cert, &der_bytes))
return;
const uint8_t* bytes = reinterpret_cast<const uint8_t*>(der_bytes.data());
- bssl::UniquePtr<X509> x509_cert(d2i_X509(NULL, &bytes, der_bytes.size()));
base::StringPiece spki_bytes;
if (!asn1::ExtractSPKIFromDERCert(der_bytes, &spki_bytes))
@@ -144,23 +143,7 @@ void GetCertChainInfo(CFArrayRef cert_chain, CertVerifyResult* verify_result) {
i == count - 1) {
continue;
}
-
- int sig_alg = OBJ_obj2nid(x509_cert->sig_alg->algorithm);
- if (sig_alg == NID_md2WithRSAEncryption) {
- verify_result->has_md2 = true;
- } else if (sig_alg == NID_md4WithRSAEncryption) {
- verify_result->has_md4 = true;
- } else if (sig_alg == NID_md5WithRSAEncryption ||
- sig_alg == NID_md5WithRSA) {
- verify_result->has_md5 = true;
- } else if (sig_alg == NID_sha1WithRSAEncryption ||
- sig_alg == NID_dsaWithSHA || sig_alg == NID_dsaWithSHA1 ||
- sig_alg == NID_dsaWithSHA1_2 || sig_alg == NID_sha1WithRSA ||
- sig_alg == NID_ecdsa_with_SHA1) {
- verify_result->has_sha1 = true;
- if (i == 0)
- verify_result->has_sha1_leaf = true;
- }
+ FillCertVerifyResultWeakSignature(chain_cert, i == 0, verify_result);
}
if (!verified_cert) {
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698