Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 ASSERT_FALSE(rsa_key.is_null()); | 569 ASSERT_FALSE(rsa_key.is_null()); |
| 570 EXPECT_EQ(PRIVATE_KEY_TYPE_RSA, | 570 EXPECT_EQ(PRIVATE_KEY_TYPE_RSA, |
| 571 GetPrivateKeyType(rsa_key.obj())); | 571 GetPrivateKeyType(rsa_key.obj())); |
| 572 } | 572 } |
| 573 | 573 |
| 574 TEST(AndroidKeyStore,SignWithPrivateKeyRSA) { | 574 TEST(AndroidKeyStore,SignWithPrivateKeyRSA) { |
| 575 ScopedJava rsa_key = GetRSATestKeyJava(); | 575 ScopedJava rsa_key = GetRSATestKeyJava(); |
| 576 ASSERT_FALSE(rsa_key.is_null()); | 576 ASSERT_FALSE(rsa_key.is_null()); |
| 577 | 577 |
| 578 if (IsOnAndroidOlderThan_4_2()) { | 578 if (IsOnAndroidOlderThan_4_2()) { |
| 579 LOG(INFO) << "This test can't run on Android < 4.2"; | 579 VLOG(0) << "This test can't run on Android < 4.2"; |
|
Ryan Sleevi
2013/11/25 01:08:32
Let's keep this as LOG(INFO)
scottmg
2013/11/25 17:12:38
Done.
| |
| 580 return; | 580 return; |
| 581 } | 581 } |
| 582 | 582 |
| 583 ScopedEVP_PKEY openssl_key(ImportPrivateKeyFile(kTestRsaKeyFile)); | 583 ScopedEVP_PKEY openssl_key(ImportPrivateKeyFile(kTestRsaKeyFile)); |
| 584 ASSERT_TRUE(openssl_key.get()); | 584 ASSERT_TRUE(openssl_key.get()); |
| 585 | 585 |
| 586 std::string message = kTestRsaHash; | 586 std::string message = kTestRsaHash; |
| 587 ASSERT_EQ(36U, message.size()); | 587 ASSERT_EQ(36U, message.size()); |
| 588 | 588 |
| 589 std::string signature; | 589 std::string signature; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 716 std::string signature; | 716 std::string signature; |
| 717 DoKeySigningWithWrapper(wrapper_key.get(), | 717 DoKeySigningWithWrapper(wrapper_key.get(), |
| 718 openssl_key.get(), | 718 openssl_key.get(), |
| 719 message, | 719 message, |
| 720 &signature); | 720 &signature); |
| 721 ASSERT_TRUE(VerifyTestECDSASignature(message, signature)); | 721 ASSERT_TRUE(VerifyTestECDSASignature(message, signature)); |
| 722 } | 722 } |
| 723 | 723 |
| 724 } // namespace android | 724 } // namespace android |
| 725 } // namespace net | 725 } // namespace net |
| OLD | NEW |