From 123701080dbb8821c776a69f47b4e5b20ef79f08 Mon Sep 17 00:00:00 2001 From: Piraty Date: Wed, 14 Mar 2018 18:11:33 +0100 Subject: [PATCH] Keep openSSH-portable's blowfish code unmodified and use a stub "includes.h". This also fixes build issues against musl-libc, which does not implicitly include --- src/sshagent/blf.h | 12 +----------- src/sshagent/blowfish.c | 4 ++-- src/sshagent/includes.h | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 src/sshagent/includes.h diff --git a/src/sshagent/blf.h b/src/sshagent/blf.h index 4878e5588..f1ac5a5c2 100644 --- a/src/sshagent/blf.h +++ b/src/sshagent/blf.h @@ -34,17 +34,7 @@ #ifndef _BLF_H_ #define _BLF_H_ -#ifdef _WIN32 - -#include - -typedef uint32_t u_int32_t; -typedef uint16_t u_int16_t; -typedef uint8_t u_int8_t; - -#define bzero(p,s) memset(p, 0, s) - -#endif +#include "includes.h" #if !defined(HAVE_BCRYPT_PBKDF) && !defined(HAVE_BLH_H) diff --git a/src/sshagent/blowfish.c b/src/sshagent/blowfish.c index 02e9ac0bd..e10f7e7d9 100644 --- a/src/sshagent/blowfish.c +++ b/src/sshagent/blowfish.c @@ -39,7 +39,7 @@ * Bruce Schneier. */ -#define HAVE_BLF_H +#include "includes.h" #if !defined(HAVE_BCRYPT_PBKDF) && (!defined(HAVE_BLOWFISH_INITSTATE) || \ !defined(HAVE_BLOWFISH_EXPAND0STATE) || !defined(HAVE_BLF_ENC)) @@ -51,7 +51,7 @@ #include #ifdef HAVE_BLF_H -#include "blf.h" +#include #endif #undef inline diff --git a/src/sshagent/includes.h b/src/sshagent/includes.h new file mode 100644 index 000000000..c6bb4d32e --- /dev/null +++ b/src/sshagent/includes.h @@ -0,0 +1,20 @@ +// mimic openSSH-portable's includes.h file to be able to use +// its unmodified blowfish code + +#define HAVE_BLF_H + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* activate extra prototypes for glibc */ +#endif +#include + + +#ifdef _WIN32 +#include + +typedef uint32_t u_int32_t; +typedef uint16_t u_int16_t; +typedef uint8_t u_int8_t; + +#define bzero(p,s) memset(p, 0, s) +#endif