summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-06-14 23:21:32 +1000
committerDarren Tucker <dtucker@zip.com.au>2007-06-14 23:21:32 +1000
commitcb52017ad9024e4d72766a19f286addcdafc2374 (patch)
tree739207c3be6c98d5efab88fbfdd93a403c1b568c
parentbed63112f5a1f52b255f03bc2f457eaab5001e0c (diff)
- (dtucker) [cipher-ctr.c umac.c openbsd-compat/openssl-compat.h] Move the
USE_BUILTIN_RIJNDAEL compat goop to openssl-compat.h so it can be shared with umac.c. Allows building with OpenSSL 0.9.5 again including umac support. With tim@ djm@, ok djm.
-rw-r--r--ChangeLog8
-rw-r--r--cipher-ctr.c8
-rw-r--r--openbsd-compat/openssl-compat.h11
-rw-r--r--umac.c5
4 files changed, 22 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 9cbab13e..dda00d04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+20070614
+ - (dtucker) [cipher-ctr.c umac.c openbsd-compat/openssl-compat.h] Move the
+ USE_BUILTIN_RIJNDAEL compat goop to openssl-compat.h so it can be
+ shared with umac.c. Allows building with OpenSSL 0.9.5 again including
+ umac support. With tim@ djm@, ok djm.
+
20070612
- (dtucker) OpenBSD CVS Sync
- markus@cvs.openbsd.org 2007/06/11 09:14:00
@@ -3061,4 +3067,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
-$Id: ChangeLog,v 1.4699 2007/06/12 14:02:07 dtucker Exp $
+$Id: ChangeLog,v 1.4700 2007/06/14 13:21:32 dtucker Exp $
diff --git a/cipher-ctr.c b/cipher-ctr.c
index b24f3a42..3b86cc10 100644
--- a/cipher-ctr.c
+++ b/cipher-ctr.c
@@ -29,13 +29,7 @@
/* compatibility with old or broken OpenSSL versions */
#include "openbsd-compat/openssl-compat.h"
-#ifdef USE_BUILTIN_RIJNDAEL
-#include "rijndael.h"
-#define AES_KEY rijndael_ctx
-#define AES_BLOCK_SIZE 16
-#define AES_encrypt(a, b, c) rijndael_encrypt(c, a, b)
-#define AES_set_encrypt_key(a, b, c) rijndael_set_key(c, (char *)a, b, 1)
-#else
+#ifndef USE_BUILTIN_RIJNDAEL
#include <openssl/aes.h>
#endif
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
index 9b5ccff5..01efb9cf 100644
--- a/openbsd-compat/openssl-compat.h
+++ b/openbsd-compat/openssl-compat.h
@@ -1,4 +1,4 @@
-/* $Id: openssl-compat.h,v 1.7 2007/03/05 07:25:20 dtucker Exp $ */
+/* $Id: openssl-compat.h,v 1.8 2007/06/14 13:21:33 dtucker Exp $ */
/*
* Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au>
@@ -22,6 +22,15 @@
#if OPENSSL_VERSION_NUMBER < 0x00906000L
# define SSH_OLD_EVP
# define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
+# define USE_BUILTIN_RIJNDAEL
+#endif
+
+#ifdef USE_BUILTIN_RIJNDAEL
+# include "rijndael.h"
+# define AES_KEY rijndael_ctx
+# define AES_BLOCK_SIZE 16
+# define AES_encrypt(a, b, c) rijndael_encrypt(c, a, b)
+# define AES_set_encrypt_key(a, b, c) rijndael_set_key(c, (char *)a, b, 1)
#endif
#if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES)
diff --git a/umac.c b/umac.c
index 29c202a2..c2fdcf44 100644
--- a/umac.c
+++ b/umac.c
@@ -165,7 +165,10 @@ static void STORE_UINT32_REVERSED(void *ptr, UINT32 x)
#define AES_BLOCK_LEN 16
/* OpenSSL's AES */
-#include <openssl/aes.h>
+#include "openbsd-compat/openssl-compat.h"
+#ifndef USE_BUILTIN_RIJNDAEL
+# include <openssl/aes.h>
+#endif
typedef AES_KEY aes_int_key[1];
#define aes_encryption(in,out,int_key) \
AES_encrypt((u_char *)(in),(u_char *)(out),(AES_KEY *)int_key)