diff options
author | Damien Miller <djm@mindrot.org> | 2000-04-01 11:09:21 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-04-01 11:09:21 +1000 |
commit | b38eff8e4ff901df9cf1113a9f14d64c3565a401 (patch) | |
tree | 9a856898f15f7760ed95c5d47789a6f954b4ad2f /cipher.h | |
parent | 450a7a1ff40fe7c2d84c93b83cf2df53445d807d (diff) |
- Big OpenBSD CVS update (mainly beginnings of SSH2 infrastructure)
- [auth.c session.c sshd.c auth.h]
split sshd.c -> auth.c session.c sshd.c plus cleanup and goto-removal
- [bufaux.c bufaux.h]
support ssh2 bignums
- [channels.c channels.h clientloop.c sshd.c nchan.c nchan.h packet.c]
[readconf.c ssh.c ssh.h serverloop.c]
replace big switch() with function tables (prepare for ssh2)
- [ssh2.h]
ssh2 message type codes
- [sshd.8]
reorder Xr to avoid cutting
- [serverloop.c]
close(fdin) if fdin != fdout, shutdown otherwise, ok theo@
- [channels.c]
missing close
allow bigger packets
- [cipher.c cipher.h]
support ssh2 ciphers
- [compress.c]
cleanup, less code
- [dispatch.c dispatch.h]
function tables for different message types
- [log-server.c]
do not log() if debuggin to stderr
rename a cpp symbol, to avoid param.h collision
- [mpaux.c]
KNF
- [nchan.c]
sync w/ channels.c
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, |