openssl-compat.h (149749) | openssl-compat.h (157016) |
---|---|
1/* $Id: openssl-compat.h,v 1.1 2005/06/09 11:45:11 dtucker Exp $ */ | 1/* $Id: openssl-compat.h,v 1.3 2005/12/19 06:40:40 dtucker Exp $ */ |
2 3/* 4 * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * --- 9 unchanged lines hidden (view full) --- 19#include "includes.h" 20#include <openssl/evp.h> 21 22#if OPENSSL_VERSION_NUMBER < 0x00906000L 23# define SSH_OLD_EVP 24# define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) 25#endif 26 | 2 3/* 4 * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * --- 9 unchanged lines hidden (view full) --- 19#include "includes.h" 20#include <openssl/evp.h> 21 22#if OPENSSL_VERSION_NUMBER < 0x00906000L 23# define SSH_OLD_EVP 24# define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) 25#endif 26 |
27#if OPENSSL_VERSION_NUMBER < 0x00907000L | 27#if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES) 28# define USE_BUILTIN_RIJNDAEL 29#endif 30 31#ifdef USE_BUILTIN_RIJNDAEL |
28# define EVP_aes_128_cbc evp_rijndael 29# define EVP_aes_192_cbc evp_rijndael 30# define EVP_aes_256_cbc evp_rijndael 31extern const EVP_CIPHER *evp_rijndael(void); 32extern void ssh_rijndael_iv(EVP_CIPHER_CTX *, int, u_char *, u_int); 33#endif 34 35#if !defined(EVP_CTRL_SET_ACSS_MODE) 36# if (OPENSSL_VERSION_NUMBER >= 0x00907000L) 37# define USE_CIPHER_ACSS 1 38extern const EVP_CIPHER *evp_acss(void); 39# define EVP_acss evp_acss 40# else 41# define EVP_acss NULL 42# endif 43#endif 44 45/* | 32# define EVP_aes_128_cbc evp_rijndael 33# define EVP_aes_192_cbc evp_rijndael 34# define EVP_aes_256_cbc evp_rijndael 35extern const EVP_CIPHER *evp_rijndael(void); 36extern void ssh_rijndael_iv(EVP_CIPHER_CTX *, int, u_char *, u_int); 37#endif 38 39#if !defined(EVP_CTRL_SET_ACSS_MODE) 40# if (OPENSSL_VERSION_NUMBER >= 0x00907000L) 41# define USE_CIPHER_ACSS 1 42extern const EVP_CIPHER *evp_acss(void); 43# define EVP_acss evp_acss 44# else 45# define EVP_acss NULL 46# endif 47#endif 48 49/* |
46 * insert comment here | 50 * We overload some of the OpenSSL crypto functions with ssh_* equivalents 51 * which cater for older and/or less featureful OpenSSL version. 52 * 53 * In order for the compat library to call the real functions, it must 54 * define SSH_DONT_OVERLOAD_OPENSSL_FUNCS before including this file and 55 * implement the ssh_* equivalents. |
47 */ 48#ifdef SSH_OLD_EVP 49 50# ifndef SSH_DONT_REDEF_EVP 51 52# ifdef EVP_Cipher 53# undef EVP_Cipher 54# endif 55 56# define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) 57# define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) 58# define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) 59# endif 60 61int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, 62 unsigned char *, int); 63int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); 64int ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); 65#endif | 56 */ 57#ifdef SSH_OLD_EVP 58 59# ifndef SSH_DONT_REDEF_EVP 60 61# ifdef EVP_Cipher 62# undef EVP_Cipher 63# endif 64 65# define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) 66# define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) 67# define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) 68# endif 69 70int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, 71 unsigned char *, int); 72int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); 73int ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); 74#endif |