Develop and Download Open Source Software

Browse Subversion Repository

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

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

revision 6984 by doda, Sat Nov 25 15:26:39 2017 UTC revision 6985 by doda, Sat Nov 25 15:26:45 2017 UTC
# Line 95  typedef enum { Line 95  typedef enum {
95          SSH2_CIPHER_3DES_CTR, SSH2_CIPHER_BLOWFISH_CTR, SSH2_CIPHER_CAST128_CTR,          SSH2_CIPHER_3DES_CTR, SSH2_CIPHER_BLOWFISH_CTR, SSH2_CIPHER_CAST128_CTR,
96          SSH2_CIPHER_CAMELLIA128_CBC, SSH2_CIPHER_CAMELLIA192_CBC, SSH2_CIPHER_CAMELLIA256_CBC,          SSH2_CIPHER_CAMELLIA128_CBC, SSH2_CIPHER_CAMELLIA192_CBC, SSH2_CIPHER_CAMELLIA256_CBC,
97          SSH2_CIPHER_CAMELLIA128_CTR, SSH2_CIPHER_CAMELLIA192_CTR, SSH2_CIPHER_CAMELLIA256_CTR,          SSH2_CIPHER_CAMELLIA128_CTR, SSH2_CIPHER_CAMELLIA192_CTR, SSH2_CIPHER_CAMELLIA256_CTR,
98          SSH_CIPHER_MAX = SSH2_CIPHER_CAMELLIA256_CTR,          SSH2_CIPHER_AES128_GCM, SSH2_CIPHER_AES256_GCM,
99            SSH_CIPHER_MAX = SSH2_CIPHER_AES256_GCM,
100  } SSHCipher;  } SSHCipher;
101    
102  typedef enum {  typedef enum {
# Line 380  typedef struct ssh2_cipher { Line 381  typedef struct ssh2_cipher {
381          int block_size;          int block_size;
382          int key_len;          int key_len;
383          int discard_len;          int discard_len;
384            int iv_len;
385            int auth_len;
386          const EVP_CIPHER *(*func)(void);          const EVP_CIPHER *(*func)(void);
387  } ssh2_cipher_t;  } ssh2_cipher_t;
388    
389  static ssh2_cipher_t ssh2_ciphers[] = {  static ssh2_cipher_t ssh2_ciphers[] = {
390          {SSH2_CIPHER_3DES_CBC,        "3des-cbc",         8, 24,    0, EVP_des_ede3_cbc},     // RFC4253          {SSH2_CIPHER_3DES_CBC,        "3des-cbc",         8, 24,    0, 0, 0, EVP_des_ede3_cbc},     // RFC4253
391          {SSH2_CIPHER_AES128_CBC,      "aes128-cbc",      16, 16,    0, EVP_aes_128_cbc},      // RFC4253          {SSH2_CIPHER_AES128_CBC,      "aes128-cbc",      16, 16,    0, 0, 0, EVP_aes_128_cbc},      // RFC4253
392          {SSH2_CIPHER_AES192_CBC,      "aes192-cbc",      16, 24,    0, EVP_aes_192_cbc},      // RFC4253          {SSH2_CIPHER_AES192_CBC,      "aes192-cbc",      16, 24,    0, 0, 0, EVP_aes_192_cbc},      // RFC4253
393          {SSH2_CIPHER_AES256_CBC,      "aes256-cbc",      16, 32,    0, EVP_aes_256_cbc},      // RFC4253          {SSH2_CIPHER_AES256_CBC,      "aes256-cbc",      16, 32,    0, 0, 0, EVP_aes_256_cbc},      // RFC4253
394          {SSH2_CIPHER_BLOWFISH_CBC,    "blowfish-cbc",     8, 16,    0, EVP_bf_cbc},           // RFC4253          {SSH2_CIPHER_BLOWFISH_CBC,    "blowfish-cbc",     8, 16,    0, 0, 0, EVP_bf_cbc},           // RFC4253
395          {SSH2_CIPHER_AES128_CTR,      "aes128-ctr",      16, 16,    0, evp_aes_128_ctr},      // RFC4344          {SSH2_CIPHER_AES128_CTR,      "aes128-ctr",      16, 16,    0, 0, 0, evp_aes_128_ctr},      // RFC4344
396          {SSH2_CIPHER_AES192_CTR,      "aes192-ctr",      16, 24,    0, evp_aes_128_ctr},      // RFC4344          {SSH2_CIPHER_AES192_CTR,      "aes192-ctr",      16, 24,    0, 0, 0, evp_aes_128_ctr},      // RFC4344
397          {SSH2_CIPHER_AES256_CTR,      "aes256-ctr",      16, 32,    0, evp_aes_128_ctr},      // RFC4344          {SSH2_CIPHER_AES256_CTR,      "aes256-ctr",      16, 32,    0, 0, 0, evp_aes_128_ctr},      // RFC4344
398          {SSH2_CIPHER_ARCFOUR,         "arcfour",          8, 16,    0, EVP_rc4},              // RFC4253          {SSH2_CIPHER_ARCFOUR,         "arcfour",          8, 16,    0, 0, 0, EVP_rc4},              // RFC4253
399          {SSH2_CIPHER_ARCFOUR128,      "arcfour128",       8, 16, 1536, EVP_rc4},              // RFC4345          {SSH2_CIPHER_ARCFOUR128,      "arcfour128",       8, 16, 1536, 0, 0, EVP_rc4},              // RFC4345
400          {SSH2_CIPHER_ARCFOUR256,      "arcfour256",       8, 32, 1536, EVP_rc4},              // RFC4345          {SSH2_CIPHER_ARCFOUR256,      "arcfour256",       8, 32, 1536, 0, 0, EVP_rc4},              // RFC4345
401          {SSH2_CIPHER_CAST128_CBC,     "cast128-cbc",      8, 16,    0, EVP_cast5_cbc},        // RFC4253          {SSH2_CIPHER_CAST128_CBC,     "cast128-cbc",      8, 16,    0, 0, 0, EVP_cast5_cbc},        // RFC4253
402          {SSH2_CIPHER_3DES_CTR,        "3des-ctr",         8, 24,    0, evp_des3_ctr},         // RFC4344          {SSH2_CIPHER_3DES_CTR,        "3des-ctr",         8, 24,    0, 0, 0, evp_des3_ctr},         // RFC4344
403          {SSH2_CIPHER_BLOWFISH_CTR,    "blowfish-ctr",     8, 32,    0, evp_bf_ctr},           // RFC4344          {SSH2_CIPHER_BLOWFISH_CTR,    "blowfish-ctr",     8, 32,    0, 0, 0, evp_bf_ctr},           // RFC4344
404          {SSH2_CIPHER_CAST128_CTR,     "cast128-ctr",      8, 16,    0, evp_cast5_ctr},        // RFC4344          {SSH2_CIPHER_CAST128_CTR,     "cast128-ctr",      8, 16,    0, 0, 0, evp_cast5_ctr},        // RFC4344
405          {SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc", 16, 16,    0, EVP_camellia_128_cbc}, // draft-kanno-secsh-camellia-02          {SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc", 16, 16,    0, 0, 0, EVP_camellia_128_cbc}, // draft-kanno-secsh-camellia-02
406          {SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc", 16, 24,    0, EVP_camellia_192_cbc}, // draft-kanno-secsh-camellia-02          {SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc", 16, 24,    0, 0, 0, EVP_camellia_192_cbc}, // draft-kanno-secsh-camellia-02
407          {SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc", 16, 32,    0, EVP_camellia_256_cbc}, // draft-kanno-secsh-camellia-02          {SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc", 16, 32,    0, 0, 0, EVP_camellia_256_cbc}, // draft-kanno-secsh-camellia-02
408          {SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr", 16, 16,    0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02          {SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr", 16, 16,    0, 0, 0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
409          {SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr", 16, 24,    0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02          {SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr", 16, 24,    0, 0, 0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
410          {SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr", 16, 32,    0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02          {SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr", 16, 32,    0, 0, 0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
411  #ifdef WITH_CAMELLIA_PRIVATE  #ifdef WITH_CAMELLIA_PRIVATE
412          {SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc@openssh.org", 16, 16, 0, EVP_camellia_128_cbc},          {SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc@openssh.org", 16, 16, 0,  0,  0, EVP_camellia_128_cbc},
413          {SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc@openssh.org", 16, 24, 0, EVP_camellia_192_cbc},          {SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc@openssh.org", 16, 24, 0,  0,  0, EVP_camellia_192_cbc},
414          {SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc@openssh.org", 16, 32, 0, EVP_camellia_256_cbc},          {SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc@openssh.org", 16, 32, 0,  0,  0, EVP_camellia_256_cbc},
415          {SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr@openssh.org", 16, 16, 0, evp_camellia_128_ctr},          {SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr@openssh.org", 16, 16, 0,  0,  0, evp_camellia_128_ctr},
416          {SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr@openssh.org", 16, 24, 0, evp_camellia_128_ctr},          {SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr@openssh.org", 16, 24, 0,  0,  0, evp_camellia_128_ctr},
417          {SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr@openssh.org", 16, 32, 0, evp_camellia_128_ctr},          {SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr@openssh.org", 16, 32, 0,  0,  0, evp_camellia_128_ctr},
418  #endif // WITH_CAMELLIA_PRIVATE  #endif // WITH_CAMELLIA_PRIVATE
419          {SSH_CIPHER_NONE,          NULL,            0,  0, 0,    NULL},          {SSH2_CIPHER_AES128_GCM,      "aes128-gcm@openssh.com",      16, 16, 0, 12, 16, EVP_aes_128_gcm},
420            {SSH2_CIPHER_AES256_GCM,      "aes256-gcm@openssh.com",      16, 32, 0, 12, 16, EVP_aes_256_gcm},
421            {SSH_CIPHER_NONE,             NULL,               0,  0,    0, 0, 0, NULL},
422  };  };
423    
424    
# Line 532  struct Enc { Line 537  struct Enc {
537          u_char          *iv;          u_char          *iv;
538          unsigned int    key_len;          unsigned int    key_len;
539          unsigned int    block_size;          unsigned int    block_size;
540            unsigned int    iv_len;
541            unsigned int    auth_len;
542  };  };
543    
544  struct Mac {  struct Mac {
# Line 713  BOOL SSH_handle_server_ID(PTInstVar pvar Line 720  BOOL SSH_handle_server_ID(PTInstVar pvar
720     'data' points to the start of the packet data (the length field)     'data' points to the start of the packet data (the length field)
721  */  */
722  void SSH1_handle_packet(PTInstVar pvar, char *data, unsigned int len, unsigned int padding);  void SSH1_handle_packet(PTInstVar pvar, char *data, unsigned int len, unsigned int padding);
723  void SSH2_handle_packet(PTInstVar pvar, char *data, unsigned int len, int etm);  void SSH2_handle_packet(PTInstVar pvar, char *data, unsigned int len, unsigned int aadlen, unsigned int authlen);
724  void SSH_notify_win_size(PTInstVar pvar, int cols, int rows);  void SSH_notify_win_size(PTInstVar pvar, int cols, int rows);
725  void SSH_notify_user_name(PTInstVar pvar);  void SSH_notify_user_name(PTInstVar pvar);
726  void SSH_notify_cred(PTInstVar pvar);  void SSH_notify_cred(PTInstVar pvar);
# Line 756  unsigned int SSH_get_min_packet_size(PTI Line 763  unsigned int SSH_get_min_packet_size(PTI
763     at least 5 bytes must be decrypted */     at least 5 bytes must be decrypted */
764  void SSH_predecrpyt_packet(PTInstVar pvar, char *data);  void SSH_predecrpyt_packet(PTInstVar pvar, char *data);
765  unsigned int SSH_get_clear_MAC_size(PTInstVar pvar);  unsigned int SSH_get_clear_MAC_size(PTInstVar pvar);
766    unsigned int SSH_get_authdata_size(PTInstVar pvar, int direction);
767    
768  #define SSH_is_any_payload(pvar) ((pvar)->ssh_state.payload_datalen > 0)  #define SSH_is_any_payload(pvar) ((pvar)->ssh_state.payload_datalen > 0)
769  #define SSH_get_host_name(pvar) ((pvar)->ssh_state.hostname)  #define SSH_get_host_name(pvar) ((pvar)->ssh_state.hostname)
# Line 767  BOOL do_SSH2_authrequest(PTInstVar pvar) Line 775  BOOL do_SSH2_authrequest(PTInstVar pvar)
775  void debug_print(int no, char *msg, int len);  void debug_print(int no, char *msg, int len);
776  int get_cipher_block_size(SSHCipher cipher);  int get_cipher_block_size(SSHCipher cipher);
777  int get_cipher_key_len(SSHCipher cipher);  int get_cipher_key_len(SSHCipher cipher);
778    int get_cipher_iv_len(SSHCipher cipher);
779    int get_cipher_auth_len(SSHCipher cipher);
780  SSHCipher get_cipher_by_name(char *name);  SSHCipher get_cipher_by_name(char *name);
781  char* get_kex_algorithm_name(kex_algorithm kextype);  char* get_kex_algorithm_name(kex_algorithm kextype);
782  const EVP_CIPHER* get_cipher_EVP_CIPHER(SSHCipher cipher);  const EVP_CIPHER* get_cipher_EVP_CIPHER(SSHCipher cipher);

Legend:
Removed from v.6984  
changed lines
  Added in v.6985

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