svnno****@sourc*****
svnno****@sourc*****
2017年 3月 20日 (月) 21:39:14 JST
Revision: 6642 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6642 Author: doda Date: 2017-03-20 21:39:14 +0900 (Mon, 20 Mar 2017) Log Message: ----------- PuTTY 0.68対応 agent_query() の返り値が変わり Windows では常に NULL を返すようになったので とりあえず返り値のチェックをやめた。 Modified Paths: -------------- trunk/ttssh2/putty/libputty.c trunk/ttssh2/putty/libputty.h trunk/ttssh2/ttxssh/ssh.c -------------- next part -------------- Modified: trunk/ttssh2/putty/libputty.c =================================================================== --- trunk/ttssh2/putty/libputty.c 2017-03-19 09:47:33 UTC (rev 6641) +++ trunk/ttssh2/putty/libputty.c 2017-03-20 12:39:14 UTC (rev 6642) @@ -46,7 +46,7 @@ unsigned char *request, *response; void *vresponse; - int resplen, retval; + int resplen; int pubkeylen, datalen, reqlen; pubkeylen = GET_32BIT(pubkey); @@ -63,8 +63,8 @@ // sign data (length + data) memcpy(request + 5 + 4 + pubkeylen, data, 4 + datalen); - retval = agent_query(request, reqlen, &vresponse, &resplen, NULL, NULL); - assert(retval == 1); + agent_query(request, reqlen, &vresponse, &resplen, NULL, NULL); + response = vresponse; if (resplen < 5 || response[4] != SSH2_AGENT_SIGN_RESPONSE) { sfree(response); @@ -113,7 +113,7 @@ unsigned char *request, *response, *p; void *vresponse; - int resplen, retval; + int resplen; int reqlen; reqlen = 4 + 1 + pubkeylen + datalen + 16 + 4; @@ -138,8 +138,8 @@ // terminator? PUT_32BIT(p, 1); - retval = agent_query(request, reqlen, &vresponse, &resplen, NULL, NULL); - assert(retval == 1); + agent_query(request, reqlen, &vresponse, &resplen, NULL, NULL); + response = vresponse; if (resplen < 5 || response[4] != SSH1_AGENT_RSA_RESPONSE) { sfree(response); @@ -278,12 +278,12 @@ unsigned char request[5], *response; void *vresponse; - int resplen, retval; + int resplen; request[4] = SSH1_AGENTC_REQUEST_RSA_IDENTITIES; PUT_32BIT(request, 1); - retval = agent_query(request, 5, &vresponse, &resplen, NULL, NULL); - assert(retval == 1); + agent_query(request, 5, &vresponse, &resplen, NULL, NULL); + response = vresponse; if (resplen < 5 || response[4] != SSH1_AGENT_RSA_IDENTITIES_ANSWER) { sfree(response); @@ -312,13 +312,13 @@ unsigned char request[5], *response; void *vresponse; - int resplen, retval; + int resplen; request[4] = SSH2_AGENTC_REQUEST_IDENTITIES; PUT_32BIT(request, 1); - retval = agent_query(request, 5, &vresponse, &resplen, NULL, NULL); - assert(retval == 1); + agent_query(request, 5, &vresponse, &resplen, NULL, NULL); + response = vresponse; if (resplen < 5 || response[4] != SSH2_AGENT_IDENTITIES_ANSWER) { sfree(response); Modified: trunk/ttssh2/putty/libputty.h =================================================================== --- trunk/ttssh2/putty/libputty.h 2017-03-19 09:47:33 UTC (rev 6641) +++ trunk/ttssh2/putty/libputty.h 2017-03-20 12:39:14 UTC (rev 6642) @@ -8,7 +8,7 @@ // WINDOWS\WINPGNTC.C extern int agent_exists(void); -extern int agent_query(void *in, int inlen, void **out, int *outlen, +extern void *agent_query(void *in, int inlen, void **out, int *outlen, void (*callback)(void *, void *, int), void *callback_ctx); int putty_get_ssh2_keylist(unsigned char **keylist); Modified: trunk/ttssh2/ttxssh/ssh.c =================================================================== --- trunk/ttssh2/ttxssh/ssh.c 2017-03-19 09:47:33 UTC (rev 6641) +++ trunk/ttssh2/ttxssh/ssh.c 2017-03-20 12:39:14 UTC (rev 6642) @@ -9085,8 +9085,8 @@ } req_len = get_uint32_MSBfirst(data); - retval = agent_query(data, req_len + 4, &response, &resplen, NULL, NULL); - if (retval != 1 || resplen < 5) { + agent_query(data, req_len + 4, &response, &resplen, NULL, NULL); + if (response == NULL || resplen < 5) { // \x82\xB1\x82\xCC channel \x82\xF0\x95\xB6\x82\xE9 if (SSHv2(pvar)) { ssh2_channel_send_close(pvar, c);