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 <sys/types.h>
This commit is contained in:
Piraty 2018-03-14 18:11:33 +01:00 committed by TheZ3ro
parent 3353b329fc
commit 123701080d
3 changed files with 23 additions and 13 deletions

View File

@ -34,17 +34,7 @@
#ifndef _BLF_H_
#define _BLF_H_
#ifdef _WIN32
#include <stdint.h>
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)

View File

@ -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 <sys/types.h>
#ifdef HAVE_BLF_H
#include "blf.h"
#include <blf.h>
#endif
#undef inline

20
src/sshagent/includes.h Normal file
View File

@ -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 <sys/types.h>
#ifdef _WIN32
#include <stdint.h>
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