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

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

Issue 745443002: Check that usage isn't empty when generateKey() is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 return Status(blink::WebCryptoErrorTypeData, 245 return Status(blink::WebCryptoErrorTypeData,
246 "Invalid key length: it is either zero or not a multiple of 8 " 246 "Invalid key length: it is either zero or not a multiple of 8 "
247 "bits"); 247 "bits");
248 } 248 }
249 249
250 Status Status::ErrorCreateKeyBadUsages() { 250 Status Status::ErrorCreateKeyBadUsages() {
251 return Status(blink::WebCryptoErrorTypeSyntax, 251 return Status(blink::WebCryptoErrorTypeSyntax,
252 "Cannot create a key using the specified key usages."); 252 "Cannot create a key using the specified key usages.");
253 } 253 }
254 254
255 Status Status::ErrorCreateKeyEmptyUsages() {
256 return Status(blink::WebCryptoErrorTypeSyntax,
257 "Usages cannot be empty when creating a key.");
258 }
259
255 Status Status::ErrorImportedEcKeyIncorrectCurve() { 260 Status Status::ErrorImportedEcKeyIncorrectCurve() {
256 return Status( 261 return Status(
257 blink::WebCryptoErrorTypeData, 262 blink::WebCryptoErrorTypeData,
258 "The imported EC key specifies a different curve than requested"); 263 "The imported EC key specifies a different curve than requested");
259 } 264 }
260 265
261 Status Status::ErrorJwkIncorrectCrv() { 266 Status Status::ErrorJwkIncorrectCrv() {
262 return Status( 267 return Status(
263 blink::WebCryptoErrorTypeData, 268 blink::WebCryptoErrorTypeData,
264 "The JWK's \"crv\" member specifies a different curve than requested"); 269 "The JWK's \"crv\" member specifies a different curve than requested");
(...skipping 21 matching lines...) Expand all
286 error_type_(error_type), 291 error_type_(error_type),
287 error_details_(error_details_utf8) { 292 error_details_(error_details_utf8) {
288 } 293 }
289 294
290 Status::Status(Type type) : type_(type) { 295 Status::Status(Type type) : type_(type) {
291 } 296 }
292 297
293 } // namespace webcrypto 298 } // namespace webcrypto
294 299
295 } // namespace content 300 } // 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