Handle different sizes of returned checksum.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@542 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-05-29 20:51:09 +00:00
parent fdae362ba7
commit 7652e731d9

View File

@@ -449,12 +449,17 @@ do_klogin(char *host)
verbose = old_verbose; verbose = old_verbose;
return -1; return -1;
} }
memmove(&tmp, msg_data.app_data, 4); {
tmp = ntohl(tmp); /* the draft doesn't tell what size the return has */
if(tmp - checksum != 1){ int i;
fprintf(stderr, "Bad checksum returned from server."); u_int32_t cs = 0;
verbose = old_verbose; for(i = 0; i < msg_data.app_length; i++)
return -1; cs = (cs<<8) + msg_data.app_data[i];
if(cs - checksum != 1){
fprintf(stderr, "Bad checksum returned from server.");
verbose = old_verbose;
return -1;
}
} }
auth_complete = 1; auth_complete = 1;
verbose = old_verbose; verbose = old_verbose;