-/* $OpenBSD: ssl_lib.c,v 1.321 2024/03/02 11:48:55 tb Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.322 2024/03/27 06:47:52 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int
SSL_up_ref(SSL *s)
{
- int refs = CRYPTO_add(&s->references, 1, CRYPTO_LOCK_SSL);
- return (refs > 1) ? 1 : 0;
+ return CRYPTO_add(&s->references, 1, CRYPTO_LOCK_SSL) > 1;
}
LSSL_ALIAS(SSL_up_ref);
int
SSL_CTX_up_ref(SSL_CTX *ctx)
{
- int refs = CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);
- return ((refs > 1) ? 1 : 0);
+ return CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX) > 1;
}
LSSL_ALIAS(SSL_CTX_up_ref);
-/* $OpenBSD: ssl_sess.c,v 1.124 2024/01/24 14:05:10 jsing Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.125 2024/03/27 06:47:52 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int
SSL_SESSION_up_ref(SSL_SESSION *ss)
{
- int refs = CRYPTO_add(&ss->references, 1, CRYPTO_LOCK_SSL_SESSION);
- return (refs > 1) ? 1 : 0;
+ return CRYPTO_add(&ss->references, 1, CRYPTO_LOCK_SSL_SESSION) > 1;
}
LSSL_ALIAS(SSL_SESSION_up_ref);