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

Unified Diff: net/cert/cert_verify_proc_ios.cc

Issue 2225483002: [ios] Removed CertVerifierBlockAdapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated includes Created 4 years, 4 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 05276b308cfd9feabddaa29258f7423903750561..4d9223b524fb9e52652bc38abcd156099fe6c584 100644
--- a/net/cert/cert_verify_proc_ios.cc
+++ b/net/cert/cert_verify_proc_ios.cc
@@ -5,7 +5,6 @@
#include "net/cert/cert_verify_proc_ios.h"
#include <CommonCrypto/CommonDigest.h>
-#include <Security/Security.h>
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
@@ -172,6 +171,12 @@ void GetCertChainInfo(CFArrayRef cert_chain, CertVerifyResult* verify_result) {
X509Certificate::CreateFromHandle(verified_cert, verified_chain);
}
+} // namespace
+
+CertVerifyProcIOS::CertVerifyProcIOS() {}
+
+CertVerifyProcIOS::~CertVerifyProcIOS() {}
Ryan Sleevi 2016/08/12 00:16:23 This (the dtor) should not be moved. Declaration a
Eugene But (OOO till 7-30) 2016/08/12 16:16:40 Moved to the bottom.
+
// The iOS APIs don't expose an API-stable set of reasons for certificate
// validation failures. However, internally, the reason is tracked, and it's
// converted to user-facing localized strings.
@@ -184,9 +189,11 @@ void GetCertChainInfo(CFArrayRef cert_chain, CertVerifyResult* verify_result) {
//
// TODO(rsleevi): https://crbug.com/601915 - Use a less brittle solution when
// possible.
-CertStatus GetFailureFromTrustProperties(CFArrayRef properties) {
+// static
+CertStatus CertVerifyProcIOS::GetCertFailureStatusFromTrust(SecTrustRef trust) {
CertStatus reason = 0;
+ base::ScopedCFTypeRef<CFArrayRef> properties(SecTrustCopyProperties(trust));
if (!properties)
return CERT_STATUS_INVALID;
@@ -228,12 +235,6 @@ CertStatus GetFailureFromTrustProperties(CFArrayRef properties) {
return reason;
}
-} // namespace
-
-CertVerifyProcIOS::CertVerifyProcIOS() {}
-
-CertVerifyProcIOS::~CertVerifyProcIOS() {}
-
bool CertVerifyProcIOS::SupportsAdditionalTrustAnchors() const {
return false;
}
@@ -278,8 +279,7 @@ int CertVerifyProcIOS::VerifyInternal(
verify_result->cert_status |= CERT_STATUS_AUTHORITY_INVALID;
break;
default:
- ScopedCFTypeRef<CFArrayRef> properties(SecTrustCopyProperties(trust_ref));
- verify_result->cert_status |= GetFailureFromTrustProperties(properties);
+ verify_result->cert_status |= GetCertFailureStatusFromTrust(trust_ref);
}
GetCertChainInfo(final_chain, verify_result);

Powered by Google App Engine
This is Rietveld 408576698