| 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 #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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // The public key's algorithm was not ECDH. | 246 // The public key's algorithm was not ECDH. |
| 247 static Status ErrorEcdhPublicKeyWrongAlgorithm(); | 247 static Status ErrorEcdhPublicKeyWrongAlgorithm(); |
| 248 | 248 |
| 249 // The public and private keys given to ECDH key derivation were not for the | 249 // The public and private keys given to ECDH key derivation were not for the |
| 250 // same named curve. | 250 // same named curve. |
| 251 static Status ErrorEcdhCurveMismatch(); | 251 static Status ErrorEcdhCurveMismatch(); |
| 252 | 252 |
| 253 // The requested bit length for ECDH key derivation was too large. | 253 // The requested bit length for ECDH key derivation was too large. |
| 254 static Status ErrorEcdhLengthTooBig(unsigned int max_length_bits); | 254 static Status ErrorEcdhLengthTooBig(unsigned int max_length_bits); |
| 255 | 255 |
| 256 // The requested length for HKDF was too large. |
| 257 static Status ErrorHkdfLengthTooLong(); |
| 258 |
| 256 private: | 259 private: |
| 257 enum Type { TYPE_ERROR, TYPE_SUCCESS }; | 260 enum Type { TYPE_ERROR, TYPE_SUCCESS }; |
| 258 | 261 |
| 259 // Constructs an error with the specified error type and message. | 262 // Constructs an error with the specified error type and message. |
| 260 Status(blink::WebCryptoErrorType error_type, | 263 Status(blink::WebCryptoErrorType error_type, |
| 261 const std::string& error_details_utf8); | 264 const std::string& error_details_utf8); |
| 262 | 265 |
| 263 // Constructs a success or error without any details. | 266 // Constructs a success or error without any details. |
| 264 explicit Status(Type type); | 267 explicit Status(Type type); |
| 265 | 268 |
| 266 Type type_; | 269 Type type_; |
| 267 blink::WebCryptoErrorType error_type_; | 270 blink::WebCryptoErrorType error_type_; |
| 268 std::string error_details_; | 271 std::string error_details_; |
| 269 }; | 272 }; |
| 270 | 273 |
| 271 } // namespace webcrypto | 274 } // namespace webcrypto |
| 272 | 275 |
| 273 } // namespace content | 276 } // namespace content |
| 274 | 277 |
| 275 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ | 278 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ |
| OLD | NEW |