drop extra wrapping of p11_init
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16466 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -168,7 +168,8 @@ p11_rsa_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = P11FUNC(p11rsa->p, Decrypt,
|
ret = P11FUNC(p11rsa->p, Decrypt,
|
||||||
(P11SESSION(p11rsa->slot), (CK_BYTE *)from, flen, to, &ck_sigsize));
|
(P11SESSION(p11rsa->slot), (CK_BYTE *)from,
|
||||||
|
flen, to, &ck_sigsize));
|
||||||
if (ret != CKR_OK)
|
if (ret != CKR_OK)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -565,13 +566,14 @@ out:
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
p11_init_module(const char *fn, hx509_lock lock, struct p11_module **module)
|
p11_init(hx509_certs certs, void **data, int flags,
|
||||||
|
const char *residue, hx509_lock lock)
|
||||||
{
|
{
|
||||||
CK_C_GetFunctionList getFuncs;
|
CK_C_GetFunctionList getFuncs;
|
||||||
struct p11_module *p;
|
struct p11_module *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
*module = NULL;
|
*data = NULL;
|
||||||
|
|
||||||
p = calloc(1, sizeof(*p));
|
p = calloc(1, sizeof(*p));
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
@@ -579,7 +581,7 @@ p11_init_module(const char *fn, hx509_lock lock, struct p11_module **module)
|
|||||||
|
|
||||||
p->selected_slot = 0;
|
p->selected_slot = 0;
|
||||||
|
|
||||||
p->dl_handle = dlopen(fn, RTLD_NOW);
|
p->dl_handle = dlopen(residue, RTLD_NOW);
|
||||||
if (p->dl_handle == NULL) {
|
if (p->dl_handle == NULL) {
|
||||||
ret = EINVAL; /* XXX */
|
ret = EINVAL; /* XXX */
|
||||||
goto out;
|
goto out;
|
||||||
@@ -640,7 +642,7 @@ p11_init_module(const char *fn, hx509_lock lock, struct p11_module **module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
p->refcount += 1;
|
p->refcount += 1;
|
||||||
*module = p;
|
*data = p;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
out:
|
out:
|
||||||
@@ -650,21 +652,6 @@ p11_init_module(const char *fn, hx509_lock lock, struct p11_module **module)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
p11_init(hx509_certs certs, void **data, int flags,
|
|
||||||
const char *residue, hx509_lock lock)
|
|
||||||
{
|
|
||||||
struct p11_module *p;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = p11_init_module(residue, lock, &p);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
*data = p;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
p11_release_module(struct p11_module *p)
|
p11_release_module(struct p11_module *p)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user