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

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

Issue 707743002: WebCrypto: Add ECDSA algorithm (Blink side). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 6 years, 1 month 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
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 copyStringProperty("use", dict, jsonObject.get()); 175 copyStringProperty("use", dict, jsonObject.get());
176 copySequenceOfStringProperty("key_ops", dict, jsonObject.get()); 176 copySequenceOfStringProperty("key_ops", dict, jsonObject.get());
177 copyStringProperty("alg", dict, jsonObject.get()); 177 copyStringProperty("alg", dict, jsonObject.get());
178 178
179 bool ext; 179 bool ext;
180 if (DictionaryHelper::get(dict, "ext", ext)) 180 if (DictionaryHelper::get(dict, "ext", ext))
181 jsonObject->setBoolean("ext", ext); 181 jsonObject->setBoolean("ext", ext);
182 182
183 const char* const propertyNames[] = { "d", "n", "e", "p", "q", "dp", "dq", " qi", "k" }; 183 const char* const propertyNames[] = { "d", "n", "e", "p", "q", "dp", "dq", " qi", "k", "crv", "x", "y" };
184 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(propertyNames); ++i) 184 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(propertyNames); ++i)
185 copyStringProperty(propertyNames[i], dict, jsonObject.get()); 185 copyStringProperty(propertyNames[i], dict, jsonObject.get());
186 186
187 String json = jsonObject->toJSONString(); 187 String json = jsonObject->toJSONString();
188 jsonUtf8 = json.utf8(); 188 jsonUtf8 = json.utf8();
189 return true; 189 return true;
190 } 190 }
191 191
192 SubtleCrypto::SubtleCrypto() 192 SubtleCrypto::SubtleCrypto()
193 { 193 {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 return promise; 391 return promise;
392 392
393 if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoOperatio nUnwrapKey, result.get())) 393 if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoOperatio nUnwrapKey, result.get()))
394 return promise; 394 return promise;
395 395
396 Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrapped Key.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, result->result()); 396 Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrapped Key.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, result->result());
397 return promise; 397 return promise;
398 } 398 }
399 399
400 } // namespace blink 400 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698