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

Diff for /src/usr.bin/ssh/packet.c between version 1.10 and 1.11

version 1.10, 1999/11/02 19:42:36 version 1.11, 1999/11/15 21:38:54
Line 236 
Line 236 
   
 void  void
 packet_set_encryption_key(const unsigned char *key, unsigned int keylen,  packet_set_encryption_key(const unsigned char *key, unsigned int keylen,
                           int cipher, int is_client)                            int cipher)
 {  {
   cipher_type = cipher;    /* All other ciphers use the same key in both directions for now. */
   if (cipher == SSH_CIPHER_RC4)    cipher_set_key(&receive_context, cipher, key, keylen, 0);
     {    cipher_set_key(&send_context, cipher, key, keylen, 1);
       if (is_client)  
         { /* In client: use first half for receiving, second for sending. */  
           cipher_set_key(&receive_context, cipher, key, keylen / 2, 0);  
           cipher_set_key(&send_context, cipher, key + keylen / 2,  
                          keylen / 2, 1);  
         }  
       else  
         { /* In server: use first half for sending, second for receiving. */  
           cipher_set_key(&receive_context, cipher, key + keylen / 2,  
                          keylen / 2, 0);  
           cipher_set_key(&send_context, cipher, key, keylen / 2, 1);  
         }  
     }  
   else  
     {  
       /* All other ciphers use the same key in both directions for now. */  
       cipher_set_key(&receive_context, cipher, key, keylen, 0);  
       cipher_set_key(&send_context, cipher, key, keylen, 1);  
     }  
 }  }
   
 /* Starts constructing a packet to send. */  /* Starts constructing a packet to send. */

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11