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

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

Issue 797723006: Implement PBKDF2 (except for generateKey) using BoringSSL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pbkdf2
Patch Set: Rebased Created 5 years, 11 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
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 Status Status::ErrorHkdfDeriveBitsLengthNotSpecified() { 336 Status Status::ErrorHkdfDeriveBitsLengthNotSpecified() {
337 // TODO(nharper): The spec might change so that an OperationError should be 337 // TODO(nharper): The spec might change so that an OperationError should be
338 // thrown here instead of a TypeError. 338 // thrown here instead of a TypeError.
339 // (https://www.w3.org/Bugs/Public/show_bug.cgi?id=27771) 339 // (https://www.w3.org/Bugs/Public/show_bug.cgi?id=27771)
340 return Status(blink::WebCryptoErrorTypeType, 340 return Status(blink::WebCryptoErrorTypeType,
341 "No length was specified for the HKDF Derive Bits operation."); 341 "No length was specified for the HKDF Derive Bits operation.");
342 } 342 }
343 343
344 Status Status::ErrorPbkdf2InvalidLength() {
345 return Status(
346 blink::WebCryptoErrorTypeOperation,
347 "Length for PBKDF2 key derivation must be a multiple of 8 bits.");
348 }
349
350 Status Status::ErrorPbkdf2DeriveBitsLengthNotSpecified() {
351 return Status(
352 blink::WebCryptoErrorTypeOperation,
353 "No length was specified for the PBKDF2 Derive Bits operation.");
354 }
355
344 Status::Status(blink::WebCryptoErrorType error_type, 356 Status::Status(blink::WebCryptoErrorType error_type,
345 const std::string& error_details_utf8) 357 const std::string& error_details_utf8)
346 : type_(TYPE_ERROR), 358 : type_(TYPE_ERROR),
347 error_type_(error_type), 359 error_type_(error_type),
348 error_details_(error_details_utf8) { 360 error_details_(error_details_utf8) {
349 } 361 }
350 362
351 Status::Status(Type type) : type_(type) { 363 Status::Status(Type type) : type_(type) {
352 } 364 }
353 365
354 } // namespace webcrypto 366 } // namespace webcrypto
355 367
356 } // namespace content 368 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698