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 4299 by maya, Wed Feb 9 16:00:36 2011 UTC revision 4301 by maya, Sat Feb 12 06:52:18 2011 UTC
# Line 194  enum channel_type { Line 194  enum channel_type {
194  #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE           3  #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE           3
195  #define SSH2_OPEN_RESOURCE_SHORTAGE              4  #define SSH2_OPEN_RESOURCE_SHORTAGE              4
196    
 // キー交換アルゴリズム  
 #define KEX_DH1             "diffie-hellman-group1-sha1"  
 #define KEX_DH14            "diffie-hellman-group14-sha1"  
 #define KEX_DHGEX_SHA1      "diffie-hellman-group-exchange-sha1"  
 #define KEX_DHGEX_SHA256    "diffie-hellman-group-exchange-sha256"  
   
 // support of "Compression delayed" (2006.6.23 maya)  
 enum compression_type {  
         COMP_NONE,  
         COMP_ZLIB,  
         COMP_DELAYED,  
         COMP_UNKNOWN  
 };  
   
 enum kex_exchange {  
         KEX_DH_GRP1_SHA1,  
         KEX_DH_GRP14_SHA1,  
         KEX_DH_GEX_SHA1,  
         KEX_DH_GEX_SHA256,  
         KEX_MAX  
 };  
   
197  enum hostkey_type {  enum hostkey_type {
198          KEY_RSA1,          KEY_RSA1,
199          KEY_RSA,          KEY_RSA,
# Line 223  enum hostkey_type { Line 201  enum hostkey_type {
201          KEY_UNSPEC,          KEY_UNSPEC,
202  };  };
203    
 // 下記のインデックスは ssh2_macs[] と合わせること。  
 enum hmac_type {  
         HMAC_SHA1,  
         HMAC_MD5,  
         HMAC_UNKNOWN  
 };  
   
