Commit 8f7da7fc authored by rsleevi@chromium.org's avatar rsleevi@chromium.org

On NSS, treat non-permanent RSA private keys as ephemeral

When generating/using a crypto::RSAPrivateKey with NSS,
prefer the internal software slot over other modules (such as
any TPMs [ChromeOS] or smart cards [Linux]) if the key being
generated is not marked as a permanent key.

BUG=none
R=wtc

Review URL: https://chromiumcodereview.appspot.com/17447009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207853 0039d316-1c4b-4281-b951-d872f2087c98
parent 5bbabede
......@@ -206,7 +206,8 @@ RSAPrivateKey* RSAPrivateKey::CreateWithParams(uint16 num_bits,
scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
ScopedPK11Slot slot(GetPrivateNSSKeySlot());
ScopedPK11Slot slot(permanent ? GetPrivateNSSKeySlot() :
PK11_GetInternalSlot());
if (!slot.get())
return NULL;
......@@ -236,7 +237,8 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfoWithParams(
scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
ScopedPK11Slot slot(GetPrivateNSSKeySlot());
ScopedPK11Slot slot(permanent ? GetPrivateNSSKeySlot() :
PK11_GetInternalSlot());
if (!slot.get())
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment