diff options
Diffstat (limited to 'cipher.h')
-rw-r--r-- | cipher.h | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -11,7 +11,7 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | /* RCSID("$Id: cipher.h,v 1.6 2000/03/26 03:04:52 damien Exp $"); */ | 14 | /* RCSID("$Id: cipher.h,v 1.7 2000/04/01 01:09:23 damien Exp $"); */ |
15 | 15 | ||
16 | #ifndef CIPHER_H | 16 | #ifndef CIPHER_H |
17 | #define CIPHER_H | 17 | #define CIPHER_H |
@@ -21,10 +21,14 @@ | |||
21 | #ifdef HAVE_OPENSSL | 21 | #ifdef HAVE_OPENSSL |
22 | #include <openssl/des.h> | 22 | #include <openssl/des.h> |
23 | #include <openssl/blowfish.h> | 23 | #include <openssl/blowfish.h> |
24 | #include <openssl/rc4.h> | ||
25 | #include <openssl/cast.h> | ||
24 | #endif | 26 | #endif |
25 | #ifdef HAVE_SSL | 27 | #ifdef HAVE_SSL |
26 | #include <ssl/des.h> | 28 | #include <ssl/des.h> |
27 | #include <ssl/blowfish.h> | 29 | #include <ssl/blowfish.h> |
30 | #include <ssl/rc4.h> | ||
31 | #include <ssl/cast.h> | ||
28 | #endif | 32 | #endif |
29 | 33 | ||
30 | /* Cipher types. New types can be added, but old types should not be removed | 34 | /* Cipher types. New types can be added, but old types should not be removed |
@@ -37,6 +41,13 @@ | |||
37 | #define SSH_CIPHER_BROKEN_TSS 4 /* TRI's Simple Stream encryption CBC */ | 41 | #define SSH_CIPHER_BROKEN_TSS 4 /* TRI's Simple Stream encryption CBC */ |
38 | #define SSH_CIPHER_BROKEN_RC4 5 /* Alleged RC4 */ | 42 | #define SSH_CIPHER_BROKEN_RC4 5 /* Alleged RC4 */ |
39 | #define SSH_CIPHER_BLOWFISH 6 | 43 | #define SSH_CIPHER_BLOWFISH 6 |
44 | #define SSH_CIPHER_RESERVED 7 | ||
45 | |||
46 | /* these ciphers are used in SSH2: */ | ||
47 | #define SSH_CIPHER_BLOWFISH_CBC 8 | ||
48 | #define SSH_CIPHER_3DES_CBC 9 | ||
49 | #define SSH_CIPHER_ARCFOUR 10 /* Alleged RC4 */ | ||
50 | #define SSH_CIPHER_CAST128_CBC 11 | ||
40 | 51 | ||
41 | typedef struct { | 52 | typedef struct { |
42 | unsigned int type; | 53 | unsigned int type; |
@@ -52,6 +63,11 @@ typedef struct { | |||
52 | struct bf_key_st key; | 63 | struct bf_key_st key; |
53 | unsigned char iv[8]; | 64 | unsigned char iv[8]; |
54 | } bf; | 65 | } bf; |
66 | struct { | ||
67 | CAST_KEY key; | ||
68 | unsigned char iv[8]; | ||
69 | } cast; | ||
70 | RC4_KEY rc4; | ||
55 | } u; | 71 | } u; |
56 | } CipherContext; | 72 | } CipherContext; |
57 | /* | 73 | /* |
@@ -77,6 +93,10 @@ int cipher_number(const char *name); | |||
77 | void | 93 | void |
78 | cipher_set_key(CipherContext * context, int cipher, | 94 | cipher_set_key(CipherContext * context, int cipher, |
79 | const unsigned char *key, int keylen, int for_encryption); | 95 | const unsigned char *key, int keylen, int for_encryption); |
96 | void | ||
97 | cipher_set_key_iv(CipherContext * context, int cipher, | ||
98 | const unsigned char *key, int keylen, | ||
99 | const unsigned char *iv, int ivlen); | ||
80 | 100 | ||
81 | /* | 101 | /* |
82 | * Sets key for the cipher by computing the MD5 checksum of the passphrase, | 102 | * Sets key for the cipher by computing the MD5 checksum of the passphrase, |