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

Side by Side Diff: components/webcrypto/status.h

Issue 2289033002: Require extractable=false for KDF import (Closed)
Patch Set: update another test Created 4 years, 3 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
« no previous file with comments | « components/webcrypto/algorithms/pbkdf2.cc ('k') | components/webcrypto/status.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 #ifndef COMPONENTS_WEBCRYPTO_STATUS_H_ 5 #ifndef COMPONENTS_WEBCRYPTO_STATUS_H_
6 #define COMPONENTS_WEBCRYPTO_STATUS_H_ 6 #define COMPONENTS_WEBCRYPTO_STATUS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 // No length parameter was provided for PBKDF2's Derive Bits operation. 267 // No length parameter was provided for PBKDF2's Derive Bits operation.
268 static Status ErrorPbkdf2DeriveBitsLengthNotSpecified(); 268 static Status ErrorPbkdf2DeriveBitsLengthNotSpecified();
269 269
270 // PBKDF2's deriveBits() was called with an unsupported length of 0. 270 // PBKDF2's deriveBits() was called with an unsupported length of 0.
271 static Status ErrorPbkdf2DeriveBitsLengthZero(); 271 static Status ErrorPbkdf2DeriveBitsLengthZero();
272 272
273 // PBKDF2 was called with iterations == 0. 273 // PBKDF2 was called with iterations == 0.
274 static Status ErrorPbkdf2Iterations0(); 274 static Status ErrorPbkdf2Iterations0();
275 275
276 // Tried importing a key with extractable=true for one of the *KDF
277 // algorithms.
278 static Status ErrorImportExtractableKdfKey();
279
276 private: 280 private:
277 enum Type { TYPE_ERROR, TYPE_SUCCESS }; 281 enum Type { TYPE_ERROR, TYPE_SUCCESS };
278 282
279 // Constructs an error with the specified error type and message. 283 // Constructs an error with the specified error type and message.
280 Status(blink::WebCryptoErrorType error_type, 284 Status(blink::WebCryptoErrorType error_type,
281 const std::string& error_details_utf8); 285 const std::string& error_details_utf8);
282 286
283 // Constructs a success or error without any details. 287 // Constructs a success or error without any details.
284 explicit Status(Type type); 288 explicit Status(Type type);
285 289
286 Type type_; 290 Type type_;
287 blink::WebCryptoErrorType error_type_; 291 blink::WebCryptoErrorType error_type_;
288 std::string error_details_; 292 std::string error_details_;
289 }; 293 };
290 294
291 } // namespace webcrypto 295 } // namespace webcrypto
292 296
293 #endif // COMPONENTS_WEBCRYPTO_STATUS_H_ 297 #endif // COMPONENTS_WEBCRYPTO_STATUS_H_
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/pbkdf2.cc ('k') | components/webcrypto/status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698