OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "net/cert/internal/signature_algorithm.h" | 5 #include "net/cert/internal/signature_algorithm.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "net/base/test_data_directory.h" | |
12 #include "net/cert/pem_tokenizer.h" | 11 #include "net/cert/pem_tokenizer.h" |
13 #include "net/der/input.h" | 12 #include "net/der/input.h" |
14 #include "net/der/parser.h" | 13 #include "net/der/parser.h" |
| 14 #include "net/test/test_data_directory.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Creates a SignatureAlgorithm given the DER as a byte array. Returns true on | 21 // Creates a SignatureAlgorithm given the DER as a byte array. Returns true on |
22 // success and fills |*out| with a non-null pointer. | 22 // success and fills |*out| with a non-null pointer. |
23 template <size_t N> | 23 template <size_t N> |
24 bool ParseDer(const uint8_t (&data)[N], | 24 bool ParseDer(const uint8_t (&data)[N], |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 const RsaPssParameters* params = algorithm->ParamsForRsaPss(); | 1049 const RsaPssParameters* params = algorithm->ParamsForRsaPss(); |
1050 | 1050 |
1051 ASSERT_TRUE(params); | 1051 ASSERT_TRUE(params); |
1052 EXPECT_EQ(DigestAlgorithm::Sha256, params->mgf1_hash()); | 1052 EXPECT_EQ(DigestAlgorithm::Sha256, params->mgf1_hash()); |
1053 EXPECT_EQ(10u, params->salt_length()); | 1053 EXPECT_EQ(10u, params->salt_length()); |
1054 } | 1054 } |
1055 | 1055 |
1056 } // namespace | 1056 } // namespace |
1057 | 1057 |
1058 } // namespace net | 1058 } // namespace net |
OLD | NEW |