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

Unified Diff: net/android/network_library.cc

Issue 108653013: Export verified_cert and public_key_hashes on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enable more tests. Created 7 years 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/cert/cert_verify_proc.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 2407100cdc3052457bb0e86d71cdd2444a8a014b..b807a0a13c5b0a7f4b0d2e464353b43a5b8e3fed 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -23,9 +23,12 @@ using base::android::ToJavaByteArray;
namespace net {
namespace android {
-CertVerifyResultAndroid VerifyX509CertChain(
- const std::vector<std::string>& cert_chain,
- const std::string& auth_type) {
+void VerifyX509CertChain(const std::vector<std::string>& cert_chain,
+ const std::string& auth_type,
+ const std::string& host,
+ CertVerifyStatusAndroid* status,
+ bool* is_issued_by_known_root,
+ std::vector<std::string>* verified_chain) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobjectArray> chain_byte_array =
@@ -36,10 +39,16 @@ CertVerifyResultAndroid VerifyX509CertChain(
ConvertUTF8ToJavaString(env, auth_type);
DCHECK(!auth_string.is_null());
- jint result = Java_AndroidNetworkLibrary_verifyServerCertificates(
- env, chain_byte_array.obj(), auth_string.obj());
+ ScopedJavaLocalRef<jstring> host_string =
+ ConvertUTF8ToJavaString(env, host);
+ DCHECK(!host_string.is_null());
- return static_cast<CertVerifyResultAndroid>(result);
+ ScopedJavaLocalRef<jobject> result =
+ Java_AndroidNetworkLibrary_verifyServerCertificates(
+ env, chain_byte_array.obj(), auth_string.obj(), host_string.obj());
+
Ryan Sleevi 2014/01/16 23:29:42 Can you check |env| to ensure no exception happene
davidben 2014/01/17 17:52:59 Done.
+ ExtractCertVerifyResult(result.obj(),
+ status, is_issued_by_known_root, verified_chain);
}
void AddTestRootCertificate(const uint8* cert, size_t len) {
« no previous file with comments | « net/android/network_library.h ('k') | net/cert/cert_verify_proc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698