Browse Subversion Repository
Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ssh.h
Parent Directory
| Revision Log
| Patch
| 38 |
#include <openssl/evp.h> |
#include <openssl/evp.h> |
| 39 |
|
|
| 40 |
#include "buffer.h" |
#include "buffer.h" |
| 41 |
|
#include "config.h" |
| 42 |
|
|
| 43 |
#define DEBUG_PRINT_TO_FILE(base, msg, len) { \ |
#define DEBUG_PRINT_TO_FILE(base, msg, len) { \ |
| 44 |
static int count = 0; \ |
static int count = 0; \ |
| 51 |
extern const EVP_CIPHER *evp_des3_ctr(void); |
extern const EVP_CIPHER *evp_des3_ctr(void); |
| 52 |
extern const EVP_CIPHER *evp_bf_ctr(void); |
extern const EVP_CIPHER *evp_bf_ctr(void); |
| 53 |
extern const EVP_CIPHER *evp_cast5_ctr(void); |
extern const EVP_CIPHER *evp_cast5_ctr(void); |
| 54 |
|
#ifdef WITH_CAMELLIA_DRAFT |
| 55 |
// yutaka |
extern const EVP_CIPHER *evp_camellia_128_ctr(void); |
| 56 |
#define SSH2_USE |
#endif // WITH_CAMELLIA_DRAFT |
|
|
|
|
// HMAC-SHA2 draft |
|
|
// http://www.ietf.org/id/draft-dbider-sha2-mac-for-ssh-00.txt |
|
|
#undef HMAC_SHA2_DRAFT |
|
|
|
|
| 57 |
|
|
| 58 |
/* Some of this code has been adapted from Ian Goldberg's Pilot SSH */ |
/* Some of this code has been adapted from Ian Goldberg's Pilot SSH */ |
| 59 |
|
|
| 91 |
SSH2_CIPHER_ARCFOUR, SSH2_CIPHER_ARCFOUR128, SSH2_CIPHER_ARCFOUR256, |
SSH2_CIPHER_ARCFOUR, SSH2_CIPHER_ARCFOUR128, SSH2_CIPHER_ARCFOUR256, |
| 92 |
SSH2_CIPHER_CAST128_CBC, |
SSH2_CIPHER_CAST128_CBC, |
| 93 |
SSH2_CIPHER_3DES_CTR, SSH2_CIPHER_BLOWFISH_CTR, SSH2_CIPHER_CAST128_CTR, |
SSH2_CIPHER_3DES_CTR, SSH2_CIPHER_BLOWFISH_CTR, SSH2_CIPHER_CAST128_CTR, |
| 94 |
|
#ifdef WITH_CAMELLIA_DRAFT |
| 95 |
|
SSH2_CIPHER_CAMELLIA128_CBC, SSH2_CIPHER_CAMELLIA192_CBC, SSH2_CIPHER_CAMELLIA256_CBC, |
| 96 |
|
SSH2_CIPHER_CAMELLIA128_CTR, SSH2_CIPHER_CAMELLIA192_CTR, SSH2_CIPHER_CAMELLIA256_CTR, |
| 97 |
|
SSH_CIPHER_MAX = SSH2_CIPHER_CAMELLIA256_CTR, |
| 98 |
|
#else // WITH_CAMELLIA_DRAFT |
| 99 |
SSH_CIPHER_MAX = SSH2_CIPHER_CAST128_CTR, |
SSH_CIPHER_MAX = SSH2_CIPHER_CAST128_CTR, |
| 100 |
|
#endif // WITH_CAMELLIA_DRAFT |
| 101 |
} SSHCipher; |
} SSHCipher; |
| 102 |
|
|
| 103 |
typedef enum { |
typedef enum { |
| 285 |
} ssh2_cipher_t; |
} ssh2_cipher_t; |
| 286 |
|
|
| 287 |
static ssh2_cipher_t ssh2_ciphers[] = { |
static ssh2_cipher_t ssh2_ciphers[] = { |
| 288 |
{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}, |
| 289 |
{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}, |
| 290 |
{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}, |
| 291 |
{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}, |
| 292 |
{SSH2_CIPHER_BLOWFISH_CBC, "blowfish-cbc", 8, 16, 0, EVP_bf_cbc}, |
{SSH2_CIPHER_BLOWFISH_CBC, "blowfish-cbc", 8, 16, 0, EVP_bf_cbc}, |
| 293 |
{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}, |
| 294 |
{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}, |
| 295 |
{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}, |
| 296 |
{SSH2_CIPHER_ARCFOUR, "arcfour", 8, 16, 0, EVP_rc4}, |
{SSH2_CIPHER_ARCFOUR, "arcfour", 8, 16, 0, EVP_rc4}, |
| 297 |
{SSH2_CIPHER_ARCFOUR128, "arcfour128", 8, 16, 1536, EVP_rc4}, |
{SSH2_CIPHER_ARCFOUR128, "arcfour128", 8, 16, 1536, EVP_rc4}, |
| 298 |
{SSH2_CIPHER_ARCFOUR256, "arcfour256", 8, 32, 1536, EVP_rc4}, |
{SSH2_CIPHER_ARCFOUR256, "arcfour256", 8, 32, 1536, EVP_rc4}, |
| 299 |
{SSH2_CIPHER_CAST128_CBC, "cast128-cbc", 8, 16, 0, EVP_cast5_cbc}, |
{SSH2_CIPHER_CAST128_CBC, "cast128-cbc", 8, 16, 0, EVP_cast5_cbc}, |
| 300 |
{SSH2_CIPHER_3DES_CTR, "3des-ctr", 8, 24, 0, evp_des3_ctr}, |
{SSH2_CIPHER_3DES_CTR, "3des-ctr", 8, 24, 0, evp_des3_ctr}, |
| 301 |
{SSH2_CIPHER_BLOWFISH_CTR, "blowfish-ctr", 8, 16, 0, evp_bf_ctr}, |
{SSH2_CIPHER_BLOWFISH_CTR, "blowfish-ctr", 8, 16, 0, evp_bf_ctr}, |
| 302 |
{SSH2_CIPHER_CAST128_CTR, "cast128-ctr", 8, 16, 0, evp_cast5_ctr}, |
{SSH2_CIPHER_CAST128_CTR, "cast128-ctr", 8, 16, 0, evp_cast5_ctr}, |
| 303 |
|
#ifdef WITH_CAMELLIA_DRAFT |
| 304 |
|
{SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc", 16, 16, 0, EVP_camellia_128_cbc}, |
| 305 |
|
{SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc", 16, 24, 0, EVP_camellia_192_cbc}, |
| 306 |
|
{SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc", 16, 32, 0, EVP_camellia_256_cbc}, |
| 307 |
|
{SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr", 16, 16, 0, evp_camellia_128_ctr}, |
| 308 |
|
{SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr", 16, 24, 0, evp_camellia_128_ctr}, |
| 309 |
|
{SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr", 16, 32, 0, evp_camellia_128_ctr}, |
| 310 |
|
#ifdef WITH_CAMELLIA_PRIVATE |
| 311 |
|
{SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc@openssh.org", 16, 16, 0, EVP_camellia_128_cbc}, |
| 312 |
|
{SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc@openssh.org", 16, 24, 0, EVP_camellia_192_cbc}, |
| 313 |
|
{SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc@openssh.org", 16, 32, 0, EVP_camellia_256_cbc}, |
| 314 |
|
{SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr@openssh.org", 16, 16, 0, evp_camellia_128_ctr}, |
| 315 |
|
{SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr@openssh.org", 16, 24, 0, evp_camellia_128_ctr}, |
| 316 |
|
{SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr@openssh.org", 16, 32, 0, evp_camellia_128_ctr}, |
| 317 |
|
#endif // WITH_CAMELLIA_PRIVATE |
| 318 |
|
#endif // WITH_CAMELLIA_DRAFT |
| 319 |
{SSH_CIPHER_NONE, NULL, 0, 0, 0, NULL}, |
{SSH_CIPHER_NONE, NULL, 0, 0, 0, NULL}, |
| 320 |
}; |
}; |
| 321 |
|
|
| 381 |
{HMAC_SHA1_96, "hmac-sha1-96", EVP_sha1, 96}, |
{HMAC_SHA1_96, "hmac-sha1-96", EVP_sha1, 96}, |
| 382 |
{HMAC_MD5_96, "hmac-md5-96", EVP_md5, 96}, |
{HMAC_MD5_96, "hmac-md5-96", EVP_md5, 96}, |
| 383 |
{HMAC_RIPEMD160, "hmac-ripemd160@openssh.com", EVP_ripemd160, 0}, |
{HMAC_RIPEMD160, "hmac-ripemd160@openssh.com", EVP_ripemd160, 0}, |
| 384 |
#if HMAC_SHA2_DRAFT // HMAC-SHA2 support |
#ifdef HMAC_SHA2_DRAFT // HMAC-SHA2 support |
| 385 |
{HMAC_SHA2_256, "hmac-sha2-256", EVP_sha256, 0}, |
{HMAC_SHA2_256, "hmac-sha2-256", EVP_sha256, 0}, |
| 386 |
{HMAC_SHA2_256_96, "hmac-sha2-256-96", EVP_sha256, 96}, |
{HMAC_SHA2_256_96, "hmac-sha2-256-96", EVP_sha256, 96}, |
| 387 |
{HMAC_SHA2_512, "hmac-sha2-512", EVP_sha512, 0}, |
{HMAC_SHA2_512, "hmac-sha2-512", EVP_sha512, 0}, |
|
|
Legend:
| Removed from v.4427 |
|
| changed lines |
| |
Added in v.4433 |
|
|
| |