summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2021-07-03 17:04:51 +0000
committerschwarze <>2021-07-03 17:04:51 +0000
commit1a1544c135b2932046e4ec6f3c09c7d6a690014b (patch)
treee25e873ce1ca3a77931141ec9a6a54344716a42b /src
parent70e6e6179f5b7c30c5e842ff74f348f67cedf838 (diff)
downloadopenbsd-1a1544c135b2932046e4ec6f3c09c7d6a690014b.tar.gz
openbsd-1a1544c135b2932046e4ec6f3c09c7d6a690014b.tar.bz2
openbsd-1a1544c135b2932046e4ec6f3c09c7d6a690014b.zip
Document X509_NAME_set(3).
It is not particularly well-designed and sets a number of traps for the unwary, but it is a public API function in both OpenSSL and LibreSSL and used at various places.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/d2i_X509_NAME.344
1 files changed, 41 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/d2i_X509_NAME.3 b/src/lib/libcrypto/man/d2i_X509_NAME.3
index 3289ccb134..c2d4b7d1cd 100644
--- a/src/lib/libcrypto/man/d2i_X509_NAME.3
+++ b/src/lib/libcrypto/man/d2i_X509_NAME.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: d2i_X509_NAME.3,v 1.14 2018/03/27 17:35:50 schwarze Exp $ 1.\" $OpenBSD: d2i_X509_NAME.3,v 1.15 2021/07/03 17:04:51 schwarze Exp $
2.\" checked up to: 2.\" checked up to:
3.\" OpenSSL crypto/d2i_X509_NAME 4692340e Jun 7 15:49:08 2016 -0400 and 3.\" OpenSSL crypto/d2i_X509_NAME 4692340e Jun 7 15:49:08 2016 -0400 and
4.\" OpenSSL man3/X509_NAME_get0_der 99d63d46 Oct 26 13:56:48 2016 -0400 4.\" OpenSSL man3/X509_NAME_get0_der 99d63d46 Oct 26 13:56:48 2016 -0400
@@ -17,7 +17,7 @@
17.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19.\" 19.\"
20.Dd $Mdocdate: March 27 2018 $ 20.Dd $Mdocdate: July 3 2021 $
21.Dt D2I_X509_NAME 3 21.Dt D2I_X509_NAME 3
22.Os 22.Os
23.Sh NAME 23.Sh NAME
@@ -25,6 +25,7 @@
25.Nm i2d_X509_NAME , 25.Nm i2d_X509_NAME ,
26.Nm X509_NAME_get0_der , 26.Nm X509_NAME_get0_der ,
27.Nm X509_NAME_dup , 27.Nm X509_NAME_dup ,
28.Nm X509_NAME_set ,
28.Nm X509_NAME_hash , 29.Nm X509_NAME_hash ,
29.Nm d2i_X509_NAME_ENTRY , 30.Nm d2i_X509_NAME_ENTRY ,
30.Nm i2d_X509_NAME_ENTRY , 31.Nm i2d_X509_NAME_ENTRY ,
@@ -56,6 +57,11 @@
56.Fo X509_NAME_dup 57.Fo X509_NAME_dup
57.Fa "X509_NAME *val_in" 58.Fa "X509_NAME *val_in"
58.Fc 59.Fc
60.Ft int
61.Fo X509_NAME_set
62.Fa "X509_NAME **val_out"
63.Fa "X509_NAME *val_in"
64.Fc
59.Ft unsigned long 65.Ft unsigned long
60.Fo X509_NAME_hash 66.Fo X509_NAME_hash
61.Fa "X509_NAME *val_in" 67.Fa "X509_NAME *val_in"
@@ -108,6 +114,34 @@ by calling
108and 114and
109.Fn d2i_X509_NAME . 115.Fn d2i_X509_NAME .
110.Pp 116.Pp
117.Fn X509_NAME_set
118makes sure that
119.Pf * Fa val_out
120contains the same data as
121.Fa val_in
122after the call, except that it fails if
123.Fa val_in
124is
125.Dv NULL .
126If
127.Pf * Fa val_out
128is the same pointer as
129.Fa val_in ,
130the function succeeds without changing anything.
131Otherwise, it copies
132.Fa val_in
133using
134.Fn X509_NAME_dup ,
135and in case of success, it frees
136.Pf * Fa val_out
137and sets it to a pointer to the the new object.
138When the function fails, it never changes anything.
139In any case,
140.Fa val_in
141remains valid and may or may not be the same pointer as
142.Pf * Fa val_out
143after the call.
144.Pp
111.Fn X509_NAME_hash 145.Fn X509_NAME_hash
112calculates a 146calculates a
113.Xr SHA1 3 147.Xr SHA1 3
@@ -141,8 +175,10 @@ object or
141.Dv NULL 175.Dv NULL
142if an error occurs. 176if an error occurs.
143.Pp 177.Pp
178.Fn X509_NAME_set
179and
144.Fn X509_NAME_get0_der 180.Fn X509_NAME_get0_der
145returns 1 on success or 0 if an error occurs. 181return 1 on success or 0 if an error occurs.
146.Pp 182.Pp
147.Fn X509_NAME_hash 183.Fn X509_NAME_hash
148returns the hash value or 0 if an error occurs. 184returns the hash value or 0 if an error occurs.
@@ -184,6 +220,8 @@ first appeared in SSLeay 0.4.4.
184and 220and
185.Fn X509_NAME_ENTRY_dup 221.Fn X509_NAME_ENTRY_dup
186first appeared in SSLeay 0.5.1. 222first appeared in SSLeay 0.5.1.
223.Fn X509_NAME_set
224and
187.Fn X509_NAME_hash 225.Fn X509_NAME_hash
188first appeared in SSLeay 0.8.0. 226first appeared in SSLeay 0.8.0.
189These functions have been available since 227These functions have been available since