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

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

Issue 757873003: Check that usage isn't empty when generateKey() is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and fix bad merges 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
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/test/aes_cbc_unittest.cc » ('j') | 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 #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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 Status Status::ErrorGenerateHmacKeyLengthZero() { 261 Status Status::ErrorGenerateHmacKeyLengthZero() {
262 return Status(blink::WebCryptoErrorTypeOperation, 262 return Status(blink::WebCryptoErrorTypeOperation,
263 "HMAC key length must be not be zero"); 263 "HMAC key length must be not be zero");
264 } 264 }
265 265
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() {
272 return Status(blink::WebCryptoErrorTypeSyntax,
273 "Usages cannot be empty when creating a key.");
274 }
275
271 Status Status::ErrorImportedEcKeyIncorrectCurve() { 276 Status Status::ErrorImportedEcKeyIncorrectCurve() {
272 return Status( 277 return Status(
273 blink::WebCryptoErrorTypeData, 278 blink::WebCryptoErrorTypeData,
274 "The imported EC key specifies a different curve than requested"); 279 "The imported EC key specifies a different curve than requested");
275 } 280 }
276 281
277 Status Status::ErrorJwkIncorrectCrv() { 282 Status Status::ErrorJwkIncorrectCrv() {
278 return Status( 283 return Status(
279 blink::WebCryptoErrorTypeData, 284 blink::WebCryptoErrorTypeData,
280 "The JWK's \"crv\" member specifies a different curve than requested"); 285 "The JWK's \"crv\" member specifies a different curve than requested");
(...skipping 21 matching lines...) Expand all
302 error_type_(error_type), 307 error_type_(error_type),
303 error_details_(error_details_utf8) { 308 error_details_(error_details_utf8) {
304 } 309 }
305 310
306 Status::Status(Type type) : type_(type) { 311 Status::Status(Type type) : type_(type) {
307 } 312 }
308 313
309 } // namespace webcrypto 314 } // namespace webcrypto
310 315
311 } // namespace content 316 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/test/aes_cbc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698