From abea0182acfa896d0d24f5b46671b142d107f1cb Mon Sep 17 00:00:00 2001 From: manojampalam Date: Mon, 2 May 2016 22:55:48 -0700 Subject: [PATCH] 5-2 C3 --- contrib/win32/win32compat/ssh-agent/agent-request.c | 5 ++++- contrib/win32/win32compat/ssh-agent/connection.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/win32/win32compat/ssh-agent/agent-request.c b/contrib/win32/win32compat/ssh-agent/agent-request.c index 3a1874d..935c2e3 100644 --- a/contrib/win32/win32compat/ssh-agent/agent-request.c +++ b/contrib/win32/win32compat/ssh-agent/agent-request.c @@ -104,6 +104,9 @@ static int sign_blob(const struct sshkey *pubkey, u_char ** sig, size_t *siglen, DWORD regdatalen = 0; struct sshbuf* tmpbuf; + regdata = malloc(4); + regdatalen = 4; + *sig = NULL; *siglen = 0; @@ -118,7 +121,7 @@ static int sign_blob(const struct sshkey *pubkey, u_char ** sig, size_t *siglen, NULL, &sub, NULL)) != 0) goto done; - if ((RegQueryValueEx(sub, NULL, 0, NULL, NULL, ®datalen)) != ERROR_MORE_DATA) { + if ((RegQueryValueEx(sub, NULL, 0, NULL, regdata, ®datalen)) != ERROR_MORE_DATA) { r = EOTHER; goto done; } diff --git a/contrib/win32/win32compat/ssh-agent/connection.c b/contrib/win32/win32compat/ssh-agent/connection.c index 07ac26e..1d6bb7f 100644 --- a/contrib/win32/win32compat/ssh-agent/connection.c +++ b/contrib/win32/win32compat/ssh-agent/connection.c @@ -139,6 +139,8 @@ process_request(struct agent_connection* con) { r = process_request_identities(request, response, con->client_token); break; case SSH2_AGENTC_SIGN_REQUEST: + r = process_sign_request(request, response, con->client_token); + break; default: r = EINVAL; goto done;