summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2021-10-23 16:11:31 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2021-10-23 16:11:31 +0000
commitfb5c5e7124c3fa6afbb62d7873369c2200f4b44a (patch)
tree72eac1291656a64e22ce6b8e8284da85b13db731 /lib/libssl
parentbb77e8c7230b8d87fd5c3f08ab8aceb8cb945b9b (diff)
Unhandroll X509_up_ref()
ok beck jsing
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/ssl_cert.c5
-rw-r--r--lib/libssl/ssl_clnt.c6
-rw-r--r--lib/libssl/ssl_lib.c4
-rw-r--r--lib/libssl/ssl_rsa.c4
4 files changed, 9 insertions, 10 deletions
diff --git a/lib/libssl/ssl_cert.c b/lib/libssl/ssl_cert.c
index b7c3718ef5d..a711b5db5c1 100644
--- a/lib/libssl/ssl_cert.c
+++ b/lib/libssl/ssl_cert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_cert.c,v 1.84 2021/10/23 13:14:38 tb Exp $ */
+/* $OpenBSD: ssl_cert.c,v 1.85 2021/10/23 16:11:30 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -224,8 +224,7 @@ ssl_cert_dup(CERT *cert)
for (i = 0; i < SSL_PKEY_NUM; i++) {
if (cert->pkeys[i].x509 != NULL) {
ret->pkeys[i].x509 = cert->pkeys[i].x509;
- CRYPTO_add(&ret->pkeys[i].x509->references, 1,
- CRYPTO_LOCK_X509);
+ X509_up_ref(ret->pkeys[i].x509);
}
if (cert->pkeys[i].privatekey != NULL) {
diff --git a/lib/libssl/ssl_clnt.c b/lib/libssl/ssl_clnt.c
index 2e7047eb55c..ea502e6a330 100644
--- a/lib/libssl/ssl_clnt.c
+++ b/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_clnt.c,v 1.115 2021/10/23 14:40:54 jsing Exp $ */
+/* $OpenBSD: ssl_clnt.c,v 1.116 2021/10/23 16:11:30 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1187,7 +1187,7 @@ ssl3_get_server_certificate(SSL *s)
}
sc->peer_cert_type = i;
- CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
+ X509_up_ref(x);
/*
* Why would the following ever happen?
* We just created sc a couple of lines ago.
@@ -1197,7 +1197,7 @@ ssl3_get_server_certificate(SSL *s)
sc->peer_key = &(sc->peer_pkeys[i]);
X509_free(s->session->peer);
- CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
+ X509_up_ref(x);
s->session->peer = x;
s->session->verify_result = s->verify_result;
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 1363cd64fd8..c48cee33b29 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.272 2021/10/23 15:30:44 beck Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.273 2021/10/23 16:11:30 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -847,7 +847,7 @@ SSL_get_peer_certificate(const SSL *s)
if (r == NULL)
return (r);
- CRYPTO_add(&r->references, 1, CRYPTO_LOCK_X509);
+ X509_up_ref(r);
return (r);
}
diff --git a/lib/libssl/ssl_rsa.c b/lib/libssl/ssl_rsa.c
index e3a1e5dc4ba..1d2f5fc9b40 100644
--- a/lib/libssl/ssl_rsa.c
+++ b/lib/libssl/ssl_rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_rsa.c,v 1.34 2021/06/11 11:13:53 jsing Exp $ */
+/* $OpenBSD: ssl_rsa.c,v 1.35 2021/10/23 16:11:30 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -392,7 +392,7 @@ ssl_set_cert(CERT *c, X509 *x)
EVP_PKEY_free(pkey);
X509_free(c->pkeys[i].x509);
- CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
+ X509_up_ref(x);
c->pkeys[i].x509 = x;
c->key = &(c->pkeys[i]);