[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.247 and 1.248

version 1.247, 2017/03/11 13:07:35 version 1.248, 2017/04/30 23:10:43
Line 800 
Line 800 
 void  void
 ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number)  ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number)
 {  {
 #ifndef WITH_SSH1  
         fatal("no SSH protocol 1 support");          fatal("no SSH protocol 1 support");
 #else /* WITH_SSH1 */  
         struct session_state *state = ssh->state;  
         const struct sshcipher *cipher = cipher_by_number(number);  
         int r;  
         const char *wmsg;  
   
         if (cipher == NULL)  
                 fatal("%s: unknown cipher number %d", __func__, number);  
         if (keylen < 20)  
                 fatal("%s: keylen too small: %d", __func__, keylen);  
         if (keylen > SSH_SESSION_KEY_LENGTH)  
                 fatal("%s: keylen too big: %d", __func__, keylen);  
         memcpy(state->ssh1_key, key, keylen);  
         state->ssh1_keylen = keylen;  
         if ((r = cipher_init(&state->send_context, cipher, key, keylen,  
             NULL, 0, CIPHER_ENCRYPT)) != 0 ||  
             (r = cipher_init(&state->receive_context, cipher, key, keylen,  
             NULL, 0, CIPHER_DECRYPT) != 0))  
                 fatal("%s: cipher_init failed: %s", __func__, ssh_err(r));  
         if (!state->cipher_warning_done &&  
             ((wmsg = cipher_warning_message(state->send_context)) != NULL ||  
             (wmsg = cipher_warning_message(state->send_context)) != NULL)) {  
                 error("Warning: %s", wmsg);  
                 state->cipher_warning_done = 1;  
         }  
 #endif /* WITH_SSH1 */  
 }  }
   
 /*  /*
Line 2840 
Line 2813 
         return sshbuf_put_ec(ssh->state->outgoing_packet, v, g);          return sshbuf_put_ec(ssh->state->outgoing_packet, v, g);
 }  }
   
 #ifdef WITH_SSH1  
 int  
 sshpkt_put_bignum1(struct ssh *ssh, const BIGNUM *v)  
 {  
         return sshbuf_put_bignum1(ssh->state->outgoing_packet, v);  
 }  
 #endif /* WITH_SSH1 */  
   
 int  int
 sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v)  sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v)
Line 2906 
Line 2872 
         return sshbuf_get_ec(ssh->state->incoming_packet, v, g);          return sshbuf_get_ec(ssh->state->incoming_packet, v, g);
 }  }
   
 #ifdef WITH_SSH1  
 int  
 sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v)  
 {  
         return sshbuf_get_bignum1(ssh->state->incoming_packet, v);  
 }  
 #endif /* WITH_SSH1 */  
   
 int  int
 sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v)  sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v)

Legend:
Removed from v.1.247  
changed lines
  Added in v.1.248