summaryrefslogtreecommitdiffstats
path: root/src/crypto/rsa
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/rsa')
-rw-r--r--src/crypto/rsa/CMakeLists.txt2
-rw-r--r--src/crypto/rsa/rsa.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/crypto/rsa/CMakeLists.txt b/src/crypto/rsa/CMakeLists.txt
index c438e1d..0ea12c8 100644
--- a/src/crypto/rsa/CMakeLists.txt
+++ b/src/crypto/rsa/CMakeLists.txt
@@ -16,6 +16,8 @@ add_executable(
rsa_test
rsa_test.c
+
+ $<TARGET_OBJECTS:test_support>
)
target_link_libraries(rsa_test crypto)
diff --git a/src/crypto/rsa/rsa.c b/src/crypto/rsa/rsa.c
index 5cc48ed..17059b0 100644
--- a/src/crypto/rsa/rsa.c
+++ b/src/crypto/rsa/rsa.c
@@ -121,7 +121,7 @@ void RSA_free(RSA *rsa) {
return;
}
- if (CRYPTO_add(&rsa->references, -1, CRYPTO_LOCK_RSA) > 0) {
+ if (!CRYPTO_refcount_dec_and_test_zero(&rsa->references)) {
return;
}
@@ -150,7 +150,7 @@ void RSA_free(RSA *rsa) {
}
int RSA_up_ref(RSA *rsa) {
- CRYPTO_add(&rsa->references, 1, CRYPTO_LOCK_RSA);
+ CRYPTO_refcount_inc(&rsa->references);
return 1;
}