| 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 <openssl/hmac.h> | |
| 6 #include <stddef.h> | 5 #include <stddef.h> |
| 7 #include <stdint.h> | 6 #include <stdint.h> |
| 8 | 7 |
| 9 #include "base/logging.h" | 8 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 11 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
| 12 #include "components/webcrypto/algorithm_implementation.h" | 11 #include "components/webcrypto/algorithm_implementation.h" |
| 13 #include "components/webcrypto/algorithms/secret_key_util.h" | 12 #include "components/webcrypto/algorithms/secret_key_util.h" |
| 14 #include "components/webcrypto/algorithms/util.h" | 13 #include "components/webcrypto/algorithms/util.h" |
| 15 #include "components/webcrypto/blink_key_handle.h" | 14 #include "components/webcrypto/blink_key_handle.h" |
| 16 #include "components/webcrypto/crypto_data.h" | 15 #include "components/webcrypto/crypto_data.h" |
| 17 #include "components/webcrypto/jwk.h" | 16 #include "components/webcrypto/jwk.h" |
| 18 #include "components/webcrypto/status.h" | 17 #include "components/webcrypto/status.h" |
| 19 #include "crypto/openssl_util.h" | 18 #include "crypto/openssl_util.h" |
| 20 #include "crypto/secure_util.h" | 19 #include "crypto/secure_util.h" |
| 21 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 20 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| 22 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 21 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
| 22 #include "third_party/boringssl/src/include/openssl/hmac.h" |
| 23 | 23 |
| 24 namespace webcrypto { | 24 namespace webcrypto { |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 Status GetDigestBlockSizeBits(const blink::WebCryptoAlgorithm& algorithm, | 28 Status GetDigestBlockSizeBits(const blink::WebCryptoAlgorithm& algorithm, |
| 29 unsigned int* block_size_bits) { | 29 unsigned int* block_size_bits) { |
| 30 const EVP_MD* md = GetDigest(algorithm); | 30 const EVP_MD* md = GetDigest(algorithm); |
| 31 if (!md) | 31 if (!md) |
| 32 return Status::ErrorUnsupported(); | 32 return Status::ErrorUnsupported(); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 }; | 314 }; |
| 315 | 315 |
| 316 } // namespace | 316 } // namespace |
| 317 | 317 |
| 318 std::unique_ptr<AlgorithmImplementation> CreateHmacImplementation() { | 318 std::unique_ptr<AlgorithmImplementation> CreateHmacImplementation() { |
| 319 return base::WrapUnique(new HmacImplementation); | 319 return base::WrapUnique(new HmacImplementation); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace webcrypto | 322 } // namespace webcrypto |
| OLD | NEW |