summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2016-11-04 10:29:19 +0000
committerbeck <>2016-11-04 10:29:19 +0000
commitcb9e8ed1a8668be65950c7b8199c3d769af795be (patch)
tree96b4df741d3c0f2d579a05822dd0f0038cb73699
parent195fe5e91c60bd205043b4bea113abdff1c67bcc (diff)
downloadopenbsd-cb9e8ed1a8668be65950c7b8199c3d769af795be.tar.gz
openbsd-cb9e8ed1a8668be65950c7b8199c3d769af795be.tar.bz2
openbsd-cb9e8ed1a8668be65950c7b8199c3d769af795be.zip
Add X509_up_ref, from boring
ok jsing@
-rw-r--r--src/lib/libcrypto/x509/x509.h4
-rw-r--r--src/lib/libcrypto/x509/x_all.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 1c4c44b588..1d5467b47d 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.24 2016/09/04 16:49:24 jsing Exp $ */ 1/* $OpenBSD: x509.h,v 1.25 2016/11/04 10:29:19 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1281,6 +1281,8 @@ int X509_TRUST_get_flags(X509_TRUST *xp);
1281char *X509_TRUST_get0_name(X509_TRUST *xp); 1281char *X509_TRUST_get0_name(X509_TRUST *xp);
1282int X509_TRUST_get_trust(X509_TRUST *xp); 1282int X509_TRUST_get_trust(X509_TRUST *xp);
1283 1283
1284int X509_up_ref(X509 *x);
1285
1284/* BEGIN ERROR CODES */ 1286/* BEGIN ERROR CODES */
1285/* The following lines are auto generated by the script mkerr.pl. Any changes 1287/* The following lines are auto generated by the script mkerr.pl. Any changes
1286 * made after this point may be overwritten when the script is next run. 1288 * made after this point may be overwritten when the script is next run.
diff --git a/src/lib/libcrypto/x509/x_all.c b/src/lib/libcrypto/x509/x_all.c
index 21a8535445..74ff179b65 100644
--- a/src/lib/libcrypto/x509/x_all.c
+++ b/src/lib/libcrypto/x509/x_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_all.c,v 1.21 2015/10/13 14:03:26 jsing Exp $ */ 1/* $OpenBSD: x_all.c,v 1.22 2016/11/04 10:29:19 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -600,3 +600,10 @@ PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
600 return(ASN1_item_digest(ASN1_ITEM_rptr(PKCS7_ISSUER_AND_SERIAL), type, 600 return(ASN1_item_digest(ASN1_ITEM_rptr(PKCS7_ISSUER_AND_SERIAL), type,
601 (char *)data, md, len)); 601 (char *)data, md, len));
602} 602}
603
604int
605X509_up_ref(X509 *x)
606{
607 int i = CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
608 return i > 1 ? 1 : 0;
609}