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 #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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return Status(blink::WebCryptoErrorTypeOperation, | 145 return Status(blink::WebCryptoErrorTypeOperation, |
146 "AES key length must be 128 or 256 bits"); | 146 "AES key length must be 128 or 256 bits"); |
147 } | 147 } |
148 | 148 |
149 Status Status::ErrorGenerateAesKeyLength() { | 149 Status Status::ErrorGenerateAesKeyLength() { |
150 return Status(blink::WebCryptoErrorTypeOperation, | 150 return Status(blink::WebCryptoErrorTypeOperation, |
151 "AES key length must be 128 or 256 bits"); | 151 "AES key length must be 128 or 256 bits"); |
152 } | 152 } |
153 | 153 |
154 Status Status::ErrorAes192BitUnsupported() { | 154 Status Status::ErrorAes192BitUnsupported() { |
155 return Status(blink::WebCryptoErrorTypeNotSupported, | 155 return Status(blink::WebCryptoErrorTypeOperation, |
156 "192-bit AES keys are not supported"); | 156 "192-bit AES keys are not supported"); |
157 } | 157 } |
158 | 158 |
159 Status Status::ErrorUnexpectedKeyType() { | 159 Status Status::ErrorUnexpectedKeyType() { |
160 return Status(blink::WebCryptoErrorTypeInvalidAccess, | 160 return Status(blink::WebCryptoErrorTypeInvalidAccess, |
161 "The key is not of the expected type"); | 161 "The key is not of the expected type"); |
162 } | 162 } |
163 | 163 |
164 Status Status::ErrorIncorrectSizeAesCbcIv() { | 164 Status Status::ErrorIncorrectSizeAesCbcIv() { |
165 return Status(blink::WebCryptoErrorTypeOperation, | 165 return Status(blink::WebCryptoErrorTypeOperation, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 Status Status::ErrorGenerateKeyPublicExponent() { | 220 Status Status::ErrorGenerateKeyPublicExponent() { |
221 return Status(blink::WebCryptoErrorTypeData, | 221 return Status(blink::WebCryptoErrorTypeData, |
222 "The \"publicExponent\" must be either 3 or 65537"); | 222 "The \"publicExponent\" must be either 3 or 65537"); |
223 } | 223 } |
224 | 224 |
225 Status Status::ErrorImportRsaEmptyModulus() { | 225 Status Status::ErrorImportRsaEmptyModulus() { |
226 return Status(blink::WebCryptoErrorTypeData, "The modulus is empty"); | 226 return Status(blink::WebCryptoErrorTypeData, "The modulus is empty"); |
227 } | 227 } |
228 | 228 |
229 Status Status::ErrorGenerateRsaUnsupportedModulus() { | 229 Status Status::ErrorGenerateRsaUnsupportedModulus() { |
230 return Status(blink::WebCryptoErrorTypeNotSupported, | 230 return Status(blink::WebCryptoErrorTypeOperation, |
231 "The modulus length must be a multiple of 8 bits and >= 256 " | 231 "The modulus length must be a multiple of 8 bits and >= 256 " |
232 "and <= 16384"); | 232 "and <= 16384"); |
233 } | 233 } |
234 | 234 |
235 Status Status::ErrorImportRsaEmptyExponent() { | 235 Status Status::ErrorImportRsaEmptyExponent() { |
236 return Status(blink::WebCryptoErrorTypeData, | 236 return Status(blink::WebCryptoErrorTypeData, |
237 "No bytes for the exponent were provided"); | 237 "No bytes for the exponent were provided"); |
238 } | 238 } |
239 | 239 |
240 Status Status::ErrorKeyNotExtractable() { | 240 Status Status::ErrorKeyNotExtractable() { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 error_type_(error_type), | 329 error_type_(error_type), |
330 error_details_(error_details_utf8) { | 330 error_details_(error_details_utf8) { |
331 } | 331 } |
332 | 332 |
333 Status::Status(Type type) : type_(type) { | 333 Status::Status(Type type) : type_(type) { |
334 } | 334 } |
335 | 335 |
336 } // namespace webcrypto | 336 } // namespace webcrypto |
337 | 337 |
338 } // namespace content | 338 } // namespace content |
OLD | NEW |