OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/webcrypto/webcrypto_util.h" | 5 #include "content/renderer/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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 } | 108 } |
109 | 109 |
110 Status Status::ErrorIncorrectSizeAesCbcIv() { | 110 Status Status::ErrorIncorrectSizeAesCbcIv() { |
111 return Status("The \"iv\" has an unexpected length -- must be 16 bytes"); | 111 return Status("The \"iv\" has an unexpected length -- must be 16 bytes"); |
112 } | 112 } |
113 | 113 |
114 Status Status::ErrorDataTooLarge() { | 114 Status Status::ErrorDataTooLarge() { |
115 return Status("The provided data is too large"); | 115 return Status("The provided data is too large"); |
116 } | 116 } |
117 | 117 |
118 Status Status::ErrorDataTooSmall() { | |
119 return Status("The provided data is too small"); | |
120 } | |
121 | |
118 Status Status::ErrorUnsupported() { | 122 Status Status::ErrorUnsupported() { |
119 return Status("The requested operation is unsupported"); | 123 return Status("The requested operation is unsupported"); |
120 } | 124 } |
121 | 125 |
122 Status Status::ErrorUnexpected() { | 126 Status Status::ErrorUnexpected() { |
123 return Status("Something unexpected happened..."); | 127 return Status("Something unexpected happened..."); |
124 } | 128 } |
125 | 129 |
126 Status Status::ErrorInvalidAesGcmTagLength() { | 130 Status Status::ErrorInvalidAesGcmTagLength() { |
127 return Status("The tag length is invalid: either too large or not a multiple " | 131 return Status("The tag length is invalid: either too large or not a multiple " |
128 "of 8 bits"); | 132 "of 8 bits"); |
129 } | 133 } |
130 | 134 |
135 Status Status::ErrorInvalidAesKwDataLength() { | |
136 return Status("The data length is invalid: not a multiple of 8 bytes"); | |
eroman
2014/02/26 23:40:22
I suggest adding AES-KW somewhere in there
(The w
padolph
2014/02/28 23:28:40
Done.
| |
137 } | |
138 | |
131 Status Status::ErrorGenerateKeyPublicExponent() { | 139 Status Status::ErrorGenerateKeyPublicExponent() { |
132 return Status("The \"publicExponent\" is either empty, zero, or too large"); | 140 return Status("The \"publicExponent\" is either empty, zero, or too large"); |
133 } | 141 } |
134 | 142 |
135 Status Status::ErrorMissingAlgorithmImportRawKey() { | 143 Status Status::ErrorMissingAlgorithmImportRawKey() { |
136 return Status("The key's algorithm must be specified when importing " | 144 return Status("The key's algorithm must be specified when importing " |
137 "raw-formatted key."); | 145 "raw-formatted key."); |
138 } | 146 } |
139 | 147 |
140 Status Status::ErrorImportRsaEmptyModulus() { | 148 Status Status::ErrorImportRsaEmptyModulus() { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
322 return 128; | 330 return 128; |
323 default: | 331 default: |
324 NOTREACHED(); | 332 NOTREACHED(); |
325 return 0; | 333 return 0; |
326 } | 334 } |
327 } | 335 } |
328 | 336 |
329 } // namespace webcrypto | 337 } // namespace webcrypto |
330 | 338 |
331 } // namespace content | 339 } // namespace content |
OLD | NEW |