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 7024 by doda, Thu Jan 25 12:21:51 2018 UTC revision 7026 by doda, Thu Jan 25 12:21:59 2018 UTC
# Line 5453  error:; Line 5453  error:;
5453          notify_fatal_error(pvar, "error occurred @ SSH2_dh_gex_kex_init()", TRUE);          notify_fatal_error(pvar, "error occurred @ SSH2_dh_gex_kex_init()", TRUE);
5454  }  }
5455    
5456    /*
5457  // SSH2_MSG_KEX_DH_GEX_GROUP   * SSH2_MSG_KEX_DH_GEX_GROUP:
5458     *   byte    SSH_MSG_KEX_DH_GEX_GROUP
5459     *   mpint   p, safe prime
5460     *   mpint   g, generator for subgroup in GF(p)
5461     */
5462  static BOOL handle_SSH2_dh_gex_group(PTInstVar pvar)  static BOOL handle_SSH2_dh_gex_group(PTInstVar pvar)
5463  {  {
         char *data;  
5464          int len, grp_bits;          int len, grp_bits;
5465          BIGNUM *p = NULL, *g = NULL;          BIGNUM *p = NULL, *g = NULL;
5466          DH *dh = NULL;          DH *dh = NULL;
# Line 5467  static BOOL handle_SSH2_dh_gex_group(PTI Line 5470  static BOOL handle_SSH2_dh_gex_group(PTI
5470    
5471          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEX_DH_GEX_GROUP was received.");          logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_KEX_DH_GEX_GROUP was received.");
5472    
         // 6byte(サイズ+パディング+タイプ)を取り除いた以降のペイロード  
         data = pvar->ssh_state.payload;  
         // パケットサイズ - (パディングサイズ+1);真のパケットサイズ  
         len = pvar->ssh_state.payloadlen;  
   
5473          p = BN_new();          p = BN_new();
5474          g = BN_new();          g = BN_new();
5475          if (p == NULL || g == NULL)          if (p == NULL || g == NULL)
5476                  goto error;                  goto error;
5477    
5478          buffer_get_bignum2(&data, p); // 素数の取得          if (!get_mpint_from_payload(pvar, p) || !get_mpint_from_payload(pvar, g)) {
5479          buffer_get_bignum2(&data, g); // 生成元の取得                  notify_fatal_error(pvar, __FUNCTION__ ":truncated packet (mpint)", FALSE);
5480                    return FALSE;
5481            }
5482    
5483          grp_bits = BN_num_bits(p);          grp_bits = BN_num_bits(p);
5484          logprintf(LOG_LEVEL_VERBOSE, "DH-GEX: Request: %d / %d / %d, Received: %d",          logprintf(LOG_LEVEL_VERBOSE, "DH-GEX: Request: %d / %d / %d, Received: %d",

Legend:
Removed from v.7024  
changed lines
  Added in v.7026

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