| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/crypto/signature_verifier.h" | 5 #include "base/crypto/signature_verifier.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 TEST(SignatureVerifierTest, BasicTest) { | 8 TEST(SignatureVerifierTest, BasicTest) { |
| 9 // The input data in this test comes from real certificates. | 9 // The input data in this test comes from real certificates. |
| 10 // | 10 // |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 public_key_info, sizeof(public_key_info)); | 250 public_key_info, sizeof(public_key_info)); |
| 251 | 251 |
| 252 // A crypto library (e.g., NSS) may detect that the signature is corrupted | 252 // A crypto library (e.g., NSS) may detect that the signature is corrupted |
| 253 // and cause VerifyInit to return false, so it is fine for 'ok' to be false. | 253 // and cause VerifyInit to return false, so it is fine for 'ok' to be false. |
| 254 if (ok) { | 254 if (ok) { |
| 255 verifier.VerifyUpdate(tbs_certificate, sizeof(tbs_certificate)); | 255 verifier.VerifyUpdate(tbs_certificate, sizeof(tbs_certificate)); |
| 256 ok = verifier.VerifyFinal(); | 256 ok = verifier.VerifyFinal(); |
| 257 EXPECT_FALSE(ok); | 257 EXPECT_FALSE(ok); |
| 258 } | 258 } |
| 259 } | 259 } |
| OLD | NEW |