OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "crypto/hmac.h" | 5 #include "crypto/hmac.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> |
8 | 9 |
9 #include <algorithm> | 10 #include <algorithm> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "crypto/scoped_capi_types.h" | 14 #include "crypto/scoped_capi_types.h" |
14 #include "crypto/third_party/nss/chromium-blapi.h" | 15 #include "crypto/third_party/nss/chromium-blapi.h" |
15 #include "crypto/third_party/nss/chromium-sha256.h" | 16 #include "crypto/third_party/nss/chromium-sha256.h" |
16 #include "crypto/wincrypt_shim.h" | 17 #include "crypto/wincrypt_shim.h" |
17 | 18 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 201 |
201 if (!CryptHashData(hash, reinterpret_cast<const BYTE*>(data.data()), | 202 if (!CryptHashData(hash, reinterpret_cast<const BYTE*>(data.data()), |
202 static_cast<DWORD>(data.size()), 0)) | 203 static_cast<DWORD>(data.size()), 0)) |
203 return false; | 204 return false; |
204 | 205 |
205 DWORD sha1_size = static_cast<DWORD>(digest_length); | 206 DWORD sha1_size = static_cast<DWORD>(digest_length); |
206 return !!CryptGetHashParam(hash, HP_HASHVAL, digest, &sha1_size, 0); | 207 return !!CryptGetHashParam(hash, HP_HASHVAL, digest, &sha1_size, 0); |
207 } | 208 } |
208 | 209 |
209 } // namespace crypto | 210 } // namespace crypto |
OLD | NEW |