Module: wine Branch: master Commit: 1004b57c55cd51a8ec4b50587a5e0b2d9fffa5ae URL: http://source.winehq.org/git/wine.git/?a=commit;h=1004b57c55cd51a8ec4b50587a...
Author: Juan Lang juan.lang@gmail.com Date: Thu Nov 5 09:47:49 2009 -0800
rsaenh: Explicitly clear unused memory when exporting a public key.
---
dlls/rsaenh/implglue.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/rsaenh/implglue.c b/dlls/rsaenh/implglue.c index 3477210..118409f 100644 --- a/dlls/rsaenh/implglue.c +++ b/dlls/rsaenh/implglue.c @@ -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; }