diff --git a/mozilla/security/nss/lib/softoken/legacydb/lgcreate.c b/mozilla/security/nss/lib/softoken/legacydb/lgcreate.c
--- a/mozilla/security/nss/lib/softoken/legacydb/lgcreate.c
+++ b/mozilla/security/nss/lib/softoken/legacydb/lgcreate.c
@@ -811,21 +811,26 @@ static NSSLOWKEYPrivateKey *lg_mkSecretK
      *   private exponent - CKA_VALUE (the key itself)
      *   coefficient - CKA_KEY_TYPE, which indicates what encryption algorithm
      *      is used for the key.
      *   all others - set to integer 0
      */
     privKey->keyType = NSSLOWKEYRSAKey;
 
     /* The modulus is set to the key id of the symmetric key */
-    crv = lg_Attribute2SecItem(arena, CKA_ID, templ, count, 
-				&privKey->u.rsa.modulus);
-    if (crv != CKR_OK) goto loser;
+    privKey->u.rsa.modulus.data =
+		(unsigned char *) PORT_ArenaAlloc(arena, pubkey->len);
+    if (privKey->u.rsa.modulus.data == NULL) {
+	crv = CKR_HOST_MEMORY;
+	goto loser;
+    }
+    privKey->u.rsa.modulus.len = pubkey->len;
+    PORT_Memcpy(privKey->u.rsa.modulus.data, pubkey->data, pubkey->len);
 
-    /* The public exponent is set to 0 length to indicate a special key */
+    /* The public exponent is set to 0 to indicate a special key */
     privKey->u.rsa.publicExponent.len = sizeof derZero;
     privKey->u.rsa.publicExponent.data = derZero;
 
     /* The private exponent is the actual key value */
     crv = lg_PrivAttr2SecItem(arena, CKA_VALUE, templ, count,
 				&privKey->u.rsa.privateExponent, sdbpw);
     if (crv != CKR_OK) goto loser;
 
