summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
authorschwarze <>2019-08-23 09:41:49 +0000
committerschwarze <>2019-08-23 09:41:49 +0000
commitf47ec90a69edbbb3f31bc84155ec6beb3abb4d36 (patch)
tree483eb6ebf685be6c6c7a2edc065216a334708c19 /src/lib/libcrypto
parent73e00559955b8436bb8c747e833d894c4a0889d8 (diff)
downloadopenbsd-f47ec90a69edbbb3f31bc84155ec6beb3abb4d36.tar.gz
openbsd-f47ec90a69edbbb3f31bc84155ec6beb3abb4d36.tar.bz2
openbsd-f47ec90a69edbbb3f31bc84155ec6beb3abb4d36.zip
document X509_dup(3)
Diffstat (limited to 'src/lib/libcrypto')
-rw-r--r--src/lib/libcrypto/man/X509_new.348
1 files changed, 40 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/X509_new.3 b/src/lib/libcrypto/man/X509_new.3
index c7a62c2215..5920384ffa 100644
--- a/src/lib/libcrypto/man/X509_new.3
+++ b/src/lib/libcrypto/man/X509_new.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: X509_new.3,v 1.20 2019/08/22 15:15:35 schwarze Exp $ 1.\" $OpenBSD: X509_new.3,v 1.21 2019/08/23 09:41:49 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2016, 2018, 2019 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project. 22.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project.
6.\" All rights reserved. 23.\" All rights reserved.
7.\" 24.\"
@@ -49,11 +66,12 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 68.\"
52.Dd $Mdocdate: August 22 2019 $ 69.Dd $Mdocdate: August 23 2019 $
53.Dt X509_NEW 3 70.Dt X509_NEW 3
54.Os 71.Os
55.Sh NAME 72.Sh NAME
56.Nm X509_new , 73.Nm X509_new ,
74.Nm X509_dup ,
57.Nm X509_free , 75.Nm X509_free ,
58.Nm X509_up_ref , 76.Nm X509_up_ref ,
59.Nm X509_chain_up_ref 77.Nm X509_chain_up_ref
@@ -62,6 +80,10 @@
62.In openssl/x509.h 80.In openssl/x509.h
63.Ft X509 * 81.Ft X509 *
64.Fn X509_new void 82.Fn X509_new void
83.Ft X509 *
84.Fo X509_dup
85.Fa "X509 *a"
86.Fc
65.Ft void 87.Ft void
66.Fo X509_free 88.Fo X509_free
67.Fa "X509 *a" 89.Fa "X509 *a"
@@ -85,6 +107,13 @@ structure defined in RFC 5280 section 4.1.
85It can hold a public key together with information about the person, 107It can hold a public key together with information about the person,
86organization, device, or function the associated private key belongs to. 108organization, device, or function the associated private key belongs to.
87.Pp 109.Pp
110.Fn X509_dup
111creates a deep copy of
112.Fa a
113using
114.Xr ASN1_item_dup 3 ,
115setting the reference count of the copy to 1.
116.Pp
88.Fn X509_free 117.Fn X509_free
89decrements the reference count of the 118decrements the reference count of the
90.Vt X509 119.Vt X509
@@ -117,13 +146,13 @@ Its purpose is similar to
117.Fn X509_up_ref : 146.Fn X509_up_ref :
118The returned chain persists after the original is freed. 147The returned chain persists after the original is freed.
119.Sh RETURN VALUES 148.Sh RETURN VALUES
120If the allocation fails,
121.Fn X509_new 149.Fn X509_new
122returns 150and
151.Fn X509_dup
152return a pointer to the newly allocated object or
123.Dv NULL 153.Dv NULL
124and sets an error code that can be obtained by 154if an error occurs; an error code can be obtained by
125.Xr ERR_get_error 3 . 155.Xr ERR_get_error 3 .
126Otherwise it returns a pointer to the newly allocated structure.
127.Pp 156.Pp
128.Fn X509_up_ref 157.Fn X509_up_ref
129returns 1 for success or 0 for failure. 158returns 1 for success or 0 for failure.
@@ -174,7 +203,10 @@ Certificate Revocation List (CRL) Profile
174.Fn X509_new 203.Fn X509_new
175and 204and
176.Fn X509_free 205.Fn X509_free
177appeared in SSLeay 0.4 or earlier and have been available since 206appeared in SSLeay 0.4 or earlier.
207.Fn X509_dup
208first appeared in SSLeay 0.4.4.
209These functions have been available since
178.Ox 2.4 . 210.Ox 2.4 .
179.Pp 211.Pp
180.Fn X509_up_ref 212.Fn X509_up_ref