(p11_rsa_public_decrypt): since is wrong, don't provide it. PKCS11
can't do public_decrypt, it support verify though. All this doesn't matter, since the code never go though this path. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16516 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -96,40 +96,7 @@ p11_rsa_public_decrypt(int flen,
|
|||||||
RSA *rsa,
|
RSA *rsa,
|
||||||
int padding)
|
int padding)
|
||||||
{
|
{
|
||||||
struct p11_rsa *p11rsa = RSA_get_app_data(rsa);
|
return -1;
|
||||||
CK_OBJECT_HANDLE key = p11rsa->public_key;
|
|
||||||
CK_MECHANISM mechanism;
|
|
||||||
CK_ULONG ck_sigsize;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (key == 0) /* XXX */
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (padding != RSA_PKCS1_PADDING)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
memset(&mechanism, 0, sizeof(mechanism));
|
|
||||||
mechanism.mechanism = CKM_RSA_PKCS;
|
|
||||||
|
|
||||||
ck_sigsize = RSA_size(rsa);
|
|
||||||
|
|
||||||
p11_get_session(p11rsa->p, p11rsa->slot);
|
|
||||||
|
|
||||||
ret = P11FUNC(p11rsa->p, VerifyInit,
|
|
||||||
(P11SESSION(p11rsa->slot), &mechanism, key));
|
|
||||||
if (ret != CKR_OK) {
|
|
||||||
p11_put_session(p11rsa->p, p11rsa->slot);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = P11FUNC(p11rsa->p, Verify,
|
|
||||||
(P11SESSION(p11rsa->slot), (CK_BYTE *)from, flen, to, ck_sigsize));
|
|
||||||
if (ret != CKR_OK)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
p11_put_session(p11rsa->p, p11rsa->slot);
|
|
||||||
|
|
||||||
return ck_sigsize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user