RSA Userauth Initialization

For RSA user authentication, initialize the arrays used to store the
check value and the signature before loading and comparing them.
(ZD 14412)
pull/424/head
John Safranek 2022-06-28 11:38:07 -07:00
parent 7bdb49f3b4
commit 4ff0683a16
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
1 changed files with 2 additions and 0 deletions

View File

@ -4152,6 +4152,7 @@ static int DoUserAuthRequestRsa(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
}
if (ret == WS_SUCCESS) {
WMEMSET(checkDigest, 0, MAX_ENCODED_SIG_SZ);
ret = wc_InitRsaKey(key_ptr, ssh->ctx->heap);
if (ret == 0) {
ret = WS_SUCCESS;
@ -4243,6 +4244,7 @@ static int DoUserAuthRequestRsa(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
encDigest = s_encDigest;
#endif
{
WMEMSET(encDigest, 0, MAX_ENCODED_SIG_SZ);
encDigestSz = wc_EncodeSignature(encDigest, digest,
wc_HashGetDigestSize(enmhashId),
wc_HashGetOID(enmhashId));