summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-05-17 07:42:39 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-05-17 07:42:39 +0000
commit740d537d7eee4a66617adad78f2e9bbde0201bc3 (patch)
treef04cd8e794cee56ebbc0e0a651983fa18ca42190 /lib
parent10c5d1ee81ed9ba0f1a9f98094e79bbb3e60d500 (diff)
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 4a757b02ceb..1dff1b05622 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.7 2023/03/27 10:25:02 tb Exp $ */
+/* $OpenBSD: bn_isqrt.c,v 1.8 2023/05/17 07:42:38 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 5d317a81c00..5b1d1b090ba 100644
--- a/lib/libcrypto/crypto_lock.c
+++ b/lib/libcrypto/crypto_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto_lock.c,v 1.2 2018/11/28 15:51:32 jsing Exp $ */
+/* $OpenBSD: crypto_lock.c,v 1.3 2023/05/17 07:42:38 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