Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: content/child/webcrypto/status.cc

Issue 401233004: Refactor RSA key generation for WebCrypto's NSS implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::ErrorGenerateRsaZeroModulus() {
194 return Status(blink::WebCryptoErrorTypeData, 194 return Status(blink::WebCryptoErrorTypeData,
195 "The modulus bit length cannot be zero"); 195 "The modulus bit length cannot be zero");
196 } 196 }
197 197
198 Status Status::ErrorGenerateRsaUnsupportedModulus() {
199 return Status(blink::WebCryptoErrorTypeNotSupported,
200 "The modulus length must be a multiple of 8 bits and >= 256 "
201 "and <= 16384");
202 }
203
198 Status Status::ErrorImportRsaEmptyExponent() { 204 Status Status::ErrorImportRsaEmptyExponent() {
199 return Status(blink::WebCryptoErrorTypeData, 205 return Status(blink::WebCryptoErrorTypeData,
200 "No bytes for the exponent were provided"); 206 "No bytes for the exponent were provided");
201 } 207 }
202 208
203 Status Status::ErrorKeyNotExtractable() { 209 Status Status::ErrorKeyNotExtractable() {
204 return Status(blink::WebCryptoErrorTypeInvalidAccess, 210 return Status(blink::WebCryptoErrorTypeInvalidAccess,
205 "They key is not extractable"); 211 "They key is not extractable");
206 } 212 }
207 213
(...skipping 14 matching lines...) Expand all
222 error_type_(error_type), 228 error_type_(error_type),
223 error_details_(error_details_utf8) { 229 error_details_(error_details_utf8) {
224 } 230 }
225 231
226 Status::Status(Type type) : type_(type) { 232 Status::Status(Type type) : type_(type) {
227 } 233 }
228 234
229 } // namespace webcrypto 235 } // namespace webcrypto
230 236
231 } // namespace content 237 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698