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

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

Issue 797723006: Implement PBKDF2 (except for generateKey) using BoringSSL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pbkdf2
Patch Set: Cleanup and add serialization methods 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 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_
7 7
8 #include <string> 8 #include <string>
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "third_party/WebKit/public/platform/WebCrypto.h" 10 #include "third_party/WebKit/public/platform/WebCrypto.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // The public key's algorithm was not ECDH. 249 // The public key's algorithm was not ECDH.
250 static Status ErrorEcdhPublicKeyWrongAlgorithm(); 250 static Status ErrorEcdhPublicKeyWrongAlgorithm();
251 251
252 // The public and private keys given to ECDH key derivation were not for the 252 // The public and private keys given to ECDH key derivation were not for the
253 // same named curve. 253 // same named curve.
254 static Status ErrorEcdhCurveMismatch(); 254 static Status ErrorEcdhCurveMismatch();
255 255
256 // The requested bit length for ECDH key derivation was too large. 256 // The requested bit length for ECDH key derivation was too large.
257 static Status ErrorEcdhLengthTooBig(unsigned int max_length_bits); 257 static Status ErrorEcdhLengthTooBig(unsigned int max_length_bits);
258 258
259 // The requested bit length for PBKDF2 key derivation was invalid.
260 static Status ErrorPbkdf2InvalidLength();
261
259 private: 262 private:
260 enum Type { TYPE_ERROR, TYPE_SUCCESS }; 263 enum Type { TYPE_ERROR, TYPE_SUCCESS };
261 264
262 // Constructs an error with the specified error type and message. 265 // Constructs an error with the specified error type and message.
263 Status(blink::WebCryptoErrorType error_type, 266 Status(blink::WebCryptoErrorType error_type,
264 const std::string& error_details_utf8); 267 const std::string& error_details_utf8);
265 268
266 // Constructs a success or error without any details. 269 // Constructs a success or error without any details.
267 explicit Status(Type type); 270 explicit Status(Type type);
268 271
269 Type type_; 272 Type type_;
270 blink::WebCryptoErrorType error_type_; 273 blink::WebCryptoErrorType error_type_;
271 std::string error_details_; 274 std::string error_details_;
272 }; 275 };
273 276
274 } // namespace webcrypto 277 } // namespace webcrypto
275 278
276 } // namespace content 279 } // namespace content
277 280
278 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 281 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698