Fix 118679: PK11SDR_Encrypt fails if not logged into token.

This commit is contained in:
nicolson%netscape.com 2002-01-24 01:06:22 +00:00
Родитель 889a5c001f
Коммит 56bb80f8db
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -166,6 +166,13 @@ PK11SDR_Encrypt(SECItem *keyid, SECItem *data, SECItem *result, void *cx)
/* Use triple-DES */
type = CKM_DES3_CBC;
/*
* Login to the internal token before we look for the key, otherwise we
* won't find it.
*/
rv = PK11_Authenticate(slot, PR_TRUE, cx);
if (rv != SECSuccess) goto loser;
/* Find the key to use */
pKeyID = keyid;
if (pKeyID->len == 0) {