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

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

Issue 19082002: WebCrypto: Add SHA-1 support to crypto.subtle.digest(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove an extra newline 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;
146 } 147 }
147 148
148 for (size_t i = 0; i < WTF_ARRAY_LENGTH(operationParamsMappings); ++i) { 149 for (size_t i = 0; i < WTF_ARRAY_LENGTH(operationParamsMappings); ++i) {
149 const OperationParamsMapping& mapping = operationParamsMappings[i]; 150 const OperationParamsMapping& mapping = operationParamsMappings[i];
150 m_algorithms[mapping.algorithmId].paramsForOperation[mapping.operation] = mapping.params; 151 m_algorithms[mapping.algorithmId].paramsForOperation[mapping.operation] = mapping.params;
151 } 152 }
152 } 153 }
153 154
154 PassOwnPtr<WebKit::WebCryptoAlgorithmParams> parseAesCbcParams(const Dictionary& raw) 155 PassOwnPtr<WebKit::WebCryptoAlgorithmParams> parseAesCbcParams(const Dictionary& raw)
155 { 156 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 if (!params && paramsType != WebKit::WebCryptoAlgorithmParamsTypeNone) { 223 if (!params && paramsType != WebKit::WebCryptoAlgorithmParamsTypeNone) {
223 ec = NotSupportedError; 224 ec = NotSupportedError;
224 return false; 225 return false;
225 } 226 }
226 227
227 algorithm = WebKit::WebCryptoAlgorithm(info->algorithmId, info->algorithmNam e, params.release()); 228 algorithm = WebKit::WebCryptoAlgorithm(info->algorithmId, info->algorithmNam e, params.release());
228 return true; 229 return true;
229 } 230 }
230 231
231 } // namespace WebCore 232 } // 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