summaryrefslogtreecommitdiff
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 9cbab13e2..dda00d04d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
120070614
2 - (dtucker) [cipher-ctr.c umac.c openbsd-compat/openssl-compat.h] Move the
3 USE_BUILTIN_RIJNDAEL compat goop to openssl-compat.h so it can be
4 shared with umac.c. Allows building with OpenSSL 0.9.5 again including
5 umac support. With tim@ djm@, ok djm.
6
120070612 720070612
2 - (dtucker) OpenBSD CVS Sync 8 - (dtucker) OpenBSD CVS Sync
3 - markus@cvs.openbsd.org 2007/06/11 09:14:00 9 - markus@cvs.openbsd.org 2007/06/11 09:14:00
@@ -3061,4 +3067,4 @@
3061 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3067 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3062 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3068 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3063 3069
3064$Id: ChangeLog,v 1.4699 2007/06/12 14:02:07 dtucker Exp $ 3070$Id: ChangeLog,v 1.4700 2007/06/14 13:21:32 dtucker Exp $
diff --git a/cipher-ctr.c b/cipher-ctr.c
index b24f3a428..3b86cc10b 100644
--- a/cipher-ctr.c
+++ b/cipher-ctr.c
@@ -29,13 +29,7 @@
29/* compatibility with old or broken OpenSSL versions */ 29/* compatibility with old or broken OpenSSL versions */
30#include "openbsd-compat/openssl-compat.h" 30#include "openbsd-compat/openssl-compat.h"
31 31
32#ifdef USE_BUILTIN_RIJNDAEL 32#ifndef USE_BUILTIN_RIJNDAEL
33#include "rijndael.h"
34#define AES_KEY rijndael_ctx
35#define AES_BLOCK_SIZE 16
36#define AES_encrypt(a, b, c) rijndael_encrypt(c, a, b)
37#define AES_set_encrypt_key(a, b, c) rijndael_set_key(c, (char *)a, b, 1)
38#else
39#include <openssl/aes.h> 33#include <openssl/aes.h>
40#endif 34#endif
41 35
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
index 9b5ccff5f..01efb9cfa 100644
--- a/openbsd-compat/openssl-compat.h
+++ b/openbsd-compat/openssl-compat.h
@@ -1,4 +1,4 @@
1/* $Id: openssl-compat.h,v 1.7 2007/03/05 07:25:20 dtucker Exp $ */ 1/* $Id: openssl-compat.h,v 1.8 2007/06/14 13:21:33 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> 4 * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au>
@@ -22,6 +22,15 @@
22#if OPENSSL_VERSION_NUMBER < 0x00906000L 22#if OPENSSL_VERSION_NUMBER < 0x00906000L
23# define SSH_OLD_EVP 23# define SSH_OLD_EVP
24# define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) 24# define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
25# define USE_BUILTIN_RIJNDAEL
26#endif
27
28#ifdef USE_BUILTIN_RIJNDAEL
29# include "rijndael.h"
30# define AES_KEY rijndael_ctx
31# define AES_BLOCK_SIZE 16
32# define AES_encrypt(a, b, c) rijndael_encrypt(c, a, b)
33# define AES_set_encrypt_key(a, b, c) rijndael_set_key(c, (char *)a, b, 1)
25#endif 34#endif
26 35
27#if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES) 36#if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES)
diff --git a/umac.c b/umac.c
index 29c202a21..c2fdcf448 100644
--- a/umac.c
+++ b/umac.c
@@ -165,7 +165,10 @@ static void STORE_UINT32_REVERSED(void *ptr, UINT32 x)
165#define AES_BLOCK_LEN 16 165#define AES_BLOCK_LEN 16
166 166
167/* OpenSSL's AES */ 167/* OpenSSL's AES */
168#include <openssl/aes.h> 168#include "openbsd-compat/openssl-compat.h"
169#ifndef USE_BUILTIN_RIJNDAEL
170# include <openssl/aes.h>
171#endif
169typedef AES_KEY aes_int_key[1]; 172typedef AES_KEY aes_int_key[1];
170#define aes_encryption(in,out,int_key) \ 173#define aes_encryption(in,out,int_key) \
171 AES_encrypt((u_char *)(in),(u_char *)(out),(AES_KEY *)int_key) 174 AES_encrypt((u_char *)(in),(u_char *)(out),(AES_KEY *)int_key)