OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/webcrypto/nss/rsa_hashed_algorithm_nss.h" | 5 #include "components/webcrypto/nss/rsa_hashed_algorithm_nss.h" |
6 | 6 |
7 #include <secasn1.h> | 7 #include <secasn1.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/child/webcrypto/crypto_data.h" | 10 #include "components/webcrypto/crypto_data.h" |
11 #include "content/child/webcrypto/generate_key_result.h" | 11 #include "components/webcrypto/generate_key_result.h" |
12 #include "content/child/webcrypto/jwk.h" | 12 #include "components/webcrypto/jwk.h" |
13 #include "content/child/webcrypto/nss/key_nss.h" | 13 #include "components/webcrypto/nss/key_nss.h" |
14 #include "content/child/webcrypto/nss/util_nss.h" | 14 #include "components/webcrypto/nss/util_nss.h" |
15 #include "content/child/webcrypto/status.h" | 15 #include "components/webcrypto/status.h" |
16 #include "content/child/webcrypto/webcrypto_util.h" | 16 #include "components/webcrypto/webcrypto_util.h" |
17 #include "crypto/scoped_nss_types.h" | 17 #include "crypto/scoped_nss_types.h" |
18 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 18 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
19 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 19 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
20 | 20 |
21 namespace content { | |
22 | |
23 namespace webcrypto { | 21 namespace webcrypto { |
24 | 22 |
25 namespace { | 23 namespace { |
26 | 24 |
27 #if defined(USE_NSS) && !defined(OS_CHROMEOS) | 25 #if defined(USE_NSS) && !defined(OS_CHROMEOS) |
28 Status ErrorRsaPrivateKeyImportNotSupported() { | 26 Status ErrorRsaPrivateKeyImportNotSupported() { |
29 return Status::ErrorUnsupported( | 27 return Status::ErrorUnsupported( |
30 "NSS version must be at least 3.16.2 for RSA private key import. See " | 28 "NSS version must be at least 3.16.2 for RSA private key import. See " |
31 "http://crbug.com/380424"); | 29 "http://crbug.com/380424"); |
32 } | 30 } |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 memcmp(algorithm.rsaHashedParams()->publicExponent().data(), | 849 memcmp(algorithm.rsaHashedParams()->publicExponent().data(), |
852 key->algorithm().rsaHashedParams()->publicExponent().data(), | 850 key->algorithm().rsaHashedParams()->publicExponent().data(), |
853 key->algorithm().rsaHashedParams()->publicExponent().size())) { | 851 key->algorithm().rsaHashedParams()->publicExponent().size())) { |
854 return Status::ErrorUnexpected(); | 852 return Status::ErrorUnexpected(); |
855 } | 853 } |
856 | 854 |
857 return Status::Success(); | 855 return Status::Success(); |
858 } | 856 } |
859 | 857 |
860 } // namespace webcrypto | 858 } // namespace webcrypto |
861 | |
862 } // namespace content | |
OLD | NEW |