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

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

Issue 1474603004: Remove Android support for out-of-process KeyStores (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments Created 5 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 unified diff | Download patch
« no previous file with comments | « net/android/keystore.cc ('k') | net/android/net_jni_registrar.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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 SignWithOpenSSL(message, wrapper_key, &wrapper_signature); 401 SignWithOpenSSL(message, wrapper_key, &wrapper_signature);
402 ASSERT_NE(0U, wrapper_signature.size()); 402 ASSERT_NE(0U, wrapper_signature.size());
403 403
404 result->assign( 404 result->assign(
405 reinterpret_cast<const char*>(&wrapper_signature[0]), 405 reinterpret_cast<const char*>(&wrapper_signature[0]),
406 wrapper_signature.size()); 406 wrapper_signature.size());
407 } 407 }
408 408
409 } // namespace 409 } // namespace
410 410
411 TEST(AndroidKeyStore,GetRSAKeyModulus) { 411 TEST(AndroidKeyStore, GetRSAKeyModulus) {
412 crypto::OpenSSLErrStackTracer err_trace(FROM_HERE); 412 crypto::OpenSSLErrStackTracer err_trace(FROM_HERE);
413 InitEnv(); 413 InitEnv();
414 414
415 // Load the test RSA key. 415 // Load the test RSA key.
416 crypto::ScopedEVP_PKEY pkey(ImportPrivateKeyFile(kTestRsaKeyFile)); 416 crypto::ScopedEVP_PKEY pkey(ImportPrivateKeyFile(kTestRsaKeyFile));
417 ASSERT_TRUE(pkey.get()); 417 ASSERT_TRUE(pkey.get());
418 418
419 // Convert it to encoded PKCS#8 bytes. 419 // Convert it to encoded PKCS#8 bytes.
420 std::string pkcs8_data; 420 std::string pkcs8_data;
421 ASSERT_TRUE(GetPrivateKeyPkcs8Bytes(pkey, &pkcs8_data)); 421 ASSERT_TRUE(GetPrivateKeyPkcs8Bytes(pkey, &pkcs8_data));
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 std::string signature; 548 std::string signature;
549 DoKeySigningWithWrapper(wrapper_key.get(), 549 DoKeySigningWithWrapper(wrapper_key.get(),
550 openssl_key.get(), 550 openssl_key.get(),
551 message, 551 message,
552 &signature); 552 &signature);
553 ASSERT_TRUE(VerifyTestECDSASignature(message, signature)); 553 ASSERT_TRUE(VerifyTestECDSASignature(message, signature));
554 } 554 }
555 555
556 } // namespace android 556 } // namespace android
557 } // namespace net 557 } // namespace net
OLDNEW
« no previous file with comments | « net/android/keystore.cc ('k') | net/android/net_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698