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

Side by Side Diff: net/android/keystore_unittest.cc

Issue 2237943002: Remove now-unnecessary .obj() in Java method calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@switch-context
Patch Set: Rebase *again* :( 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 unified diff | Download patch
« no previous file with comments | « net/android/keystore.cc ('k') | net/android/network_change_notifier_delegate_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <openssl/bn.h> 5 #include <openssl/bn.h>
6 #include <openssl/dsa.h> 6 #include <openssl/dsa.h>
7 #include <openssl/ecdsa.h> 7 #include <openssl/ecdsa.h>
8 #include <openssl/err.h> 8 #include <openssl/err.h>
9 #include <openssl/evp.h> 9 #include <openssl/evp.h>
10 #include <openssl/pem.h> 10 #include <openssl/pem.h>
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 // Retrieve a JNI local ref from encoded PKCS#8 data. 161 // Retrieve a JNI local ref from encoded PKCS#8 data.
162 ScopedJava GetPKCS8PrivateKeyJava(PrivateKeyType key_type, 162 ScopedJava GetPKCS8PrivateKeyJava(PrivateKeyType key_type,
163 const std::string& pkcs8_key) { 163 const std::string& pkcs8_key) {
164 JNIEnv* env = base::android::AttachCurrentThread(); 164 JNIEnv* env = base::android::AttachCurrentThread();
165 base::android::ScopedJavaLocalRef<jbyteArray> bytes( 165 base::android::ScopedJavaLocalRef<jbyteArray> bytes(
166 base::android::ToJavaByteArray( 166 base::android::ToJavaByteArray(
167 env, reinterpret_cast<const uint8_t*>(pkcs8_key.data()), 167 env, reinterpret_cast<const uint8_t*>(pkcs8_key.data()),
168 pkcs8_key.size())); 168 pkcs8_key.size()));
169 169
170 ScopedJava key( 170 ScopedJava key(Java_AndroidKeyStoreTestUtil_createPrivateKeyFromPKCS8(
171 Java_AndroidKeyStoreTestUtil_createPrivateKeyFromPKCS8( 171 env, key_type, bytes));
172 env, key_type, bytes.obj()));
173 172
174 return key; 173 return key;
175 } 174 }
176 175
177 const char kTestRsaKeyFile[] = "android-test-key-rsa.pem"; 176 const char kTestRsaKeyFile[] = "android-test-key-rsa.pem";
178 177
179 // The RSA test hash must be 36 bytes exactly. 178 // The RSA test hash must be 36 bytes exactly.
180 const char kTestRsaHash[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 179 const char kTestRsaHash[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
181 180
182 // Retrieve a JNI local ref for our test RSA key. 181 // Retrieve a JNI local ref for our test RSA key.
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 std::string signature; 534 std::string signature;
536 DoKeySigningWithWrapper(wrapper_key.get(), 535 DoKeySigningWithWrapper(wrapper_key.get(),
537 openssl_key.get(), 536 openssl_key.get(),
538 message, 537 message,
539 &signature); 538 &signature);
540 ASSERT_TRUE(VerifyTestECDSASignature(message, signature)); 539 ASSERT_TRUE(VerifyTestECDSASignature(message, signature));
541 } 540 }
542 541
543 } // namespace android 542 } // namespace android
544 } // namespace net 543 } // namespace net
OLDNEW
« no previous file with comments | « net/android/keystore.cc ('k') | net/android/network_change_notifier_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698