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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModulesTest.cpp

Issue 2544533002: Have all overloads of webcrypto::AlgorithmImplementation::DeserializeKeyForClone check the params t… (Closed)
Patch Set: additional checks, per eroman Created 4 years 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
« no previous file with comments | « components/webcrypto/algorithms/rsa.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.h" 5 #include "bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "bindings/core/v8/ToV8.h" 8 #include "bindings/core/v8/ToV8.h"
9 #include "bindings/core/v8/V8ArrayBuffer.h" 9 #include "bindings/core/v8/V8ArrayBuffer.h"
10 #include "bindings/core/v8/V8BindingForTesting.h" 10 #include "bindings/core/v8/V8BindingForTesting.h"
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 ScriptState* scriptState = scope.getScriptState(); 788 ScriptState* scriptState = scope.getScriptState();
789 789
790 // Invalid algorithm ID. 790 // Invalid algorithm ID.
791 EXPECT_TRUE(V8ScriptValueDeserializerForModules( 791 EXPECT_TRUE(V8ScriptValueDeserializerForModules(
792 scriptState, 792 scriptState,
793 serializedValue({0xff, 0x09, 0x3f, 0x00, 0x4b, 0x06, 0x7f, 793 serializedValue({0xff, 0x09, 0x3f, 0x00, 0x4b, 0x06, 0x7f,
794 0xa0, 0x02, 0x03, 0x01, 0x02, 0x03, 0x00})) 794 0xa0, 0x02, 0x03, 0x01, 0x02, 0x03, 0x00}))
795 .deserialize() 795 .deserialize()
796 ->IsNull()); 796 ->IsNull());
797 797
798 // Algorithm ID / params type mismatch (AES params, RSA-OEAP ID).
799 EXPECT_TRUE(
800 V8ScriptValueDeserializerForModules(
801 scriptState,
802 serializedValue({0xff, 0x09, 0x3f, 0x00, 0x4b, 0x01, 0x0a, 0x10, 0x04,
803 0x10, 0x7e, 0x25, 0xb2, 0xe8, 0x62, 0x3e, 0xd7, 0x83,
804 0x70, 0xa2, 0xae, 0x98, 0x79, 0x1b, 0xc5, 0xf7}))
805 .deserialize()
806 ->IsNull());
807
798 // Invalid asymmetric key type. 808 // Invalid asymmetric key type.
799 EXPECT_TRUE( 809 EXPECT_TRUE(
800 V8ScriptValueDeserializerForModules( 810 V8ScriptValueDeserializerForModules(
801 scriptState, 811 scriptState,
802 serializedValue( 812 serializedValue(
803 {0xff, 0x09, 0x3f, 0x00, 0x4b, 0x05, 0x0e, 0x7f, 0x01, 0x11, 0x5b, 813 {0xff, 0x09, 0x3f, 0x00, 0x4b, 0x05, 0x0e, 0x7f, 0x01, 0x11, 0x5b,
804 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 814 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d,
805 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 815 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01,
806 0x07, 0x03, 0x42, 0x00, 0x04, 0xfe, 0x16, 0x70, 0x29, 0x07, 0x2c, 816 0x07, 0x03, 0x42, 0x00, 0x04, 0xfe, 0x16, 0x70, 0x29, 0x07, 0x2c,
807 0x11, 0xbf, 0xcf, 0xb7, 0x9d, 0x54, 0x35, 0x3d, 0xc7, 0x85, 0x66, 817 0x11, 0xbf, 0xcf, 0xb7, 0x9d, 0x54, 0x35, 0x3d, 0xc7, 0x85, 0x66,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x69, 971 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x69,
962 0x73, 0x74, 0x65, 0x6e, 0x74, 0x2f 972 0x73, 0x74, 0x65, 0x6e, 0x74, 0x2f
963 973
964 })) 974 }))
965 .deserialize() 975 .deserialize()
966 ->IsNull()); 976 ->IsNull());
967 } 977 }
968 978
969 } // namespace 979 } // namespace
970 } // namespace blink 980 } // namespace blink
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/rsa.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698