From c491b0def1ac7b468bc6ce3ceffc3493b102ca1d Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Mon, 15 Jul 2002 17:52:49 +0000 Subject: - markus@cvs.openbsd.org 2002/07/12 15:50:17 [cipher.c] EVP_CIPH_CUSTOM_IV for our own rijndael --- cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cipher.c') diff --git a/cipher.c b/cipher.c index 6db340d7a..9e8ef999b 100644 --- a/cipher.c +++ b/cipher.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.60 2002/06/23 03:26:52 deraadt Exp $"); +RCSID("$OpenBSD: cipher.c,v 1.61 2002/07/12 15:50:17 markus Exp $"); #include "xmalloc.h" #include "log.h" @@ -567,7 +567,7 @@ evp_rijndael(void) rijndal_cbc.do_cipher = ssh_rijndael_cbc; #ifndef SSH_OLD_EVP rijndal_cbc.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | - EVP_CIPH_ALWAYS_CALL_INIT; + EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV; #endif return (&rijndal_cbc); } -- cgit v1.2.3 From c34e03e4711cabffae3504bcfdac26b67250c45d Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 10 Sep 2002 22:26:17 +1000 Subject: - (djm) Bug #138: Make protocol 1 blowfish work with old OpenSSL. Patch from Robert Halubek --- ChangeLog | 4 +++- cipher.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'cipher.c') diff --git a/ChangeLog b/ChangeLog index f71dacaf2..8298194a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20020910 - (djm) Bug #365: Read /.ssh/environment properly under CygWin. Patch from Mark Bradshaw + - (djm) Bug #138: Make protocol 1 blowfish work with old OpenSSL. + Patch from Robert Halubek 20020905 - (djm) OpenBSD CVS Sync @@ -1612,4 +1614,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2449 2002/09/10 11:43:53 djm Exp $ +$Id: ChangeLog,v 1.2450 2002/09/10 12:26:17 djm Exp $ diff --git a/cipher.c b/cipher.c index 9e8ef999b..1933d3eab 100644 --- a/cipher.c +++ b/cipher.c @@ -437,6 +437,18 @@ swap_bytes(const u_char *src, u_char *dst, int n) } } +#ifdef SSH_OLD_EVP +static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key, + const unsigned char *iv, int enc) +{ + if (iv != NULL) + memcpy (&(ctx->oiv[0]), iv, 8); + memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8); + if (key != NULL) + BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx), + key); +} +#endif static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL; static int @@ -458,6 +470,9 @@ evp_ssh1_bf(void) memcpy(&ssh1_bf, EVP_bf_cbc(), sizeof(EVP_CIPHER)); orig_bf = ssh1_bf.do_cipher; ssh1_bf.nid = NID_undef; +#ifdef SSH_OLD_EVP + ssh1_bf.init = bf_ssh1_init; +#endif ssh1_bf.do_cipher = bf_ssh1_cipher; ssh1_bf.key_len = 32; return (&ssh1_bf); -- cgit v1.2.3