[BACK]Return to des_rw.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rlogin

Diff for /src/usr.bin/rlogin/Attic/des_rw.c between version 1.1 and 1.2

version 1.1, 1995/10/18 08:46:00 version 1.2, 1995/12/16 22:20:31
Line 41 
Line 41 
 #endif  #endif
 #endif /* not lint */  #endif /* not lint */
   
 #ifdef CRYPT  
 #ifdef KERBEROS  #ifdef KERBEROS
 #include <sys/param.h>  #include <sys/param.h>
   
Line 53 
Line 52 
 #include <time.h>  #include <time.h>
 #include <unistd.h>  #include <unistd.h>
   
 static unsigned char    des_inbuf[10240], storage[10240], *store_ptr;  static des_cblock       des_inbuf[10240], storage[10240], *store_ptr;
 static bit_64           *key;  static des_cblock       *key;
 static u_char           *key_schedule;  static des_key_schedule key_schedule;
   
 /* XXX these should be in a kerberos include file */  /* XXX these should be in a kerberos include file */
 int     krb_net_read __P((int, char *, int));  int     krb_net_read __P((int, char *, int));
Line 80 
Line 79 
  * and the insched is the DES Key unwrapped for faster decryption   * and the insched is the DES Key unwrapped for faster decryption
  */   */
   
 void  int
 des_set_key(inkey, insched)  des_set_key(inkey, insched)
         bit_64          *inkey;          des_cblock              *inkey;
         u_char          *insched;          des_key_schedule        insched;
 {  {
         key = inkey;          key = inkey;
         key_schedule = insched;          bcopy(insched, key_schedule, sizeof(key_schedule));
   
           return 0;
 }  }
   
 void  void
Line 166 
Line 167 
         return(nreturned);          return(nreturned);
 }  }
   
 static  unsigned char des_outbuf[10240];        /* > longest write */  static  des_cblock des_outbuf[10240];   /* > longest write */
   
 int  int
 des_write(fd, buf, len)  des_write(fd, buf, len)
Line 175 
Line 176 
         int len;          int len;
 {  {
         static  int     seeded = 0;          static  int     seeded = 0;
         static  char    garbage_buf[8];          static  des_cblock      garbage_buf[8];
         long net_len, garbage;          long net_len, garbage;
   
         if(len < 8) {          if(len < 8) {
Line 191 
Line 192 
         }          }
         /* pcbc_encrypt outputs in 8-byte (64 bit) increments */          /* pcbc_encrypt outputs in 8-byte (64 bit) increments */
   
         (void) des_pcbc_encrypt((len < 8) ? garbage_buf : buf,          (void) des_pcbc_encrypt((len < 8) ? garbage_buf : (des_cblock *)buf,
                             des_outbuf,                              des_outbuf,
                             (len < 8) ? 8 : len,                              (len < 8) ? 8 : len,
                             key_schedule,       /* DES key */                              key_schedule,       /* DES key */
Line 206 
Line 207 
         return(len);          return(len);
 }  }
 #endif /* KERBEROS */  #endif /* KERBEROS */
 #endif /* CRYPT */  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2