summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_key.c
diff options
context:
space:
mode:
authortb <>2024-03-27 01:22:30 +0000
committertb <>2024-03-27 01:22:30 +0000
commitd63e16568602c2845543acd93bc322272a7ab788 (patch)
treec0c42a2b8c4163dc6824836c943bda44cac3d87e /src/lib/libcrypto/ec/ec_key.c
parent1a774a12617e73fb42e142f6fe5d6c3c1c5cb9fe (diff)
downloadopenbsd-d63e16568602c2845543acd93bc322272a7ab788.tar.gz
openbsd-d63e16568602c2845543acd93bc322272a7ab788.tar.bz2
openbsd-d63e16568602c2845543acd93bc322272a7ab788.zip
Unify *_up_ref() implementations
No need for an inconsistently named local variable and a ternary operator. ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_key.c')
-rw-r--r--src/lib/libcrypto/ec/ec_key.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c
index dd976898ad..e959829478 100644
--- a/src/lib/libcrypto/ec/ec_key.c
+++ b/src/lib/libcrypto/ec/ec_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_key.c,v 1.39 2023/11/29 21:35:57 tb Exp $ */ 1/* $OpenBSD: ec_key.c,v 1.40 2024/03/27 01:22:30 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -204,8 +204,7 @@ LCRYPTO_ALIAS(EC_KEY_dup);
204int 204int
205EC_KEY_up_ref(EC_KEY *r) 205EC_KEY_up_ref(EC_KEY *r)
206{ 206{
207 int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); 207 return CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC) > 1;
208 return ((i > 1) ? 1 : 0);
209} 208}
210LCRYPTO_ALIAS(EC_KEY_up_ref); 209LCRYPTO_ALIAS(EC_KEY_up_ref);
211 210