summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/cipher.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2004-12-22 02:13:19 +0000
committerdjm <djm@openbsd.org>2004-12-22 02:13:19 +0000
commit63b59a4caddb055b02da1d381b1901f953723f09 (patch)
tree02486ea28fe123c6d5993dfb83ed680fb7336508 /usr.bin/ssh/cipher.c
parentspacing (diff)
downloadwireguard-openbsd-63b59a4caddb055b02da1d381b1901f953723f09.tar.xz
wireguard-openbsd-63b59a4caddb055b02da1d381b1901f953723f09.zip
remove fallback AES support for old OpenSSL, as OpenBSD has had it for many
years now; ok deraadt@
Diffstat (limited to 'usr.bin/ssh/cipher.c')
-rw-r--r--usr.bin/ssh/cipher.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c
index 04a9895794f..0fa30007f10 100644
--- a/usr.bin/ssh/cipher.c
+++ b/usr.bin/ssh/cipher.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.71 2004/07/28 09:40:29 markus Exp $");
+RCSID("$OpenBSD: cipher.c,v 1.72 2004/12/22 02:13:19 djm Exp $");
#include "xmalloc.h"
#include "log.h"
@@ -43,10 +43,6 @@ RCSID("$OpenBSD: cipher.c,v 1.71 2004/07/28 09:40:29 markus Exp $");
#include <openssl/md5.h>
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
-extern const EVP_CIPHER *evp_rijndael(void);
-extern void ssh_rijndael_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
-#endif
extern const EVP_CIPHER *evp_ssh1_bf(void);
extern const EVP_CIPHER *evp_ssh1_3des(void);
extern void ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int);
@@ -69,19 +65,11 @@ struct Cipher {
{ "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, EVP_bf_cbc },
{ "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, EVP_cast5_cbc },
{ "arcfour", SSH_CIPHER_SSH2, 8, 16, EVP_rc4 },
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
- { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, evp_rijndael },
- { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, evp_rijndael },
- { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, evp_rijndael },
- { "rijndael-cbc@lysator.liu.se",
- SSH_CIPHER_SSH2, 16, 32, evp_rijndael },
-#else
{ "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, EVP_aes_128_cbc },
{ "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, EVP_aes_192_cbc },
{ "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
{ "rijndael-cbc@lysator.liu.se",
SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
-#endif
{ "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, evp_aes_128_ctr },
{ "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, evp_aes_128_ctr },
{ "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, evp_aes_128_ctr },
@@ -311,11 +299,6 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
if (evplen != len)
fatal("%s: wrong iv length %d != %d", __func__,
evplen, len);
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
- if (c->evptype == evp_rijndael)
- ssh_rijndael_iv(&cc->evp, 0, iv, len);
- else
-#endif
if (c->evptype == evp_aes_128_ctr)
ssh_aes_ctr_iv(&cc->evp, 0, iv, len);
else
@@ -342,11 +325,6 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
if (evplen == 0)
return;
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
- if (c->evptype == evp_rijndael)
- ssh_rijndael_iv(&cc->evp, 1, iv, evplen);
- else
-#endif
if (c->evptype == evp_aes_128_ctr)
ssh_aes_ctr_iv(&cc->evp, 1, iv, evplen);
else
@@ -360,13 +338,8 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
}
}
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
-#define EVP_X_STATE(evp) &(evp).c
-#define EVP_X_STATE_LEN(evp) sizeof((evp).c)
-#else
#define EVP_X_STATE(evp) (evp).cipher_data
#define EVP_X_STATE_LEN(evp) (evp).cipher->ctx_size
-#endif
int
cipher_get_keycontext(const CipherContext *cc, u_char *dat)