| 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 <cryptohi.h> | 5 #include <cryptohi.h> |
| 6 #include <pk11pub.h> | 6 #include <pk11pub.h> |
| 7 #include <secerr.h> | 7 #include <secerr.h> |
| 8 #include <sechash.h> | 8 #include <sechash.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "content/child/webcrypto/algorithm_implementation.h" | 12 #include "components/webcrypto/algorithm_implementation.h" |
| 13 #include "content/child/webcrypto/crypto_data.h" | 13 #include "components/webcrypto/crypto_data.h" |
| 14 #include "content/child/webcrypto/jwk.h" | 14 #include "components/webcrypto/jwk.h" |
| 15 #include "content/child/webcrypto/nss/key_nss.h" | 15 #include "components/webcrypto/nss/key_nss.h" |
| 16 #include "content/child/webcrypto/nss/sym_key_nss.h" | 16 #include "components/webcrypto/nss/sym_key_nss.h" |
| 17 #include "content/child/webcrypto/nss/util_nss.h" | 17 #include "components/webcrypto/nss/util_nss.h" |
| 18 #include "content/child/webcrypto/status.h" | 18 #include "components/webcrypto/status.h" |
| 19 #include "content/child/webcrypto/webcrypto_util.h" | 19 #include "components/webcrypto/webcrypto_util.h" |
| 20 #include "crypto/secure_util.h" | 20 #include "crypto/secure_util.h" |
| 21 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 21 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| 22 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 22 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
| 23 | 23 |
| 24 namespace content { | |
| 25 | |
| 26 namespace webcrypto { | 24 namespace webcrypto { |
| 27 | 25 |
| 28 namespace { | 26 namespace { |
| 29 | 27 |
| 30 const blink::WebCryptoKeyUsageMask kAllKeyUsages = | 28 const blink::WebCryptoKeyUsageMask kAllKeyUsages = |
| 31 blink::WebCryptoKeyUsageSign | blink::WebCryptoKeyUsageVerify; | 29 blink::WebCryptoKeyUsageSign | blink::WebCryptoKeyUsageVerify; |
| 32 | 30 |
| 33 bool WebCryptoHashToHMACMechanism(const blink::WebCryptoAlgorithm& algorithm, | 31 bool WebCryptoHashToHMACMechanism(const blink::WebCryptoAlgorithm& algorithm, |
| 34 CK_MECHANISM_TYPE* mechanism) { | 32 CK_MECHANISM_TYPE* mechanism) { |
| 35 switch (algorithm.id()) { | 33 switch (algorithm.id()) { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 } | 252 } |
| 255 }; | 253 }; |
| 256 | 254 |
| 257 } // namespace | 255 } // namespace |
| 258 | 256 |
| 259 AlgorithmImplementation* CreatePlatformHmacImplementation() { | 257 AlgorithmImplementation* CreatePlatformHmacImplementation() { |
| 260 return new HmacImplementation; | 258 return new HmacImplementation; |
| 261 } | 259 } |
| 262 | 260 |
| 263 } // namespace webcrypto | 261 } // namespace webcrypto |
| 264 | |
| 265 } // namespace content | |
| OLD | NEW |