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 "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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 blink::WebCryptoErrorTypeOperation, | 346 blink::WebCryptoErrorTypeOperation, |
347 "Length for PBKDF2 key derivation must be a multiple of 8 bits."); | 347 "Length for PBKDF2 key derivation must be a multiple of 8 bits."); |
348 } | 348 } |
349 | 349 |
350 Status Status::ErrorPbkdf2DeriveBitsLengthNotSpecified() { | 350 Status Status::ErrorPbkdf2DeriveBitsLengthNotSpecified() { |
351 return Status( | 351 return Status( |
352 blink::WebCryptoErrorTypeOperation, | 352 blink::WebCryptoErrorTypeOperation, |
353 "No length was specified for the PBKDF2 Derive Bits operation."); | 353 "No length was specified for the PBKDF2 Derive Bits operation."); |
354 } | 354 } |
355 | 355 |
356 Status Status::ErrorPbkdf2EmptyPassword() { | |
357 return Status(blink::WebCryptoErrorTypeOperation, | |
358 "The password for PBKDF2 must not be empty."); | |
359 } | |
360 | |
361 Status::Status(blink::WebCryptoErrorType error_type, | 356 Status::Status(blink::WebCryptoErrorType error_type, |
362 const std::string& error_details_utf8) | 357 const std::string& error_details_utf8) |
363 : type_(TYPE_ERROR), | 358 : type_(TYPE_ERROR), |
364 error_type_(error_type), | 359 error_type_(error_type), |
365 error_details_(error_details_utf8) { | 360 error_details_(error_details_utf8) { |
366 } | 361 } |
367 | 362 |
368 Status::Status(Type type) : type_(type) { | 363 Status::Status(Type type) : type_(type) { |
369 } | 364 } |
370 | 365 |
371 } // namespace webcrypto | 366 } // namespace webcrypto |
372 | 367 |
373 } // namespace content | 368 } // namespace content |
OLD | NEW |