HWCryptoHook_ErrMsgBuf rmsg;
rmsg.buf = tempbuf;
- rmsg.size = 1024;
+ rmsg.size = sizeof(tempbuf);
*hac = p_hwcrhk_Init(&hwcrhk_globals, sizeof(hwcrhk_globals), &rmsg,
NULL);
EVP_PKEY *res = NULL;
HWCryptoHook_MPI e, n;
HWCryptoHook_RSAKeyHandle *hptr;
+ char tempbuf[1024];
HWCryptoHook_ErrMsgBuf rmsg;
+ rmsg.buf = tempbuf;
+ rmsg.size = sizeof(tempbuf);
+
if(!hwcrhk_context)
{
ENGINEerr(ENGINE_F_HWCRHK_LOAD_PRIVKEY,
res->pkey.rsa = RSA_new();
res->pkey.rsa->n = rsa->n;
res->pkey.rsa->e = rsa->e;
+ rsa->n = NULL;
+ rsa->e = NULL;
CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY);
RSA_free(rsa);
}
+ break;
default:
ENGINEerr(ENGINE_F_HWCRHK_LOAD_PUBKEY,
ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
to_return = 0; /* expect failure */
rmsg.buf = tempbuf;
- rmsg.size = 1024;
+ rmsg.size = sizeof(tempbuf);
if(!hwcrhk_context)
{
HWCryptoHook_RSAKeyHandle *hptr;
int to_return = 0, ret;
+ rmsg.buf = tempbuf;
+ rmsg.size = sizeof(tempbuf);
+
if(!hwcrhk_context)
{
ENGINEerr(ENGINE_F_HWCRHK_MOD_EXP,ENGINE_R_NOT_INITIALISED);
goto err;
}
- rmsg.buf = tempbuf;
- rmsg.size = 1024;
-
/* Prepare the params */
bn_expand2(r, rsa->n->top); /* Check for error !! */
BN2MPI(m_a, I);
goto err;
}
- rmsg.buf = tempbuf;
- rmsg.size = 1024;
-
/* Prepare the params */
bn_expand2(r, rsa->n->top); /* Check for error !! */
BN2MPI(m_a, I);
int ret;
rmsg.buf = tempbuf;
- rmsg.size = 1024;
+ rmsg.size = sizeof(tempbuf);
if(!hwcrhk_context)
{
int ret;
rmsg.buf = tempbuf;
- rmsg.size = 1024;
+ rmsg.size = sizeof(tempbuf);
hptr = (HWCryptoHook_RSAKeyHandle *) item;
if(!hptr) return;