| 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_WEBCRYPTO_UTIL_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // The input data given to an AES-KW encrypt/decrypt operation was not a | 157 // The input data given to an AES-KW encrypt/decrypt operation was not a |
| 158 // multiple of 8 bytes, as required by RFC 3394. | 158 // multiple of 8 bytes, as required by RFC 3394. |
| 159 static Status ErrorInvalidAesKwDataLength(); | 159 static Status ErrorInvalidAesKwDataLength(); |
| 160 | 160 |
| 161 // The "publicExponent" used to generate a key was invalid: either no bytes | 161 // The "publicExponent" used to generate a key was invalid: either no bytes |
| 162 // were specified, or the number was too large to fit into an "unsigned long" | 162 // were specified, or the number was too large to fit into an "unsigned long" |
| 163 // (implemention limitation), or the exponent was zero. | 163 // (implemention limitation), or the exponent was zero. |
| 164 static Status ErrorGenerateKeyPublicExponent(); | 164 static Status ErrorGenerateKeyPublicExponent(); |
| 165 | 165 |
| 166 // The algorithm was null when importing a raw-formatted key. In this case it | |
| 167 // is required. | |
| 168 static Status ErrorMissingAlgorithmImportRawKey(); | |
| 169 | |
| 170 // The algorithm was null when unwrapping a raw-formatted key. In this case it | |
| 171 // is required. | |
| 172 static Status ErrorMissingAlgorithmUnwrapRawKey(); | |
| 173 | |
| 174 // The modulus bytes were empty when importing an RSA public key. | 166 // The modulus bytes were empty when importing an RSA public key. |
| 175 static Status ErrorImportRsaEmptyModulus(); | 167 static Status ErrorImportRsaEmptyModulus(); |
| 176 | 168 |
| 177 // The the modulus length was zero bits when generating an RSA public key. | 169 // The the modulus length was zero bits when generating an RSA public key. |
| 178 static Status ErrorGenerateRsaZeroModulus(); | 170 static Status ErrorGenerateRsaZeroModulus(); |
| 179 | 171 |
| 180 // The exponent bytes were empty when importing an RSA public key. | 172 // The exponent bytes were empty when importing an RSA public key. |
| 181 static Status ErrorImportRsaEmptyExponent(); | 173 static Status ErrorImportRsaEmptyExponent(); |
| 182 | 174 |
| 183 // An unextractable key was used by an operation which exports the key data. | 175 // An unextractable key was used by an operation which exports the key data. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 245 |
| 254 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, | 246 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, |
| 255 unsigned keylen_bytes, | 247 unsigned keylen_bytes, |
| 256 blink::WebCryptoKeyAlgorithm* key_algorithm); | 248 blink::WebCryptoKeyAlgorithm* key_algorithm); |
| 257 | 249 |
| 258 } // namespace webcrypto | 250 } // namespace webcrypto |
| 259 | 251 |
| 260 } // namespace content | 252 } // namespace content |
| 261 | 253 |
| 262 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 254 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| OLD | NEW |