Commit 1004b57c authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

rsaenh: Explicitly clear unused memory when exporting a public key.

parent 49c11910
......@@ -362,6 +362,9 @@ BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD
{
mp_to_unsigned_bin(&pKeyContext->rsa.N, pbDest);
reverse_bytes(pbDest, dwKeyLen);
if (mp_unsigned_bin_size(&pKeyContext->rsa.N) < dwKeyLen)
memset(pbDest + mp_unsigned_bin_size(&pKeyContext->rsa.N), 0,
dwKeyLen - mp_unsigned_bin_size(&pKeyContext->rsa.N));
*pdwPubExp = (DWORD)mp_get_int(&pKeyContext->rsa.e);
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment