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:
parent
817e26a362
commit
ada4504daf
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue