Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: content/child/webcrypto/shared_crypto_unittest.cc

Issue 194203002: [webcrypto] Remove support for SHA-224 (CL 2 or 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/webcrypto/shared_crypto.cc ('k') | content/child/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/child/webcrypto/shared_crypto.h" 5 #include "content/child/webcrypto/shared_crypto.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 std::string algorithm_name; 257 std::string algorithm_name;
258 if (!dict->GetString(property_name, &algorithm_name)) { 258 if (!dict->GetString(property_name, &algorithm_name)) {
259 EXPECT_TRUE(false) << "Couldn't get string property: " << property_name; 259 EXPECT_TRUE(false) << "Couldn't get string property: " << property_name;
260 return blink::WebCryptoAlgorithm::createNull(); 260 return blink::WebCryptoAlgorithm::createNull();
261 } 261 }
262 262
263 struct { 263 struct {
264 const char* name; 264 const char* name;
265 blink::WebCryptoAlgorithmId id; 265 blink::WebCryptoAlgorithmId id;
266 } kDigestNameToId[] = {{"sha-1", blink::WebCryptoAlgorithmIdSha1}, 266 } kDigestNameToId[] = {{"sha-1", blink::WebCryptoAlgorithmIdSha1},
267 {"sha-224", blink::WebCryptoAlgorithmIdSha224},
268 {"sha-256", blink::WebCryptoAlgorithmIdSha256}, 267 {"sha-256", blink::WebCryptoAlgorithmIdSha256},
269 {"sha-384", blink::WebCryptoAlgorithmIdSha384}, 268 {"sha-384", blink::WebCryptoAlgorithmIdSha384},
270 {"sha-512", blink::WebCryptoAlgorithmIdSha512}, }; 269 {"sha-512", blink::WebCryptoAlgorithmIdSha512}, };
271 270
272 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kDigestNameToId); ++i) { 271 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kDigestNameToId); ++i) {
273 if (kDigestNameToId[i].name == algorithm_name) 272 if (kDigestNameToId[i].name == algorithm_name)
274 return CreateAlgorithm(kDigestNameToId[i].id); 273 return CreateAlgorithm(kDigestNameToId[i].id);
275 } 274 }
276 275
277 return blink::WebCryptoAlgorithm::createNull(); 276 return blink::WebCryptoAlgorithm::createNull();
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 test_cipher_text, 2307 test_cipher_text,
2309 test_authentication_tag, 2308 test_authentication_tag,
2310 &plain_text)); 2309 &plain_text));
2311 } 2310 }
2312 } 2311 }
2313 } 2312 }
2314 2313
2315 } // namespace webcrypto 2314 } // namespace webcrypto
2316 2315
2317 } // namespace content 2316 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/shared_crypto.cc ('k') | content/child/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698