| 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/webcrypto_util.h" | 5 #include "content/child/webcrypto/webcrypto_util.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" | 9 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" |
| 10 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 10 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 Status Status::ErrorInvalidAesKwDataLength() { | 133 Status Status::ErrorInvalidAesKwDataLength() { |
| 134 return Status( | 134 return Status( |
| 135 "The AES-KW input data length is invalid: not a multiple of 8 " | 135 "The AES-KW input data length is invalid: not a multiple of 8 " |
| 136 "bytes"); | 136 "bytes"); |
| 137 } | 137 } |
| 138 | 138 |
| 139 Status Status::ErrorGenerateKeyPublicExponent() { | 139 Status Status::ErrorGenerateKeyPublicExponent() { |
| 140 return Status("The \"publicExponent\" is either empty, zero, or too large"); | 140 return Status("The \"publicExponent\" is either empty, zero, or too large"); |
| 141 } | 141 } |
| 142 | 142 |
| 143 Status Status::ErrorMissingAlgorithmImportRawKey() { | |
| 144 return Status( | |
| 145 "The key's algorithm must be specified when importing " | |
| 146 "raw-formatted key."); | |
| 147 } | |
| 148 | |
| 149 Status Status::ErrorMissingAlgorithmUnwrapRawKey() { | |
| 150 return Status( | |
| 151 "The key's algorithm must be specified when unwrapping a " | |
| 152 "raw-formatted key."); | |
| 153 } | |
| 154 | |
| 155 Status Status::ErrorImportRsaEmptyModulus() { | 143 Status Status::ErrorImportRsaEmptyModulus() { |
| 156 return Status("The modulus is empty"); | 144 return Status("The modulus is empty"); |
| 157 } | 145 } |
| 158 | 146 |
| 159 Status Status::ErrorGenerateRsaZeroModulus() { | 147 Status Status::ErrorGenerateRsaZeroModulus() { |
| 160 return Status("The modulus bit length cannot be zero"); | 148 return Status("The modulus bit length cannot be zero"); |
| 161 } | 149 } |
| 162 | 150 |
| 163 Status Status::ErrorImportRsaEmptyExponent() { | 151 Status Status::ErrorImportRsaEmptyExponent() { |
| 164 return Status("No bytes for the exponent were provided"); | 152 return Status("No bytes for the exponent were provided"); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 new blink::WebCryptoAesKeyAlgorithmParams(keylen_bytes * 8)); | 296 new blink::WebCryptoAesKeyAlgorithmParams(keylen_bytes * 8)); |
| 309 return true; | 297 return true; |
| 310 default: | 298 default: |
| 311 return false; | 299 return false; |
| 312 } | 300 } |
| 313 } | 301 } |
| 314 | 302 |
| 315 } // namespace webcrypto | 303 } // namespace webcrypto |
| 316 | 304 |
| 317 } // namespace content | 305 } // namespace content |
| OLD | NEW |