[1293] in Kerberos-V5-bugs
krlogin encryption problem
daemon@ATHENA.MIT.EDU (John DiMarco)
Fri Mar 24 20:15:49 1995
From: John DiMarco <jdd@cdf.toronto.edu>
To: krb5-bugs@MIT.EDU
Date: Fri, 24 Mar 1995 20:15:34 -0500
OS: Solaris 2.3 to SunOS 4.1.1
Hardware: suns
Kerberos version: krb5 beta 3
krlogin -x host fails from Solaris 2.3 to anything; I don't know if it's still
broken in beta 4. It's a simple error: des_read returns 0 on error rather
than -1 as it should. It's actually broken for every platform, but it
mostly works on BSD-based platforms because errors rarely occur. But on
Solaris (and I presume other POSIX or SYSV derived platforms), EINTR's occur
almost all the time.
Anyhow, a fix is included at the end of this message.
Regards,
John
--
John DiMarco <jdd@cdf.toronto.edu> Office: EA201B
Computing Disciplines Facility Systems Manager Phone: 416-978-1928
University of Toronto Fax: 416-978-1931
http://www.cdf.toronto.edu/personal/jdd/jdd.html
*** /tmp/T0a003uU Fri Mar 24 20:09:37 1995
--- krlogin.c Fri Mar 24 20:07:03 1995
***************
*** 1564,1570 ****
#endif
/* XXX can't read enough, pipe
must have closed */
! return(0);
}
rd_len = ntohl(rd_len);
net_len = krb5_encrypt_size(rd_len,eblock.crypto_entry);
--- 1564,1570 ----
#endif
/* XXX can't read enough, pipe
must have closed */
! return(-1);
}
rd_len = ntohl(rd_len);
net_len = krb5_encrypt_size(rd_len,eblock.crypto_entry);
***************
*** 1572,1578 ****
/* preposterous length; assume out-of-sync; only
recourse is to close connection, so return 0 */
fprintf(stderr,"Read size problem.\n");
! return(0);
}
if ((cc = krb5_net_read(fd, desinbuf.data, net_len)) != net_len) {
/* pipe must have closed, return 0 */
--- 1572,1578 ----
/* preposterous length; assume out-of-sync; only
recourse is to close connection, so return 0 */
fprintf(stderr,"Read size problem.\n");
! return(-1);
}
if ((cc = krb5_net_read(fd, desinbuf.data, net_len)) != net_len) {
/* pipe must have closed, return 0 */
***************
*** 1579,1585 ****
fprintf(stderr,
"Read error: length received %d != expected %d.\n",
cc,net_len);
! return(0);
}
/* decrypt info */
if ((krb5_decrypt(desinbuf.data,
--- 1579,1585 ----
fprintf(stderr,
"Read error: length received %d != expected %d.\n",
cc,net_len);
! return(-1);
}
/* decrypt info */
if ((krb5_decrypt(desinbuf.data,
***************
*** 1587,1593 ****
net_len,
&eblock, 0))) {
fprintf(stderr,"Cannot decrypt data from network.\n");
! return(0);
}
store_ptr = storage;
nstored = rd_len;
--- 1587,1593 ----
net_len,
&eblock, 0))) {
fprintf(stderr,"Cannot decrypt data from network.\n");
! return(-1);
}
store_ptr = storage;
nstored = rd_len;