| 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 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 namespace webcrypto { | 9 namespace webcrypto { |
| 10 | 10 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 Status Status::ErrorGenerateKeyPublicExponent() { | 184 Status Status::ErrorGenerateKeyPublicExponent() { |
| 185 return Status(blink::WebCryptoErrorTypeData, | 185 return Status(blink::WebCryptoErrorTypeData, |
| 186 "The \"publicExponent\" must be either 3 or 65537"); | 186 "The \"publicExponent\" must be either 3 or 65537"); |
| 187 } | 187 } |
| 188 | 188 |
| 189 Status Status::ErrorImportRsaEmptyModulus() { | 189 Status Status::ErrorImportRsaEmptyModulus() { |
| 190 return Status(blink::WebCryptoErrorTypeData, "The modulus is empty"); | 190 return Status(blink::WebCryptoErrorTypeData, "The modulus is empty"); |
| 191 } | 191 } |
| 192 | 192 |
| 193 Status Status::ErrorGenerateRsaZeroModulus() { | 193 Status Status::ErrorGenerateRsaUnsupportedModulus() { |
| 194 return Status(blink::WebCryptoErrorTypeData, | 194 return Status(blink::WebCryptoErrorTypeNotSupported, |
| 195 "The modulus bit length cannot be zero"); | 195 "The modulus length must be a multiple of 8 bits and >= 256 " |
| 196 "and <= 16384"); |
| 196 } | 197 } |
| 197 | 198 |
| 198 Status Status::ErrorImportRsaEmptyExponent() { | 199 Status Status::ErrorImportRsaEmptyExponent() { |
| 199 return Status(blink::WebCryptoErrorTypeData, | 200 return Status(blink::WebCryptoErrorTypeData, |
| 200 "No bytes for the exponent were provided"); | 201 "No bytes for the exponent were provided"); |
| 201 } | 202 } |
| 202 | 203 |
| 203 Status Status::ErrorKeyNotExtractable() { | 204 Status Status::ErrorKeyNotExtractable() { |
| 204 return Status(blink::WebCryptoErrorTypeInvalidAccess, | 205 return Status(blink::WebCryptoErrorTypeInvalidAccess, |
| 205 "They key is not extractable"); | 206 "They key is not extractable"); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 222 error_type_(error_type), | 223 error_type_(error_type), |
| 223 error_details_(error_details_utf8) { | 224 error_details_(error_details_utf8) { |
| 224 } | 225 } |
| 225 | 226 |
| 226 Status::Status(Type type) : type_(type) { | 227 Status::Status(Type type) : type_(type) { |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace webcrypto | 230 } // namespace webcrypto |
| 230 | 231 |
| 231 } // namespace content | 232 } // namespace content |
| OLD | NEW |