diff options
| author | tb <> | 2023-05-17 07:42:38 +0000 |
|---|---|---|
| committer | tb <> | 2023-05-17 07:42:38 +0000 |
| commit | 11b2caf2d2be047efd96d29f1a2278031692364a (patch) | |
| tree | c3571a1584949460ec1e7791842855fc20abe3f0 /src | |
| parent | 5d9c22eaef33c903e296cd1e7e2c0592e3286672 (diff) | |
| download | openbsd-11b2caf2d2be047efd96d29f1a2278031692364a.tar.gz openbsd-11b2caf2d2be047efd96d29f1a2278031692364a.tar.bz2 openbsd-11b2caf2d2be047efd96d29f1a2278031692364a.zip | |
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 '')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_isqrt.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/crypto_lock.c | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/libcrypto/bn/bn_isqrt.c b/src/lib/libcrypto/bn/bn_isqrt.c index 4a757b02ce..1dff1b0562 100644 --- a/src/lib/libcrypto/bn/bn_isqrt.c +++ b/src/lib/libcrypto/bn/bn_isqrt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_isqrt.c,v 1.7 2023/03/27 10:25:02 tb Exp $ */ | 1 | /* $OpenBSD: bn_isqrt.c,v 1.8 2023/05/17 07:42:38 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
| 4 | * | 4 | * |
| @@ -22,9 +22,7 @@ | |||
| 22 | #include <openssl/err.h> | 22 | #include <openssl/err.h> |
| 23 | 23 | ||
| 24 | #include "bn_local.h" | 24 | #include "bn_local.h" |
| 25 | 25 | #include "crypto_internal.h" | |
| 26 | #define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \ | ||
| 27 | __attribute__((__unused__)) | ||
| 28 | 26 | ||
| 29 | /* | 27 | /* |
| 30 | * Calculate integer square root of |n| using a variant of Newton's method. | 28 | * Calculate integer square root of |n| using a variant of Newton's method. |
diff --git a/src/lib/libcrypto/crypto_lock.c b/src/lib/libcrypto/crypto_lock.c index 5d317a81c0..5b1d1b090b 100644 --- a/src/lib/libcrypto/crypto_lock.c +++ b/src/lib/libcrypto/crypto_lock.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: crypto_lock.c,v 1.2 2018/11/28 15:51:32 jsing Exp $ */ | 1 | /* $OpenBSD: crypto_lock.c,v 1.3 2023/05/17 07:42:38 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018 Brent Cook <bcook@openbsd.org> | 3 | * Copyright (c) 2018 Brent Cook <bcook@openbsd.org> |
| 4 | * | 4 | * |
| @@ -19,6 +19,8 @@ | |||
| 19 | 19 | ||
| 20 | #include <openssl/crypto.h> | 20 | #include <openssl/crypto.h> |
| 21 | 21 | ||
| 22 | #include "crypto_internal.h" | ||
| 23 | |||
| 22 | static pthread_mutex_t locks[] = { | 24 | static pthread_mutex_t locks[] = { |
| 23 | PTHREAD_MUTEX_INITIALIZER, | 25 | PTHREAD_MUTEX_INITIALIZER, |
| 24 | PTHREAD_MUTEX_INITIALIZER, | 26 | PTHREAD_MUTEX_INITIALIZER, |
| @@ -63,9 +65,6 @@ static pthread_mutex_t locks[] = { | |||
| 63 | PTHREAD_MUTEX_INITIALIZER, | 65 | PTHREAD_MUTEX_INITIALIZER, |
| 64 | }; | 66 | }; |
| 65 | 67 | ||
| 66 | #define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \ | ||
| 67 | __attribute__((__unused__)) | ||
| 68 | |||
| 69 | CTASSERT((sizeof(locks) / sizeof(*locks)) == CRYPTO_NUM_LOCKS); | 68 | CTASSERT((sizeof(locks) / sizeof(*locks)) == CRYPTO_NUM_LOCKS); |
| 70 | 69 | ||
| 71 | void | 70 | void |