204  #define KEX_DEFAULT_KEX     "diffie-hellman-group-exchange-sha256," \  #define KEX_DEFAULT_KEX     "diffie-hellman-group-exchange-sha256," \
205                              "diffie-hellman-group-exchange-sha1," \                              "diffie-hellman-group-exchange-sha1," \
206                              "diffie-hellman-group14-sha1," \                              "diffie-hellman-group14-sha1," \
# Line 239  enum hmac_type { Line 210  enum hmac_type {
210  #define KEX_DEFAULT_ENCRYPT ""  #define KEX_DEFAULT_ENCRYPT ""
211  #define KEX_DEFAULT_MAC     "hmac-sha1,hmac-md5"  #define KEX_DEFAULT_MAC     "hmac-sha1,hmac-md5"
212  // support of "Compression delayed" (2006.6.23 maya)  // support of "Compression delayed" (2006.6.23 maya)
213  #define KEX_DEFAULT_COMP        "none,zlib@openssh.com,zlib"  #define KEX_DEFAULT_COMP    "none,zlib@openssh.com,zlib"
214  #define KEX_DEFAULT_LANG        ""  #define KEX_DEFAULT_LANG    ""
215    
216  /* Minimum modulus size (n) for RSA keys. */  /* Minimum modulus size (n) for RSA keys. */
217  #define SSH_RSA_MINIMUM_MODULUS_SIZE    768  #define SSH_RSA_MINIMUM_MODULUS_SIZE    768
# Line 310  typedef struct ssh2_cipher { Line 281  typedef struct ssh2_cipher {
281  } ssh2_cipher_t;  } ssh2_cipher_t;
282    
283  static ssh2_cipher_t ssh2_ciphers[] = {  static ssh2_cipher_t ssh2_ciphers[] = {
284          {SSH2_CIPHER_3DES_CBC,     "3des-cbc",      8, 24, 0, EVP_des_ede3_cbc},          {SSH2_CIPHER_3DES_CBC,     "3des-cbc",      8, 24, 0,    EVP_des_ede3_cbc},
285          {SSH2_CIPHER_AES128_CBC,   "aes128-cbc",   16, 16, 0, EVP_aes_128_cbc},          {SSH2_CIPHER_AES128_CBC,   "aes128-cbc",   16, 16, 0,    EVP_aes_128_cbc},
286          {SSH2_CIPHER_AES192_CBC,   "aes192-cbc",   16, 24, 0, EVP_aes_192_cbc},          {SSH2_CIPHER_AES192_CBC,   "aes192-cbc",   16, 24, 0,    EVP_aes_192_cbc},
287          {SSH2_CIPHER_AES256_CBC,   "aes256-cbc",   16, 32, 0, EVP_aes_256_cbc},          {SSH2_CIPHER_AES256_CBC,   "aes256-cbc",   16, 32, 0,    EVP_aes_256_cbc},
288          {SSH2_CIPHER_BLOWFISH_CBC, "blowfish-cbc",  8, 16, 0, EVP_bf_cbc},          {SSH2_CIPHER_BLOWFISH_CBC, "blowfish-cbc",  8, 16, 0,    EVP_bf_cbc},
289          {SSH2_CIPHER_AES128_CTR,   "aes128-ctr",   16, 16, 0, evp_aes_128_ctr},          {SSH2_CIPHER_AES128_CTR,   "aes128-ctr",   16, 16, 0,    evp_aes_128_ctr},
290          {SSH2_CIPHER_AES192_CTR,   "aes192-ctr",   16, 24, 0, evp_aes_128_ctr},          {SSH2_CIPHER_AES192_CTR,   "aes192-ctr",   16, 24, 0,    evp_aes_128_ctr},
291          {SSH2_CIPHER_AES256_CTR,   "aes256-ctr",   16, 32, 0, evp_aes_128_ctr},          {SSH2_CIPHER_AES256_CTR,   "aes256-ctr",   16, 32, 0,    evp_aes_128_ctr},
292          {SSH2_CIPHER_ARCFOUR,      "arcfour",       8, 16, 0, EVP_rc4},          {SSH2_CIPHER_ARCFOUR,      "arcfour",       8, 16, 0,    EVP_rc4},
293          {SSH2_CIPHER_ARCFOUR128,   "arcfour128",    8, 16, 1536, EVP_rc4},          {SSH2_CIPHER_ARCFOUR128,   "arcfour128",    8, 16, 1536, EVP_rc4},
294          {SSH2_CIPHER_ARCFOUR256,   "arcfour256",    8, 32, 1536, EVP_rc4},          {SSH2_CIPHER_ARCFOUR256,   "arcfour256",    8, 32, 1536, EVP_rc4},
295          {SSH2_CIPHER_CAST128_CBC,  "cast128-cbc",   8, 16, 0, EVP_cast5_cbc},          {SSH2_CIPHER_CAST128_CBC,  "cast128-cbc",   8, 16, 0,    EVP_cast5_cbc},
296          {SSH2_CIPHER_3DES_CTR,     "3des-ctr",      8, 24, 0, evp_des3_ctr},          {SSH2_CIPHER_3DES_CTR,     "3des-ctr",      8, 24, 0,    evp_des3_ctr},
297          {SSH2_CIPHER_BLOWFISH_CTR, "blowfish-ctr",  8, 16, 0, evp_bf_ctr},          {SSH2_CIPHER_BLOWFISH_CTR, "blowfish-ctr",  8, 16, 0,    evp_bf_ctr},
298          {SSH2_CIPHER_CAST128_CTR,  "cast128-ctr",   8, 16, 0, evp_cast5_ctr},          {SSH2_CIPHER_CAST128_CTR,  "cast128-ctr",   8, 16, 0,    evp_cast5_ctr},
299          {SSH_CIPHER_NONE, NULL, 0, 0, 0, NULL},          {SSH_CIPHER_NONE,          NULL,            0,  0, 0,    NULL},
300    };
301    
302    
303    // 下記のインデックスは ssh2_kex_algorithms[] と合わせること。
304    enum kex_algorithm {
305            KEX_DH_GRP1_SHA1,
306            KEX_DH_GRP14_SHA1,
307            KEX_DH_GEX_SHA1,
308            KEX_DH_GEX_SHA256,
309            KEX_DH_UNKNOWN,
310  };  };
311    
312    typedef struct ssh2_kex_algorithm {
313            enum kex_algorithm kextype;
314            char *name;
315            const EVP_MD *(*evp_md)(void);
316    } ssh2_kex_algorithm_t;
317    
318    static ssh2_kex_algorithm_t ssh2_kex_algorithms[] = {
319            {KEX_DH_GRP1_SHA1,  "diffie-hellman-group1-sha1",           EVP_sha1},
320            {KEX_DH_GRP14_SHA1, "diffie-hellman-group14-sha1",          EVP_sha1},
321            {KEX_DH_GEX_SHA1,   "diffie-hellman-group-exchange-sha1",   EVP_sha1},
322            {KEX_DH_GEX_SHA256, "diffie-hellman-group-exchange-sha256", EVP_sha256},
323            {KEX_DH_UNKNOWN   , NULL                                  , NULL},
324    };
325    
326    
327    // 下記のインデックスは ssh2_macs[] と合わせること。
328    enum hmac_type {
329            HMAC_SHA1,
330            HMAC_MD5,
331            HMAC_UNKNOWN
332    };
333    
334  typedef struct ssh2_mac {  typedef struct ssh2_mac {
335            enum hmac_type type;
336          char *name;          char *name;
337          const EVP_MD *(*func)(void);          const EVP_MD *(*func)(void);
338          int truncatebits;          int truncatebits;
339  } ssh2_mac_t;  } ssh2_mac_t;
340    
341  static ssh2_mac_t ssh2_macs[] = {  static ssh2_mac_t ssh2_macs[] = {
342          {"hmac-sha1", EVP_sha1, 0},          {HMAC_SHA1,    "hmac-sha1", EVP_sha1, 0},
343          {"hmac-md5", EVP_md5, 0},          {HMAC_MD5,     "hmac-md5",  EVP_md5,  0},
344          {NULL, NULL, 0},          {HMAC_UNKNOWN, NULL,        NULL,     0},
345    };
346    
347    
348    // 下記のインデックスは ssh_comps[] と合わせること。
349    enum compression_type {
350            COMP_NONE,
351            COMP_ZLIB,
352            COMP_DELAYED,
353            COMP_UNKNOWN
354  };  };
355    
356  static char *ssh_comp[] = {  typedef struct ssh_comp {
357          "none",          enum compression_type type;
358          "zlib",          char *name;
359          "zlib@openssh.com",  } ssh_comp_t;
360    
361    static ssh_comp_t ssh_comps[] = {
362            {COMP_NONE,    "none"},
363            {COMP_ZLIB,    "zlib"},
364            {COMP_DELAYED, "zlib@openssh.com"},
365            {COMP_UNKNOWN, NULL},
366  };  };
367    
368    

Legend:
Removed from v.4299  
changed lines
  Added in v.4301

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