Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto/dh
diff options
context:
space:
mode:
authorAdam Langley <alangley@gmail.com>2015-05-15 22:49:30 +0300
committerAdam Langley <agl@google.com>2015-05-20 22:15:26 +0300
commit0da323a8b8a4402f1c5d264cdc43c6b622118b67 (patch)
treef8d6f8775ff6253002ad18b60e52302fd391cdbd /crypto/dh
parent6f2e733bab69a5c853a929a96671736458b8d4c1 (diff)
Convert reference counts in crypto/
This change converts the reference counts in crypto/ to use |CRYPTO_refcount_t|. The reference counts in |X509_PKEY| and |X509_INFO| were never actually used and so were dropped. Change-Id: I75d572cdac1f8c1083c482e29c9519282d7fd16c Reviewed-on: https://boringssl-review.googlesource.com/4772 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/dh/dh.c b/crypto/dh/dh.c
index d90b1134..96b85f3f 100644
--- a/crypto/dh/dh.c
+++ b/crypto/dh/dh.c
@@ -116,7 +116,7 @@ void DH_free(DH *dh) {
return;
}
- if (CRYPTO_add(&dh->references, -1, CRYPTO_LOCK_DH) > 0) {
+ if (!CRYPTO_refcount_dec_and_test_zero(&dh->references)) {
return;
}
@@ -166,8 +166,8 @@ int DH_size(const DH *dh) { return BN_num_bytes(dh->p); }
unsigned DH_num_bits(const DH *dh) { return BN_num_bits(dh->p); }
-int DH_up_ref(DH *r) {
- CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH);
+int DH_up_ref(DH *dh) {
+ CRYPTO_refcount_inc(&dh->references);
return 1;
}