Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ssh.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7008 by doda, Mon Dec 18 11:06:16 2017 UTC revision 7009 by doda, Tue Dec 19 11:50:14 2017 UTC
# Line 5520  static BOOL handle_SSH2_dh_kex_reply(PTI Line 5520  static BOOL handle_SSH2_dh_kex_reply(PTI
5520          char *emsg, emsg_tmp[1024];  // error message          char *emsg, emsg_tmp[1024];  // error message
5521          int ret, hashlen;          int ret, hashlen;
5522          Key *hostkey;  // hostkey          Key *hostkey;  // hostkey
5523            BOOL result = FALSE;
5524    
5525          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEXDH_REPLY was received.");          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEXDH_REPLY was received.");
5526    
# Line 5705  cont: Line 5706  cont:
5706          SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)          SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)
5707          SSH2_dispatch_add_message(SSH2_MSG_DEBUG);          SSH2_dispatch_add_message(SSH2_MSG_DEBUG);
5708    
5709          BN_free(dh_server_pub);          result = TRUE;
         DH_free(pvar->kexdh); pvar->kexdh = NULL;  
         key_free(hostkey);  
         if (dh_buf != NULL) free(dh_buf);  
         return TRUE;  
5710    
5711  error:  error:
5712          BN_free(dh_server_pub);          BN_free(dh_server_pub);
5713          DH_free(pvar->kexdh); pvar->kexdh = NULL;          DH_free(pvar->kexdh); pvar->kexdh = NULL;
5714          key_free(hostkey);          key_free(hostkey);
5715          if (dh_buf != NULL) free(dh_buf);          free(dh_buf);
5716          BN_free(share_key);          BN_free(share_key);
5717    
5718          notify_fatal_error(pvar, emsg, TRUE);          if (result == FALSE)
5719                    notify_fatal_error(pvar, emsg, TRUE);
5720    
5721          return FALSE;          return result;
5722  }  }
5723    
5724    
# Line 5745  static BOOL handle_SSH2_dh_gex_reply(PTI Line 5743  static BOOL handle_SSH2_dh_gex_reply(PTI
5743          char *emsg, emsg_tmp[1024];  // error message          char *emsg, emsg_tmp[1024];  // error message
5744          int ret, hashlen;          int ret, hashlen;
5745          Key *hostkey = NULL;  // hostkey          Key *hostkey = NULL;  // hostkey
5746            BOOL result = FALSE;
5747    
5748          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEX_DH_GEX_REPLY was received.");          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEX_DH_GEX_REPLY was received.");
5749    
# Line 5939  cont: Line 5938  cont:
5938          SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)          SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)
5939          SSH2_dispatch_add_message(SSH2_MSG_DEBUG);          SSH2_dispatch_add_message(SSH2_MSG_DEBUG);
5940    
5941          BN_free(dh_server_pub);          result = TRUE;
         DH_free(pvar->kexdh); pvar->kexdh = NULL;  
         key_free(hostkey);  
         if (dh_buf != NULL) free(dh_buf);  
         return TRUE;  
5942    
5943  error:  error:
5944          BN_free(dh_server_pub);          BN_free(dh_server_pub);
5945          DH_free(pvar->kexdh); pvar->kexdh = NULL;          DH_free(pvar->kexdh); pvar->kexdh = NULL;
5946          key_free(hostkey);          key_free(hostkey);
5947          if (dh_buf != NULL) free(dh_buf);          free(dh_buf);
5948          BN_free(share_key);          BN_free(share_key);
5949    
5950          notify_fatal_error(pvar, emsg, TRUE);          if (result == FALSE)
5951                    notify_fatal_error(pvar, emsg, TRUE);
5952    
5953          return FALSE;          return result;
5954  }  }
5955    
5956    
# Line 5978  static BOOL handle_SSH2_ecdh_kex_reply(P Line 5974  static BOOL handle_SSH2_ecdh_kex_reply(P
5974          char *emsg, emsg_tmp[1024];  // error message          char *emsg, emsg_tmp[1024];  // error message
5975          int ret, hashlen;          int ret, hashlen;
5976          Key *hostkey = NULL;  // hostkey          Key *hostkey = NULL;  // hostkey
5977            BOOL result = FALSE;
5978    
5979          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEX_ECDH_REPLY was received.");          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEX_ECDH_REPLY was received.");
5980    
# Line 6185  cont: Line 6182  cont:
6182          SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)          SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)
6183          SSH2_dispatch_add_message(SSH2_MSG_DEBUG);          SSH2_dispatch_add_message(SSH2_MSG_DEBUG);
6184    
6185          EC_KEY_free(pvar->ecdh_client_key); pvar->ecdh_client_key = NULL;          result = TRUE;
         EC_POINT_clear_free(server_public);  
         key_free(hostkey);  
         if (ecdh_buf != NULL) free(ecdh_buf);  
         return TRUE;  
6186    
6187  error:  error:
         EC_POINT_clear_free(server_public);  
6188          EC_KEY_free(pvar->ecdh_client_key); pvar->ecdh_client_key = NULL;          EC_KEY_free(pvar->ecdh_client_key); pvar->ecdh_client_key = NULL;
6189            EC_POINT_clear_free(server_public);
6190          key_free(hostkey);          key_free(hostkey);
6191          if (ecdh_buf != NULL) free(ecdh_buf);          free(ecdh_buf);
6192          BN_free(share_key);          BN_free(share_key);
6193    
6194          notify_fatal_error(pvar, emsg, TRUE);          if (result == FALSE)
6195                    notify_fatal_error(pvar, emsg, TRUE);
6196    
6197          return FALSE;          return result;
6198  }  }
6199    
6200    

Legend:
Removed from v.7008  
changed lines
  Added in v.7009

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26