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

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

Issue 803173010: Implement HKDF for webcrypto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 } 316 }
317 317
318 Status Status::ErrorEcdhLengthTooBig(unsigned int max_length_bits) { 318 Status Status::ErrorEcdhLengthTooBig(unsigned int max_length_bits) {
319 return Status(blink::WebCryptoErrorTypeOperation, 319 return Status(blink::WebCryptoErrorTypeOperation,
320 base::StringPrintf( 320 base::StringPrintf(
321 "Length specified for ECDH key derivation is too large. " 321 "Length specified for ECDH key derivation is too large. "
322 "Maximum allowed is %u bits", 322 "Maximum allowed is %u bits",
323 max_length_bits)); 323 max_length_bits));
324 } 324 }
325 325
326 Status Status::ErrorHkdfLengthTooLong() {
327 return Status(blink::WebCryptoErrorTypeOperation,
328 "The length provided for HKDF is too large.");
329 }
330
326 Status::Status(blink::WebCryptoErrorType error_type, 331 Status::Status(blink::WebCryptoErrorType error_type,
327 const std::string& error_details_utf8) 332 const std::string& error_details_utf8)
328 : type_(TYPE_ERROR), 333 : type_(TYPE_ERROR),
329 error_type_(error_type), 334 error_type_(error_type),
330 error_details_(error_details_utf8) { 335 error_details_(error_details_utf8) {
331 } 336 }
332 337
333 Status::Status(Type type) : type_(type) { 338 Status::Status(Type type) : type_(type) {
334 } 339 }
335 340
336 } // namespace webcrypto 341 } // namespace webcrypto
337 342
338 } // namespace content 343 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698