| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer/webcrypto/webcrypto_impl.h" | 5 #include "content/renderer/webcrypto/webcrypto_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/renderer/webcrypto/crypto_data.h" | 8 #include "content/renderer/webcrypto/crypto_data.h" |
| 9 #include "content/renderer/webcrypto/shared_crypto.h" | 9 #include "content/renderer/webcrypto/shared_crypto.h" |
| 10 #include "content/renderer/webcrypto/webcrypto_util.h" | 10 #include "content/renderer/webcrypto/webcrypto_util.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 key, | 187 key, |
| 188 webcrypto::CryptoData(signature, signature_size), | 188 webcrypto::CryptoData(signature, signature_size), |
| 189 webcrypto::CryptoData(data, data_size), | 189 webcrypto::CryptoData(data, data_size), |
| 190 &signature_match); | 190 &signature_match); |
| 191 if (status.IsError()) | 191 if (status.IsError()) |
| 192 CompleteWithError(status, &result); | 192 CompleteWithError(status, &result); |
| 193 else | 193 else |
| 194 result.completeWithBoolean(signature_match); | 194 result.completeWithBoolean(signature_match); |
| 195 } | 195 } |
| 196 | 196 |
| 197 bool WebCryptoImpl::digestSynchronous( |
| 198 const blink::WebCryptoAlgorithmId algorithm_id, |
| 199 const unsigned char* data, |
| 200 unsigned int data_size, |
| 201 blink::WebArrayBuffer& result) { |
| 202 blink::WebCryptoAlgorithm algorithm = |
| 203 blink::WebCryptoAlgorithm::adoptParamsAndCreate(algorithm_id, NULL); |
| 204 return (webcrypto::Digest( |
| 205 algorithm, webcrypto::CryptoData(data, data_size), &result)) |
| 206 .IsSuccess(); |
| 207 } |
| 208 |
| 197 } // namespace content | 209 } // namespace content |
| OLD | NEW |