summaryrefslogtreecommitdiff
path: root/cmd/strsclnt
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2017-08-23 15:46:08 +0200
committerDaiki Ueno <dueno@redhat.com>2017-08-23 15:46:08 +0200
commit49162cb660c3aead00be4ca024aa88fe0bad1889 (patch)
tree421dcdf1e1ad451f086ffc9f821554ff50e32b41 /cmd/strsclnt
parent871effa533301c062028df3b595c2f62e53469ea (diff)
downloadnss-hg-49162cb660c3aead00be4ca024aa88fe0bad1889.tar.gz
Bug 1320708, strsclnt: Avoid infloop if DB is created without password, r=kaie
Diffstat (limited to 'cmd/strsclnt')
-rw-r--r--cmd/strsclnt/strsclnt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/strsclnt/strsclnt.c b/cmd/strsclnt/strsclnt.c
index f65e31913..7d259bd0a 100644
--- a/cmd/strsclnt/strsclnt.c
+++ b/cmd/strsclnt/strsclnt.c
@@ -886,8 +886,10 @@ PRBool
LoggedIn(CERTCertificate *cert, SECKEYPrivateKey *key)
{
if ((cert->slot) && (key->pkcs11Slot) &&
- (PR_TRUE == PK11_IsLoggedIn(cert->slot, NULL)) &&
- (PR_TRUE == PK11_IsLoggedIn(key->pkcs11Slot, NULL))) {
+ (!PK11_NeedLogin(cert->slot) ||
+ PR_TRUE == PK11_IsLoggedIn(cert->slot, NULL)) &&
+ (!PK11_NeedLogin(key->pkcs11Slot) ||
+ PR_TRUE == PK11_IsLoggedIn(key->pkcs11Slot, NULL))) {
return PR_TRUE;
}