open a session if there is none.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2428 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2005-07-18 09:15:06 +00:00
parent 817e26a362
commit ada4504daf
1 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ int PKCS11_seed_random(PKCS11_SLOT *slot, const unsigned char *s,
PKCS11_CTX *ctx = priv->parent;
int rv;
if (!priv->haveSession) {
if (!priv->haveSession && PKCS11_open_session(slot, 0)) {
PKCS11err(PKCS11_F_PKCS11_SEED_RANDOM, PKCS11_NO_SESSION);
return -1;
}
@ -282,7 +282,7 @@ int PKCS11_generate_random(PKCS11_SLOT *slot, unsigned char *r,
PKCS11_CTX *ctx = priv->parent;
int rv;
if (!priv->haveSession) {
if (!priv->haveSession && PKCS11_open_session(slot, 0)) {
PKCS11err(PKCS11_F_PKCS11_GENERATE_RANDOM, PKCS11_NO_SESSION);
return -1;
}