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

Side by Side Diff: content/child/webcrypto/platform_crypto.h

Issue 329673002: [webcrypto] Restrict public exponent for RSA key generation to 3 or 65537. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 #ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_
6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // * public_exponent, modulus_length_bits and hash_or_null are the same as what 170 // * public_exponent, modulus_length_bits and hash_or_null are the same as what
171 // is in algorithm. They are split out for convenience. 171 // is in algorithm. They are split out for convenience.
172 // * modulus_length_bits is not 0 172 // * modulus_length_bits is not 0
173 // * public_exponent is not empty. 173 // * public_exponent is not empty.
174 // * {public|private}_key_usage_mask make sense for the algorithm. 174 // * {public|private}_key_usage_mask make sense for the algorithm.
175 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm, 175 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm,
176 bool extractable, 176 bool extractable,
177 blink::WebCryptoKeyUsageMask public_key_usage_mask, 177 blink::WebCryptoKeyUsageMask public_key_usage_mask,
178 blink::WebCryptoKeyUsageMask private_key_usage_mask, 178 blink::WebCryptoKeyUsageMask private_key_usage_mask,
179 unsigned int modulus_length_bits, 179 unsigned int modulus_length_bits,
180 const CryptoData& public_exponent, 180 unsigned long public_exponent,
181 blink::WebCryptoKey* public_key, 181 blink::WebCryptoKey* public_key,
182 blink::WebCryptoKey* private_key); 182 blink::WebCryptoKey* private_key);
183 183
184 // Preconditions: 184 // Preconditions:
185 // * |key| is non-null. 185 // * |key| is non-null.
186 // * |algorithm.id()| is for a symmetric key algorithm. 186 // * |algorithm.id()| is for a symmetric key algorithm.
187 // * For AES algorithms |key_data| is either 16, 24, or 32 bytes long. 187 // * For AES algorithms |key_data| is either 16, 24, or 32 bytes long.
188 // * usage_mask makes sense for the algorithm. 188 // * usage_mask makes sense for the algorithm.
189 // Note that this may be called from target Blink thread. 189 // Note that this may be called from target Blink thread.
190 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm, 190 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 const CryptoData& data, 307 const CryptoData& data,
308 std::vector<uint8>* buffer); 308 std::vector<uint8>* buffer);
309 309
310 } // namespace platform 310 } // namespace platform
311 311
312 } // namespace webcrypto 312 } // namespace webcrypto
313 313
314 } // namespace content 314 } // namespace content
315 315
316 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ 316 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/webcrypto/platform_crypto_nss.cc » ('j') | content/child/webcrypto/shared_crypto.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698