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

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

Issue 26426002: [webcrypto] Add parameters for AES-GCM and RSA-OAEP to blink API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/Algorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "modules/crypto/NormalizeAlgorithm.h" 32 #include "modules/crypto/NormalizeAlgorithm.h"
33 33
34 #include "bindings/v8/Dictionary.h" 34 #include "bindings/v8/Dictionary.h"
35 #include "bindings/v8/ExceptionState.h" 35 #include "bindings/v8/ExceptionState.h"
36 #include "core/dom/ExceptionCode.h" 36 #include "core/dom/ExceptionCode.h"
37 #include "platform/NotImplemented.h"
37 #include "public/platform/WebCryptoAlgorithm.h" 38 #include "public/platform/WebCryptoAlgorithm.h"
38 #include "public/platform/WebCryptoAlgorithmParams.h" 39 #include "public/platform/WebCryptoAlgorithmParams.h"
39 #include "wtf/ArrayBuffer.h" 40 #include "wtf/ArrayBuffer.h"
40 #include "wtf/ArrayBufferView.h" 41 #include "wtf/ArrayBufferView.h"
41 #include "wtf/HashMap.h" 42 #include "wtf/HashMap.h"
42 #include "wtf/MathExtras.h" 43 #include "wtf/MathExtras.h"
43 #include "wtf/Uint8Array.h" 44 #include "wtf/Uint8Array.h"
44 #include "wtf/Vector.h" 45 #include "wtf/Vector.h"
45 #include "wtf/text/StringBuilder.h" 46 #include "wtf/text/StringBuilder.h"
46 #include "wtf/text/StringHash.h" 47 #include "wtf/text/StringHash.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 return parseHmacParams(raw, params, context, es); 427 return parseHmacParams(raw, params, context, es);
427 case WebKit::WebCryptoAlgorithmParamsTypeHmacKeyParams: 428 case WebKit::WebCryptoAlgorithmParamsTypeHmacKeyParams:
428 context.add("HmacKeyParams"); 429 context.add("HmacKeyParams");
429 return parseHmacKeyParams(raw, params, context, es); 430 return parseHmacKeyParams(raw, params, context, es);
430 case WebKit::WebCryptoAlgorithmParamsTypeRsaSsaParams: 431 case WebKit::WebCryptoAlgorithmParamsTypeRsaSsaParams:
431 context.add("RsaSSaParams"); 432 context.add("RsaSSaParams");
432 return parseRsaSsaParams(raw, params, context, es); 433 return parseRsaSsaParams(raw, params, context, es);
433 case WebKit::WebCryptoAlgorithmParamsTypeRsaKeyGenParams: 434 case WebKit::WebCryptoAlgorithmParamsTypeRsaKeyGenParams:
434 context.add("RsaKeyGenParams"); 435 context.add("RsaKeyGenParams");
435 return parseRsaKeyGenParams(raw, params, context, es); 436 return parseRsaKeyGenParams(raw, params, context, es);
437 case WebKit::WebCryptoAlgorithmParamsTypeAesGcmParams:
438 case WebKit::WebCryptoAlgorithmParamsTypeRsaOaepParams:
439 // TODO
440 notImplemented();
441 break;
436 } 442 }
437 ASSERT_NOT_REACHED(); 443 ASSERT_NOT_REACHED();
438 return false; 444 return false;
439 } 445 }
440 446
441 const AlgorithmInfo* algorithmInfo(const Dictionary& raw, const ExceptionContext & context, ExceptionState& es) 447 const AlgorithmInfo* algorithmInfo(const Dictionary& raw, const ExceptionContext & context, ExceptionState& es)
442 { 448 {
443 if (!raw.isObject()) { 449 if (!raw.isObject()) {
444 es.throwTypeError(context.toString("Not an object")); 450 es.throwTypeError(context.toString("Not an object"));
445 return 0; 451 return 0;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 { 498 {
493 return normalizeAlgorithm(raw, op, algorithm, ExceptionContext(), es); 499 return normalizeAlgorithm(raw, op, algorithm, ExceptionContext(), es);
494 } 500 }
495 501
496 const char* algorithmIdToName(WebKit::WebCryptoAlgorithmId id) 502 const char* algorithmIdToName(WebKit::WebCryptoAlgorithmId id)
497 { 503 {
498 return AlgorithmRegistry::instance().lookupAlgorithmById(id)->algorithmName; 504 return AlgorithmRegistry::instance().lookupAlgorithmById(id)->algorithmName;
499 } 505 }
500 506
501 } // namespace WebCore 507 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/crypto/Algorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698