Differences From Artifact [5fc92f1214]:
- File pscp.c — part of check-in [632f55a867] at 2005-06-25 16:43:09 on branch trunk — In local-to-remote copies, abort if fxp_init() fails, rather than ploughing on and trying to transfer files, which caused a null-pointer deference. Thanks to Fernando Najera for reporting the bug. (user: ben size: 58004)
To Artifact [0b759298fc]:
- File pscp.c — part of check-in [fa1347493a] at 2005-10-30 14:24:09 on branch trunk — Revamp SSH authentication code so that user interaction is more abstracted out; replace loops structured around a single interaction per loop with less tortuous code (fixes: `ki-multiprompt-crash', `ssh1-bad-passphrase-crash'; makes `ssh2-password-expiry' and `proxy-password-prompt' easier). The new interaction abstraction has a lot of fields that are unused in the current code (things like window captions); this is groundwork for `gui-auth'. However, ssh.c still writes directly to stderr; that may want to be fixed. In the GUI apps, user interaction is moved to terminal.c. This should make it easier to fix things like UTF-8 username entry, although I haven't attempted to do so. Also, control character filtering can be tailored to be appropriate for individual front-ends; so far I don't promise anything other than not having made it any worse. I've tried to test this fairly exhaustively (although Mac stuff is untested, as usual). It all seems to basically work, but I bet there are new bugs. (One I know about is that you can no longer make the PuTTY window go away with a ^D at the password prompt; this should be fixed.) (user: jacob size: 58273)
| ︙ | ︙ | |||
215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
pending = sresize(pending, pendsize, unsigned char);
}
memcpy(pending + pendlen, p, len);
pendlen += len;
}
return 0;
}
static int ssh_scp_recv(unsigned char *buf, int len)
{
outptr = buf;
outlen = len;
/*
| > > > > > > > > > | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
pending = sresize(pending, pendsize, unsigned char);
}
memcpy(pending + pendlen, p, len);
pendlen += len;
}
return 0;
}
int from_backend_untrusted(void *frontend_handle, const char *data, int len)
{
/*
* No "untrusted" output should get here (the way the code is
* currently, it's all diverted by FLAG_STDERR).
*/
assert(!"Unexpected call to from_backend_untrusted()");
return 0; /* not reached */
}
static int ssh_scp_recv(unsigned char *buf, int len)
{
outptr = buf;
outlen = len;
/*
|
| ︙ | ︙ | |||
2200 2201 2202 2203 2204 2205 2206 |
flags = FLAG_STDERR
#ifdef FLAG_SYNCAGENT
| FLAG_SYNCAGENT
#endif
;
cmdline_tooltype = TOOLTYPE_FILETRANSFER;
| < | 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 |
flags = FLAG_STDERR
#ifdef FLAG_SYNCAGENT
| FLAG_SYNCAGENT
#endif
;
cmdline_tooltype = TOOLTYPE_FILETRANSFER;
sk_init();
/* Load Default Settings before doing anything else. */
do_defaults(NULL, &cfg);
loaded_session = FALSE;
for (i = 1; i < argc; i++) {
|
| ︙ | ︙ |