summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-06-04 17:28:36 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-06-04 17:28:36 +0000
commitf146e0cbe26c3130bff8fc646a4b490891ad872b (patch)
treef0d142f1800ee919b9b30cbf843a9d5d5c0dd5f5 /lib
parentea4a5e30513d1dfbfd90c23b7b958a9b25981c5e (diff)
Reinstate bn_isqrt.c r1.8 and crypto_lock.c r1.3
This traded local copies of CTASSERT() to the one in crypto_internal.h. This change was backed out due to SHA-512 breakage on STRICT_ALIGNMENT architectures still using Fred Flintstone's gcc without asm sha512. Original commit message: Use crypto_internal.h's CTASSERT() Now that this macro is available in a header, let's use that version rather than copies in several .c files. discussed with jsing
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/bn/bn_isqrt.c6
-rw-r--r--lib/libcrypto/crypto_lock.c7
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/libcrypto/bn/bn_isqrt.c b/lib/libcrypto/bn/bn_isqrt.c
index d24a4a43baa..018d5f34bd8 100644
--- a/lib/libcrypto/bn/bn_isqrt.c
+++ b/lib/libcrypto/bn/bn_isqrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_isqrt.c,v 1.9 2023/05/19 00:54:28 deraadt Exp $ */
+/* $OpenBSD: bn_isqrt.c,v 1.10 2023/06/04 17:28:35 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
*
@@ -22,9 +22,7 @@
#include <openssl/err.h>
#include "bn_local.h"
-
-#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \
- __attribute__((__unused__))
+#include "crypto_internal.h"
/*
* Calculate integer square root of |n| using a variant of Newton's method.
diff --git a/lib/libcrypto/crypto_lock.c b/lib/libcrypto/crypto_lock.c
index bd8315c264e..6d9dbab22bd 100644
--- a/lib/libcrypto/crypto_lock.c
+++ b/lib/libcrypto/crypto_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto_lock.c,v 1.4 2023/05/19 00:54:27 deraadt Exp $ */
+/* $OpenBSD: crypto_lock.c,v 1.5 2023/06/04 17:28:35 tb Exp $ */
/*
* Copyright (c) 2018 Brent Cook <bcook@openbsd.org>
*
@@ -19,6 +19,8 @@
#include <openssl/crypto.h>
+#include "crypto_internal.h"
+
static pthread_mutex_t locks[] = {
PTHREAD_MUTEX_INITIALIZER,
PTHREAD_MUTEX_INITIALIZER,
@@ -63,9 +65,6 @@ static pthread_mutex_t locks[] = {
PTHREAD_MUTEX_INITIALIZER,
};
-#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \
- __attribute__((__unused__))
-
CTASSERT((sizeof(locks) / sizeof(*locks)) == CRYPTO_NUM_LOCKS);
void