diff options
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 1be3aa295051..dc9acec4c0a8 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Yubico AB. All rights reserved. + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ @@ -20,6 +20,7 @@ #define be16toh(x) OSSwapBigToHostInt16((x)) #define htobe16(x) OSSwapHostToBigInt16((x)) #define be32toh(x) OSSwapBigToHostInt32((x)) +#define htobe32(x) OSSwapHostToBigInt32((x)) #define htole32(x) OSSwapHostToLittleInt32((x)) #define htole64(x) OSSwapHostToLittleInt64((x)) #endif /* __APPLE__ && !HAVE_ENDIAN_H */ @@ -33,11 +34,12 @@ #define be16toh(x) ntohs((x)) #define htobe16(x) htons((x)) #define be32toh(x) ntohl((x)) +#define htobe32(x) htonl((x)) uint32_t htole32(uint32_t); uint64_t htole64(uint64_t); #endif /* _WIN32 && !HAVE_ENDIAN_H */ -#if defined(__FreeBSD__) && !defined(HAVE_ENDIAN_H) +#if (defined(__FreeBSD__) || defined(__MidnightBSD__)) && !defined(HAVE_ENDIAN_H) #include <sys/endian.h> #endif @@ -52,6 +54,10 @@ size_t strlcat(char *, const char *, size_t); size_t strlcpy(char *, const char *, size_t); #endif +#if !defined(HAVE_STRSEP) +char *strsep(char **, const char *); +#endif + #if !defined(HAVE_RECALLOCARRAY) void *recallocarray(void *, size_t, size_t, size_t); #endif @@ -80,13 +86,6 @@ int timingsafe_bcmp(const void *, const void *, size_t); #include <openssl/opensslv.h> -#if OPENSSL_VERSION_NUMBER < 0x10100000L -#include <stdint.h> -#include "hkdf.h" -#define EVP_PKEY_get0_EC_KEY(x) ((x)->pkey.ec) -#define EVP_PKEY_get0_RSA(x) ((x)->pkey.rsa) -#endif - #if !defined(HAVE_ERR_H) #include "err.h" #else |