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 // This method synchronously computes a digest for the given data, returning | |
eroman
2014/02/21 23:11:20
Can you move this comment to the header file?
jww
2014/02/21 23:23:34
Done.
| |
198 // |true| if successful and |false| otherwise. This relies on the | |
199 // webcrypto::Digest() implementation being synchronous as well, so if that ever | |
eroman
2014/02/21 23:11:20
Please remove this comment, I think the function s
jww
2014/02/21 23:23:34
Done.
| |
200 // changes, this method will also need to be modified. | |
201 bool WebCryptoImpl::digestSynchronous( | |
202 const blink::WebCryptoAlgorithmId algorithm_id, | |
eroman
2014/02/21 23:11:20
in the header this is called "algorithm". Please u
jww
2014/02/21 23:23:34
Done.
| |
203 const unsigned char* data, | |
204 unsigned int data_size, | |
205 blink::WebArrayBuffer& result) { | |
eroman
2014/02/21 23:11:20
did you run "git cl format". If not please do, try
jww
2014/02/21 23:23:34
Yup, I ran git-cl format over this. In fact, the w
| |
206 blink::WebCryptoAlgorithm algorithm = | |
207 blink::WebCryptoAlgorithm::adoptParamsAndCreate(algorithm_id, NULL); | |
208 return (webcrypto::Digest( | |
209 algorithm, webcrypto::CryptoData(data, data_size), &result)) | |
210 .IsSuccess(); | |
211 } | |
212 | |
197 } // namespace content | 213 } // namespace content |
OLD | NEW |