OLD | NEW |
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 "components/webcrypto/status.h" | 5 #include "components/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 webcrypto { | 10 namespace webcrypto { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return Status( | 355 return Status( |
356 blink::WebCryptoErrorTypeOperation, | 356 blink::WebCryptoErrorTypeOperation, |
357 "A length of 0 was specified for PBKDF2's Derive Bits operation."); | 357 "A length of 0 was specified for PBKDF2's Derive Bits operation."); |
358 } | 358 } |
359 | 359 |
360 Status Status::ErrorPbkdf2Iterations0() { | 360 Status Status::ErrorPbkdf2Iterations0() { |
361 return Status(blink::WebCryptoErrorTypeOperation, | 361 return Status(blink::WebCryptoErrorTypeOperation, |
362 "PBKDF2 requires iterations > 0"); | 362 "PBKDF2 requires iterations > 0"); |
363 } | 363 } |
364 | 364 |
| 365 Status Status::ErrorImportExtractableKdfKey() { |
| 366 return Status(blink::WebCryptoErrorTypeSyntax, |
| 367 "KDF keys must set extractable=false"); |
| 368 } |
| 369 |
365 Status::Status(blink::WebCryptoErrorType error_type, | 370 Status::Status(blink::WebCryptoErrorType error_type, |
366 const std::string& error_details_utf8) | 371 const std::string& error_details_utf8) |
367 : type_(TYPE_ERROR), | 372 : type_(TYPE_ERROR), |
368 error_type_(error_type), | 373 error_type_(error_type), |
369 error_details_(error_details_utf8) { | 374 error_details_(error_details_utf8) { |
370 } | 375 } |
371 | 376 |
372 Status::Status(Type type) : type_(type) { | 377 Status::Status(Type type) : type_(type) { |
373 } | 378 } |
374 | 379 |
375 } // namespace webcrypto | 380 } // namespace webcrypto |
OLD | NEW |