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

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

Issue 777403004: [WebCrypto] Throw syntaxError if keyUsage is empty in ImportKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 Status Status::ErrorCreateKeyBadUsages() { 266 Status Status::ErrorCreateKeyBadUsages() {
267 return Status(blink::WebCryptoErrorTypeSyntax, 267 return Status(blink::WebCryptoErrorTypeSyntax,
268 "Cannot create a key using the specified key usages."); 268 "Cannot create a key using the specified key usages.");
269 } 269 }
270 270
271 Status Status::ErrorCreateKeyEmptyUsages() { 271 Status Status::ErrorCreateKeyEmptyUsages() {
272 return Status(blink::WebCryptoErrorTypeSyntax, 272 return Status(blink::WebCryptoErrorTypeSyntax,
273 "Usages cannot be empty when creating a key."); 273 "Usages cannot be empty when creating a key.");
274 } 274 }
275 275
276 Status Status::ErrorImportKeyEmptyUsages() {
277 return Status(blink::WebCryptoErrorTypeSyntax,
278 "Usages cannot be empty when importing a key.");
279 }
280
276 Status Status::ErrorImportedEcKeyIncorrectCurve() { 281 Status Status::ErrorImportedEcKeyIncorrectCurve() {
277 return Status( 282 return Status(
278 blink::WebCryptoErrorTypeData, 283 blink::WebCryptoErrorTypeData,
279 "The imported EC key specifies a different curve than requested"); 284 "The imported EC key specifies a different curve than requested");
280 } 285 }
281 286
282 Status Status::ErrorJwkIncorrectCrv() { 287 Status Status::ErrorJwkIncorrectCrv() {
283 return Status( 288 return Status(
284 blink::WebCryptoErrorTypeData, 289 blink::WebCryptoErrorTypeData,
285 "The JWK's \"crv\" member specifies a different curve than requested"); 290 "The JWK's \"crv\" member specifies a different curve than requested");
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 error_type_(error_type), 338 error_type_(error_type),
334 error_details_(error_details_utf8) { 339 error_details_(error_details_utf8) {
335 } 340 }
336 341
337 Status::Status(Type type) : type_(type) { 342 Status::Status(Type type) : type_(type) {
338 } 343 }
339 344
340 } // namespace webcrypto 345 } // namespace webcrypto
341 346
342 } // namespace content 347 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698