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 "components/webcrypto/algorithms/util.h" | 5 #include "components/webcrypto/algorithms/util.h" |
6 | 6 |
7 #include <openssl/aead.h> | |
8 #include <openssl/bn.h> | |
9 #include <openssl/digest.h> | |
10 | |
11 #include "base/logging.h" | 7 #include "base/logging.h" |
12 #include "components/webcrypto/crypto_data.h" | 8 #include "components/webcrypto/crypto_data.h" |
13 #include "components/webcrypto/status.h" | 9 #include "components/webcrypto/status.h" |
14 #include "crypto/openssl_util.h" | 10 #include "crypto/openssl_util.h" |
| 11 #include "third_party/boringssl/src/include/openssl/aead.h" |
| 12 #include "third_party/boringssl/src/include/openssl/bn.h" |
| 13 #include "third_party/boringssl/src/include/openssl/digest.h" |
15 | 14 |
16 namespace webcrypto { | 15 namespace webcrypto { |
17 | 16 |
18 const EVP_MD* GetDigest(const blink::WebCryptoAlgorithm& hash_algorithm) { | 17 const EVP_MD* GetDigest(const blink::WebCryptoAlgorithm& hash_algorithm) { |
19 return GetDigest(hash_algorithm.id()); | 18 return GetDigest(hash_algorithm.id()); |
20 } | 19 } |
21 | 20 |
22 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id) { | 21 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id) { |
23 switch (id) { | 22 switch (id) { |
24 case blink::WebCryptoAlgorithmIdSha1: | 23 case blink::WebCryptoAlgorithmIdSha1: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 additional_data.byte_length()); | 107 additional_data.byte_length()); |
109 } | 108 } |
110 | 109 |
111 if (!ok) | 110 if (!ok) |
112 return Status::OperationError(); | 111 return Status::OperationError(); |
113 buffer->resize(len); | 112 buffer->resize(len); |
114 return Status::Success(); | 113 return Status::Success(); |
115 } | 114 } |
116 | 115 |
117 } // namespace webcrypto | 116 } // namespace webcrypto |
OLD | NEW |