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

Side by Side Diff: content/child/webcrypto/status.cc

Issue 689883002: Throw a SyntaxError when importing keys with invalid usages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Follow the one line change approach 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
« no previous file with comments | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/webcrypto/status.h" 5 #include "content/child/webcrypto/status.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 namespace webcrypto { 9 namespace webcrypto {
10 10
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 "They key is not extractable"); 232 "They key is not extractable");
233 } 233 }
234 234
235 Status Status::ErrorGenerateKeyLength() { 235 Status Status::ErrorGenerateKeyLength() {
236 return Status(blink::WebCryptoErrorTypeData, 236 return Status(blink::WebCryptoErrorTypeData,
237 "Invalid key length: it is either zero or not a multiple of 8 " 237 "Invalid key length: it is either zero or not a multiple of 8 "
238 "bits"); 238 "bits");
239 } 239 }
240 240
241 Status Status::ErrorCreateKeyBadUsages() { 241 Status Status::ErrorCreateKeyBadUsages() {
242 return Status(blink::WebCryptoErrorTypeData, 242 return Status(blink::WebCryptoErrorTypeSyntax,
243 "Cannot create a key using the specified key usages."); 243 "Cannot create a key using the specified key usages.");
244 } 244 }
245 245
246 Status::Status(blink::WebCryptoErrorType error_type, 246 Status::Status(blink::WebCryptoErrorType error_type,
247 const std::string& error_details_utf8) 247 const std::string& error_details_utf8)
248 : type_(TYPE_ERROR), 248 : type_(TYPE_ERROR),
249 error_type_(error_type), 249 error_type_(error_type),
250 error_details_(error_details_utf8) { 250 error_details_(error_details_utf8) {
251 } 251 }
252 252
253 Status::Status(Type type) : type_(type) { 253 Status::Status(Type type) : type_(type) {
254 } 254 }
255 255
256 } // namespace webcrypto 256 } // namespace webcrypto
257 257
258 } // namespace content 258 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698