diff options
author | schwarze <> | 2019-08-23 09:41:49 +0000 |
---|---|---|
committer | schwarze <> | 2019-08-23 09:41:49 +0000 |
commit | f47ec90a69edbbb3f31bc84155ec6beb3abb4d36 (patch) | |
tree | 483eb6ebf685be6c6c7a2edc065216a334708c19 /src/lib/libcrypto | |
parent | 73e00559955b8436bb8c747e833d894c4a0889d8 (diff) | |
download | openbsd-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.3 | 48 |
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. | |||
85 | It can hold a public key together with information about the person, | 107 | It can hold a public key together with information about the person, |
86 | organization, device, or function the associated private key belongs to. | 108 | organization, device, or function the associated private key belongs to. |
87 | .Pp | 109 | .Pp |
110 | .Fn X509_dup | ||
111 | creates a deep copy of | ||
112 | .Fa a | ||
113 | using | ||
114 | .Xr ASN1_item_dup 3 , | ||
115 | setting the reference count of the copy to 1. | ||
116 | .Pp | ||
88 | .Fn X509_free | 117 | .Fn X509_free |
89 | decrements the reference count of the | 118 | decrements 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 : |
118 | The returned chain persists after the original is freed. | 147 | The returned chain persists after the original is freed. |
119 | .Sh RETURN VALUES | 148 | .Sh RETURN VALUES |
120 | If the allocation fails, | ||
121 | .Fn X509_new | 149 | .Fn X509_new |
122 | returns | 150 | and |
151 | .Fn X509_dup | ||
152 | return a pointer to the newly allocated object or | ||
123 | .Dv NULL | 153 | .Dv NULL |
124 | and sets an error code that can be obtained by | 154 | if an error occurs; an error code can be obtained by |
125 | .Xr ERR_get_error 3 . | 155 | .Xr ERR_get_error 3 . |
126 | Otherwise it returns a pointer to the newly allocated structure. | ||
127 | .Pp | 156 | .Pp |
128 | .Fn X509_up_ref | 157 | .Fn X509_up_ref |
129 | returns 1 for success or 0 for failure. | 158 | returns 1 for success or 0 for failure. |
@@ -174,7 +203,10 @@ Certificate Revocation List (CRL) Profile | |||
174 | .Fn X509_new | 203 | .Fn X509_new |
175 | and | 204 | and |
176 | .Fn X509_free | 205 | .Fn X509_free |
177 | appeared in SSLeay 0.4 or earlier and have been available since | 206 | appeared in SSLeay 0.4 or earlier. |
207 | .Fn X509_dup | ||
208 | first appeared in SSLeay 0.4.4. | ||
209 | These 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 |