From 8aae6ff0d9e3b78204288f1db671ccd60614e10b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 7 Mar 2009 12:01:47 +1100 Subject: [PATCH] - (dtucker) [schnorr.c openbsd-compat/openssl-compat.{c,h}] Add EVP_DigestUpdate to the OLD_EVP compatibility functions and tell schnorr.c to use them. Allows building with older OpenSSL versions. --- ChangeLog | 3 +++ openbsd-compat/openssl-compat.c | 9 ++++++++- openbsd-compat/openssl-compat.h | 3 ++- schnorr.c | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6964dcffa..410c766af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ - (dtucker) [contrib/aix/buildbff.sh] Only try to rename ssh_prng_cmds if it exists (it's not created if OpenSSL's PRNG is self-seeded, eg if the OS has a /dev/random). + - (dtucker) [schnorr.c openbsd-compat/openssl-compat.{c,h}] Add + EVP_DigestUpdate to the OLD_EVP compatibility functions and tell schnorr.c + to use them. Allows building with older OpenSSL versions. 20090306 - (djm) OpenBSD CVS Sync diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index 49238ba80..f5435784b 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.c,v 1.6 2008/02/28 08:13:52 dtucker Exp $ */ +/* $Id: openssl-compat.c,v 1.7 2009/03/07 01:01:47 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -47,6 +47,13 @@ ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *evp) EVP_CIPHER_CTX_cleanup(evp); return 1; } + +int +ssh_EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt) +{ + EVP_DigestUpdate(ctx, d, cnt); + return 1; +} #endif #ifdef USE_OPENSSL_ENGINE diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 6a1bed5b2..945a7a300 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.h,v 1.12 2008/02/28 08:22:04 dtucker Exp $ */ +/* $Id: openssl-compat.h,v 1.13 2009/03/07 01:01:47 dtucker Exp $ */ /* * Copyright (c) 2005 Darren Tucker @@ -78,6 +78,7 @@ extern const EVP_CIPHER *evp_acss(void); # define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) # define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) # define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) +# define EVP_DigestUpdate(a,b,c) ssh_EVP_DigestUpdate((a),(b),(c)) # endif /* SSH_OLD_EVP */ # ifdef USE_OPENSSL_ENGINE diff --git a/schnorr.c b/schnorr.c index 7b97b5565..c17ff3241 100644 --- a/schnorr.c +++ b/schnorr.c @@ -42,6 +42,8 @@ #include "schnorr.h" +#include "openbsd-compat/openssl-compat.h" + /* #define SCHNORR_DEBUG */ /* Privacy-violating debugging */ /* #define SCHNORR_MAIN */ /* Include main() selftest */