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

Unified Diff: net/android/network_library.cc

Issue 12212135: Return specific cert verification errors on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 10 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
« no previous file with comments | « net/android/network_library.h ('k') | net/base/cert_verify_proc_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/network_library.cc
diff --git a/net/android/network_library.cc b/net/android/network_library.cc
index c1c4d5dbb543fccc057c1221b2672d7058402faf..2407100cdc3052457bb0e86d71cdd2444a8a014b 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -23,8 +23,9 @@ using base::android::ToJavaByteArray;
namespace net {
namespace android {
-VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain,
- const std::string& auth_type) {
+CertVerifyResultAndroid VerifyX509CertChain(
+ const std::vector<std::string>& cert_chain,
+ const std::string& auth_type) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobjectArray> chain_byte_array =
@@ -35,12 +36,10 @@ VerifyResult VerifyX509CertChain(const std::vector<std::string>& cert_chain,
ConvertUTF8ToJavaString(env, auth_type);
DCHECK(!auth_string.is_null());
- jboolean trusted = Java_AndroidNetworkLibrary_verifyServerCertificates(
+ jint result = Java_AndroidNetworkLibrary_verifyServerCertificates(
env, chain_byte_array.obj(), auth_string.obj());
- if (ClearException(env))
- return VERIFY_INVOCATION_ERROR;
- return trusted ? VERIFY_OK : VERIFY_NO_TRUSTED_ROOT;
+ return static_cast<CertVerifyResultAndroid>(result);
}
void AddTestRootCertificate(const uint8* cert, size_t len) {
« no previous file with comments | « net/android/network_library.h ('k') | net/base/cert_verify_proc_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698