]> andersk Git - openssh.git/blobdiff - cipher.c
- stevesk@cvs.openbsd.org 2006/07/05 02:42:09
[openssh.git] / cipher.c
index 20d0a80c43d7229c5fabd72467202ceba44ee0cd..c429638974fd9c5932ae9160533979590eeed722 100644 (file)
--- a/cipher.c
+++ b/cipher.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: cipher.c,v 1.79 2006/03/25 13:17:01 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -35,7 +36,6 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.76 2005/06/17 02:44:32 djm Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -43,6 +43,9 @@ RCSID("$OpenBSD: cipher.c,v 1.76 2005/06/17 02:44:32 djm Exp $");
 
 #include <openssl/md5.h>
 
+/* compatibility with old or broken OpenSSL versions */
+#include "openbsd-compat/openssl-compat.h"
+
 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);
@@ -246,7 +249,7 @@ cipher_init(CipherContext *cc, Cipher *cipher,
                    cipher->name);
 #endif
 
-       if (cipher->discard_len > 0) {          
+       if (cipher->discard_len > 0) {
                junk = xmalloc(cipher->discard_len);
                discard = xmalloc(cipher->discard_len);
                if (EVP_Cipher(&cc->evp, discard, junk,
@@ -331,7 +334,7 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
                if ((u_int)evplen != len)
                        fatal("%s: wrong iv length %d != %d", __func__,
                            evplen, len);
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
+#ifdef USE_BUILTIN_RIJNDAEL
                if (c->evptype == evp_rijndael)
                        ssh_rijndael_iv(&cc->evp, 0, iv, len);
                else
@@ -362,7 +365,7 @@ 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
+#ifdef USE_BUILTIN_RIJNDAEL
                if (c->evptype == evp_rijndael)
                        ssh_rijndael_iv(&cc->evp, 1, iv, evplen);
                else
This page took 0.033335 seconds and 4 git commands to generate.