aboutsummaryrefslogtreecommitdiff
path: root/contrib/libfido2/openbsd-compat/openbsd-compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libfido2/openbsd-compat/openbsd-compat.h')
-rw-r--r--contrib/libfido2/openbsd-compat/openbsd-compat.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/contrib/libfido2/openbsd-compat/openbsd-compat.h b/contrib/libfido2/openbsd-compat/openbsd-compat.h
index 1be3aa295051..9f1ea3e7cf51 100644
--- a/contrib/libfido2/openbsd-compat/openbsd-compat.h
+++ b/contrib/libfido2/openbsd-compat/openbsd-compat.h
@@ -1,7 +1,8 @@
/*
- * 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.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef _OPENBSD_COMPAT_H
@@ -20,6 +21,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 +35,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 +55,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 +87,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
@@ -116,4 +116,8 @@ ssize_t getline(char **, size_t *, FILE *);
#define IOCTL_REQ(x) ((int)(x))
#endif
+#if !defined(HAVE_ASPRINTF)
+int asprintf(char **, const char *, ...);
+#endif
+
#endif /* !_OPENBSD_COMPAT_H */