| Index: chrome/browser/chromeos/platform_keys/platform_keys_nss.cc
|
| diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc b/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc
|
| index 5493e181674be925363dc23b78c39d098cc63d9a..da6a7f1c0ebf651747b70aa56664dc2c5b121be4 100644
|
| --- a/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc
|
| +++ b/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc
|
| @@ -126,6 +126,7 @@ void GetCertDatabase(const std::string& token_id,
|
| class GenerateRSAKeyState : public NSSOperationState {
|
| public:
|
| GenerateRSAKeyState(unsigned int modulus_length,
|
| + unsigned long public_exponent,
|
| const GenerateKeyCallback& callback);
|
| virtual ~GenerateRSAKeyState() {}
|
|
|
| @@ -141,7 +142,8 @@ class GenerateRSAKeyState : public NSSOperationState {
|
| from, base::Bind(callback_, public_key_spki_der, error_message));
|
| }
|
|
|
| - unsigned int modulus_length_;
|
| + const unsigned int modulus_length_;
|
| + const long public_exponent_;
|
|
|
| private:
|
| // Must be called on origin thread, use CallBack() therefore.
|
| @@ -167,8 +169,8 @@ class SignState : public NSSOperationState {
|
| from, base::Bind(callback_, signature, error_message));
|
| }
|
|
|
| - std::string public_key_;
|
| - std::string data_;
|
| + const std::string public_key_;
|
| + const std::string data_;
|
|
|
| private:
|
| // Must be called on origin thread, use CallBack() therefore.
|
| @@ -252,8 +254,11 @@ NSSOperationState::NSSOperationState()
|
| }
|
|
|
| GenerateRSAKeyState::GenerateRSAKeyState(unsigned int modulus_length,
|
| + unsigned long public_exponent,
|
| const GenerateKeyCallback& callback)
|
| - : modulus_length_(modulus_length), callback_(callback) {
|
| + : modulus_length_(modulus_length),
|
| + public_exponent_(public_exponent),
|
| + callback_(callback) {
|
| }
|
|
|
| SignState::SignState(const std::string& public_key,
|
| @@ -283,8 +288,8 @@ RemoveCertificateState::RemoveCertificateState(
|
| // GenerateRSAKeyWithDB().
|
| void GenerateRSAKeyOnWorkerThread(scoped_ptr<GenerateRSAKeyState> state) {
|
| scoped_ptr<crypto::RSAPrivateKey> rsa_key(
|
| - crypto::RSAPrivateKey::CreateSensitive(state->slot_.get(),
|
| - state->modulus_length_));
|
| + crypto::RSAPrivateKey::CreateSensitive(
|
| + state->slot_.get(), state->modulus_length_, state->public_exponent_));
|
| if (!rsa_key) {
|
| LOG(ERROR) << "Couldn't create key.";
|
| state->OnError(FROM_HERE, kErrorInternal);
|
| @@ -470,11 +475,12 @@ void RemoveCertificateWithDB(scoped_ptr<RemoveCertificateState> state,
|
|
|
| void GenerateRSAKey(const std::string& token_id,
|
| unsigned int modulus_length,
|
| + unsigned long public_exponent,
|
| const GenerateKeyCallback& callback,
|
| Profile* profile) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| scoped_ptr<GenerateRSAKeyState> state(
|
| - new GenerateRSAKeyState(modulus_length, callback));
|
| + new GenerateRSAKeyState(modulus_length, public_exponent, callback));
|
|
|
| if (modulus_length > kMaxRSAModulusLength) {
|
| state->OnError(FROM_HERE, kErrorAlgorithmNotSupported);
|
|
|