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

Side by Side Diff: Source/modules/crypto/NormalizeAlgorithm.cpp

Issue 19401003: Revert "WebCrypto: Add SHA-1 support to crypto.subtle.digest()." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « Source/modules/crypto/CryptoOperation.idl ('k') | Source/modules/crypto/SubtleCrypto.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return 0; 136 return 0;
137 return &registry.m_algorithms[it->value]; 137 return &registry.m_algorithms[it->value];
138 } 138 }
139 139
140 AlgorithmRegistry::AlgorithmRegistry() 140 AlgorithmRegistry::AlgorithmRegistry()
141 { 141 {
142 for (size_t i = 0; i < WTF_ARRAY_LENGTH(algorithmNameMappings); ++i) { 142 for (size_t i = 0; i < WTF_ARRAY_LENGTH(algorithmNameMappings); ++i) {
143 const AlgorithmNameMapping& mapping = algorithmNameMappings[i]; 143 const AlgorithmNameMapping& mapping = algorithmNameMappings[i];
144 m_algorithmNameToId.add(mapping.algorithmName, mapping.algorithmId); 144 m_algorithmNameToId.add(mapping.algorithmName, mapping.algorithmId);
145 m_algorithms[mapping.algorithmId].algorithmName = mapping.algorithmName; 145 m_algorithms[mapping.algorithmId].algorithmName = mapping.algorithmName;
146 m_algorithms[mapping.algorithmId].algorithmId = mapping.algorithmId;
147 } 146 }
148 147
149 for (size_t i = 0; i < WTF_ARRAY_LENGTH(operationParamsMappings); ++i) { 148 for (size_t i = 0; i < WTF_ARRAY_LENGTH(operationParamsMappings); ++i) {
150 const OperationParamsMapping& mapping = operationParamsMappings[i]; 149 const OperationParamsMapping& mapping = operationParamsMappings[i];
151 m_algorithms[mapping.algorithmId].paramsForOperation[mapping.operation] = mapping.params; 150 m_algorithms[mapping.algorithmId].paramsForOperation[mapping.operation] = mapping.params;
152 } 151 }
153 } 152 }
154 153
155 PassOwnPtr<WebKit::WebCryptoAlgorithmParams> parseAesCbcParams(const Dictionary& raw) 154 PassOwnPtr<WebKit::WebCryptoAlgorithmParams> parseAesCbcParams(const Dictionary& raw)
156 { 155 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!params && paramsType != WebKit::WebCryptoAlgorithmParamsTypeNone) { 222 if (!params && paramsType != WebKit::WebCryptoAlgorithmParamsTypeNone) {
224 ec = NotSupportedError; 223 ec = NotSupportedError;
225 return false; 224 return false;
226 } 225 }
227 226
228 algorithm = WebKit::WebCryptoAlgorithm(info->algorithmId, info->algorithmNam e, params.release()); 227 algorithm = WebKit::WebCryptoAlgorithm(info->algorithmId, info->algorithmNam e, params.release());
229 return true; 228 return true;
230 } 229 }
231 230
232 } // namespace WebCore 231 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/crypto/CryptoOperation.idl ('k') | Source/modules/crypto/SubtleCrypto.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698