Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crypto/fipsmodule/bn/exponentiation.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@

#if !defined(OPENSSL_NO_ASM) && \
(defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE) || \
defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD)) && \
defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD) || \
defined(OPENSSL_NETBSD)) && \
defined(OPENSSL_AARCH64)

#include "../../../third_party/s2n-bignum/s2n-bignum_aws-lc.h"
Expand Down Expand Up @@ -1296,7 +1297,7 @@ int BN_mod_exp_mont_consttime_x2(BIGNUM *rr1, const BIGNUM *a1, const BIGNUM *p1
if (!bn_wexpand(rr2, widthn)) {
return ret;
}

/* Ensure that montgomery contexts are initialized */
if (in_mont1 == NULL) {
return ret;
Expand Down
3 changes: 2 additions & 1 deletion crypto/fipsmodule/bn/montgomery.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@

#if !defined(OPENSSL_NO_ASM) && \
(defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE) || \
defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD)) && \
defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD) || \
defined(OPENSS_NETBSD) ) && \
defined(OPENSSL_AARCH64) && defined(OPENSSL_BN_ASM_MONT)

#include "../../../third_party/s2n-bignum/s2n-bignum_aws-lc.h"
Expand Down
3 changes: 2 additions & 1 deletion crypto/fipsmodule/curve25519/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ int ED25519ph_verify_digest_no_self_test(
#if ((defined(OPENSSL_X86_64) && !defined(MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX)) || \
defined(OPENSSL_AARCH64)) && \
(defined(OPENSSL_LINUX) || defined(OPENSSL_APPLE) || \
defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD)) && \
defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD) || \
defined(OPENSSL_NETBSD)) && \
!defined(OPENSSL_NO_ASM)
#define CURVE25519_S2N_BIGNUM_CAPABLE
#endif
Expand Down
3 changes: 2 additions & 1 deletion crypto/rand_extra/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#elif defined(OPENSSL_WINDOWS)
#define OPENSSL_RAND_WINDOWS
#elif defined(OPENSSL_MACOS) || defined(OPENSSL_OPENBSD) || \
defined(OPENSSL_FREEBSD) || defined(OPENSSL_SOLARIS) || \
defined(OPENSSL_FREEBSD) || defined(OPENSS_NETBSD) || \
defined(OPENSSL_SOLARIS) || \
(defined(OPENSSL_LINUX) && !defined(HAVE_LINUX_RANDOM_H))
#define OPENSSL_RAND_GETENTROPY
#elif defined(OPENSSL_IOS)
Expand Down
7 changes: 6 additions & 1 deletion crypto/rand_extra/urandom.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
#include <time.h>
#include <unistd.h>

#if defined(OPENSSL_NETBSD)
#include <sys/ioctl.h>
#include <sys/rndio.h>
#endif

#if defined(OPENSSL_LINUX)
#if defined(AWS_LC_URANDOM_NEEDS_U32)
// On old Linux OS: unknown type name '__u32' when include <linux/random.h>.
Expand Down Expand Up @@ -431,7 +436,7 @@ static int fill_with_entropy(uint8_t *out, size_t len, int block, int seed) {
// Hard bail.
abort();
}
}
}

// Clear |errno| so it has defined value if |read| or |getrandom|
// "successfully" returns zero.
Expand Down
4 changes: 2 additions & 2 deletions crypto/ube/fork_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#if !defined(_GNU_SOURCE)
#define _GNU_SOURCE // Needed for madvise() and MAP_ANONYMOUS.
#endif
#elif defined(OPENSSL_FREEBSD) || defined(OPENSSL_OPENBSD)
#elif defined(OPENSSL_FREEBSD) || defined(OPENSSL_OPENBSD) || defined(OPENSSL_NETBSD)
#define AWSLC_FORK_DETECTION_SUPPORTED
// FreeBSD requires POSIX compatibility off for its syscalls
// (enables __BSD_VISIBLE). Without the below line, <sys/mman.h> cannot be
Expand Down Expand Up @@ -114,7 +114,7 @@ static int init_fork_detect_wipeonfork(void *addr, long page_size) {
#endif // defined(OPENSSL_LINUX)


#if defined(OPENSSL_FREEBSD) || defined(OPENSSL_OPENBSD)
#if defined(OPENSSL_FREEBSD) || defined(OPENSSL_OPENBSD) || defined(OPENSSL_NETBSD)

#include <sys/mman.h>
#include <unistd.h>
Expand Down
4 changes: 4 additions & 0 deletions include/openssl/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@
#define OPENSSL_OPENBSD
#endif

#if defined(__NetBSD__)
#define OPENSSL_NETBSD
#endif

#if defined(__illumos__) || (defined(__sun) && defined(__SVR4))
#define OPENSSL_SOLARIS
#endif
Expand Down
Loading