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

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

Issue 282133002: [webcryto] Validate key usages during key creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on master Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/webcrypto_impl.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 namespace content { 7 namespace content {
8 8
9 namespace webcrypto { 9 namespace webcrypto {
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return Status(blink::WebCryptoErrorTypeInvalidAccess, 191 return Status(blink::WebCryptoErrorTypeInvalidAccess,
192 "They key is not extractable"); 192 "They key is not extractable");
193 } 193 }
194 194
195 Status Status::ErrorGenerateKeyLength() { 195 Status Status::ErrorGenerateKeyLength() {
196 return Status(blink::WebCryptoErrorTypeData, 196 return Status(blink::WebCryptoErrorTypeData,
197 "Invalid key length: it is either zero or not a multiple of 8 " 197 "Invalid key length: it is either zero or not a multiple of 8 "
198 "bits"); 198 "bits");
199 } 199 }
200 200
201 Status Status::ErrorCreateKeyBadUsages() {
202 return Status(blink::WebCryptoErrorTypeData,
203 "Cannot create a key using the specified key usages.");
204 }
205
201 Status::Status(blink::WebCryptoErrorType error_type, 206 Status::Status(blink::WebCryptoErrorType error_type,
202 const std::string& error_details_utf8) 207 const std::string& error_details_utf8)
203 : type_(TYPE_ERROR), 208 : type_(TYPE_ERROR),
204 error_type_(error_type), 209 error_type_(error_type),
205 error_details_(error_details_utf8) { 210 error_details_(error_details_utf8) {
206 } 211 }
207 212
208 Status::Status(Type type) : type_(type) { 213 Status::Status(Type type) : type_(type) {
209 } 214 }
210 215
211 } // namespace webcrypto 216 } // namespace webcrypto
212 217
213 } // namespace content 218 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/webcrypto_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698