"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ssh1login.c" between
putty-0.75.tar.gz and putty-0.76.tar.gz

About: PuTTY is a free implementation of Telnet and SSH for Windows and Unix platforms, along with an xterm terminal emulator.

ssh1login.c  (putty-0.75):ssh1login.c  (putty-0.76)
skipping to change at line 30 skipping to change at line 30
struct ssh1_login_state { struct ssh1_login_state {
int crState; int crState;
PacketProtocolLayer *successor_layer; PacketProtocolLayer *successor_layer;
Conf *conf; Conf *conf;
char *savedhost; char *savedhost;
int savedport; int savedport;
bool try_agent_auth; bool try_agent_auth, is_trivial_auth;
int remote_protoflags; int remote_protoflags;
int local_protoflags; int local_protoflags;
unsigned char session_key[32]; unsigned char session_key[32];
char *username; char *username;
agent_pending_query *auth_agent_query; agent_pending_query *auth_agent_query;
int len; int len;
unsigned char *rsabuf; unsigned char *rsabuf;
unsigned long supported_ciphers_mask, supported_auths_mask; unsigned long supported_ciphers_mask, supported_auths_mask;
skipping to change at line 108 skipping to change at line 108
PacketProtocolLayer *successor_layer) PacketProtocolLayer *successor_layer)
{ {
struct ssh1_login_state *s = snew(struct ssh1_login_state); struct ssh1_login_state *s = snew(struct ssh1_login_state);
memset(s, 0, sizeof(*s)); memset(s, 0, sizeof(*s));
s->ppl.vt = &ssh1_login_vtable; s->ppl.vt = &ssh1_login_vtable;
s->conf = conf_copy(conf); s->conf = conf_copy(conf);
s->savedhost = dupstr(host); s->savedhost = dupstr(host);
s->savedport = port; s->savedport = port;
s->successor_layer = successor_layer; s->successor_layer = successor_layer;
s->is_trivial_auth = true;
return &s->ppl; return &s->ppl;
} }
static void ssh1_login_free(PacketProtocolLayer *ppl) static void ssh1_login_free(PacketProtocolLayer *ppl)
{ {
struct ssh1_login_state *s = struct ssh1_login_state *s =
container_of(ppl, struct ssh1_login_state, ppl); container_of(ppl, struct ssh1_login_state, ppl);
if (s->successor_layer) if (s->successor_layer)
ssh_ppl_free(s->successor_layer); ssh_ppl_free(s->successor_layer);
skipping to change at line 648 skipping to change at line 650
{ {
const unsigned char *ret = s->agent_response.ptr; const unsigned char *ret = s->agent_response.ptr;
if (ret) { if (ret) {
if (s->agent_response.len >= 5+16 && if (s->agent_response.len >= 5+16 &&
ret[4] == SSH1_AGENT_RSA_RESPONSE) { ret[4] == SSH1_AGENT_RSA_RESPONSE) {
ppl_logevent("Sending Pageant's response"); ppl_logevent("Sending Pageant's response");
pkt = ssh_bpp_new_pktout( pkt = ssh_bpp_new_pktout(
s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE); s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE);
put_data(pkt, ret + 5, 16); put_data(pkt, ret + 5, 16);
pq_push(s->ppl.out_pq, pkt); pq_push(s->ppl.out_pq, pkt);
s->is_trivial_auth = false;
crMaybeWaitUntilV( crMaybeWaitUntilV(
(pktin = ssh1_login_pop(s)) (pktin = ssh1_login_pop(s))
!= NULL); != NULL);
if (pktin->type == SSH1_SMSG_SUCCESS) { if (pktin->type == SSH1_SMSG_SUCCESS) {
ppl_logevent("Pageant's response " ppl_logevent("Pageant's response "
"accepted"); "accepted");
if (seat_verbose(s->ppl.seat)) { if (seat_verbose(s->ppl.seat)) {
ptrlen comment = ptrlen_from_strbuf( ptrlen comment = ptrlen_from_strbuf(
s->agent_keys[s->agent_key_index]. s->agent_keys[s->agent_key_index].
comment); comment);
skipping to change at line 817 skipping to change at line 820
ssh_hash *h = ssh_hash_new(&ssh_md5); ssh_hash *h = ssh_hash_new(&ssh_md5);
put_data(h, buffer, 32); put_data(h, buffer, 32);
put_data(h, s->session_id, 16); put_data(h, s->session_id, 16);
ssh_hash_final(h, buffer); ssh_hash_final(h, buffer);
} }
pkt = ssh_bpp_new_pktout( pkt = ssh_bpp_new_pktout(
s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE); s->ppl.bpp, SSH1_CMSG_AUTH_RSA_RESPONSE);
put_data(pkt, buffer, 16); put_data(pkt, buffer, 16);
pq_push(s->ppl.out_pq, pkt); pq_push(s->ppl.out_pq, pkt);
s->is_trivial_auth = false;
mp_free(challenge); mp_free(challenge);
mp_free(response); mp_free(response);
} }
crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) crMaybeWaitUntilV((pktin = ssh1_login_pop(s))
!= NULL); != NULL);
if (pktin->type == SSH1_SMSG_FAILURE) { if (pktin->type == SSH1_SMSG_FAILURE) {
if (seat_verbose(s->ppl.seat)) if (seat_verbose(s->ppl.seat))
ppl_printf("Failed to authenticate with" ppl_printf("Failed to authenticate with"
skipping to change at line 1108 skipping to change at line 1112
pkt = ssh_bpp_new_pktout(s->ppl.bpp, s->pwpkt_type); pkt = ssh_bpp_new_pktout(s->ppl.bpp, s->pwpkt_type);
put_stringz(pkt, prompt_get_result_ref( put_stringz(pkt, prompt_get_result_ref(
s->cur_prompt->prompts[0])); s->cur_prompt->prompts[0]));
pq_push(s->ppl.out_pq, pkt); pq_push(s->ppl.out_pq, pkt);
} }
} else { } else {
pkt = ssh_bpp_new_pktout(s->ppl.bpp, s->pwpkt_type); pkt = ssh_bpp_new_pktout(s->ppl.bpp, s->pwpkt_type);
put_stringz(pkt, prompt_get_result_ref(s->cur_prompt->prompts[0])); put_stringz(pkt, prompt_get_result_ref(s->cur_prompt->prompts[0]));
pq_push(s->ppl.out_pq, pkt); pq_push(s->ppl.out_pq, pkt);
} }
s->is_trivial_auth = false;
ppl_logevent("Sent password"); ppl_logevent("Sent password");
free_prompts(s->cur_prompt); free_prompts(s->cur_prompt);
s->cur_prompt = NULL; s->cur_prompt = NULL;
crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL);
if (pktin->type == SSH1_SMSG_FAILURE) { if (pktin->type == SSH1_SMSG_FAILURE) {
if (seat_verbose(s->ppl.seat)) if (seat_verbose(s->ppl.seat))
ppl_printf("Access denied\r\n"); ppl_printf("Access denied\r\n");
ppl_logevent("Authentication refused"); ppl_logevent("Authentication refused");
} else if (pktin->type != SSH1_SMSG_SUCCESS) { } else if (pktin->type != SSH1_SMSG_SUCCESS) {
ssh_proto_error(s->ppl.ssh, "Received unexpected packet" ssh_proto_error(s->ppl.ssh, "Received unexpected packet"
" in response to password authentication, type %d " " in response to password authentication, type %d "
"(%s)", pktin->type, ssh1_pkt_type(pktin->type)); "(%s)", pktin->type, ssh1_pkt_type(pktin->type));
return; return;
} }
} }
if (conf_get_bool(s->conf, CONF_ssh_no_trivial_userauth) &&
s->is_trivial_auth) {
ssh_proto_error(s->ppl.ssh, "Authentication was trivial! "
"Abandoning session as specified in configuration.");
return;
}
ppl_logevent("Authentication successful"); ppl_logevent("Authentication successful");
if (conf_get_bool(s->conf, CONF_compression)) { if (conf_get_bool(s->conf, CONF_compression)) {
ppl_logevent("Requesting compression"); ppl_logevent("Requesting compression");
pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_REQUEST_COMPRESSION); pkt = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_REQUEST_COMPRESSION);
put_uint32(pkt, 6); /* gzip compression level */ put_uint32(pkt, 6); /* gzip compression level */
pq_push(s->ppl.out_pq, pkt); pq_push(s->ppl.out_pq, pkt);
crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL); crMaybeWaitUntilV((pktin = ssh1_login_pop(s)) != NULL);
if (pktin->type == SSH1_SMSG_SUCCESS) { if (pktin->type == SSH1_SMSG_SUCCESS) {
/* /*
 End of changes. 6 change blocks. 
1 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)