diff options
author | schwarze <> | 2018-02-22 21:53:23 +0000 |
---|---|---|
committer | schwarze <> | 2018-02-22 21:53:23 +0000 |
commit | 0642059923f9b82ebba737cbac2c4286a6451b76 (patch) | |
tree | b29b69eeb2b90c62ba2f2db969fd1c87d8792733 | |
parent | a1b9bde825ad9ecee87fabe10c2acc09cc75d9ac (diff) | |
download | openbsd-0642059923f9b82ebba737cbac2c4286a6451b76.tar.gz openbsd-0642059923f9b82ebba737cbac2c4286a6451b76.tar.bz2 openbsd-0642059923f9b82ebba737cbac2c4286a6451b76.zip |
In x509.h rev. 1.32 2018/02/20 17:09:20, jsing@ provided
X509_NAME_get0_der(3). Document it without using anything
from the existing OpenSSL X509_NAME_get0_der(3) manual page
because that page fails to mention the similarity to i2d_X509_NAME(3)
and also fails to explain how both differ, likely causing users
to pick the wrong one for their purposes.
-rw-r--r-- | src/lib/libcrypto/man/d2i_X509_NAME.3 | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/d2i_X509_NAME.3 b/src/lib/libcrypto/man/d2i_X509_NAME.3 index 3dd337c430..c1e7efddf1 100644 --- a/src/lib/libcrypto/man/d2i_X509_NAME.3 +++ b/src/lib/libcrypto/man/d2i_X509_NAME.3 | |||
@@ -1,7 +1,9 @@ | |||
1 | .\" $OpenBSD: d2i_X509_NAME.3,v 1.10 2017/01/07 08:46:13 jmc Exp $ | 1 | .\" $OpenBSD: d2i_X509_NAME.3,v 1.11 2018/02/22 21:53:23 schwarze Exp $ |
2 | .\" OpenSSL d900a015 Oct 8 14:40:42 2015 +0200 | 2 | .\" checked up to: |
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 | ||
3 | .\" | 5 | .\" |
4 | .\" Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> | 6 | .\" Copyright (c) 2016, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> |
5 | .\" | 7 | .\" |
6 | .\" Permission to use, copy, modify, and distribute this software for any | 8 | .\" Permission to use, copy, modify, and distribute this software for any |
7 | .\" purpose with or without fee is hereby granted, provided that the above | 9 | .\" purpose with or without fee is hereby granted, provided that the above |
@@ -15,12 +17,13 @@ | |||
15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 | .\" | 19 | .\" |
18 | .Dd $Mdocdate: January 7 2017 $ | 20 | .Dd $Mdocdate: February 22 2018 $ |
19 | .Dt D2I_X509_NAME 3 | 21 | .Dt D2I_X509_NAME 3 |
20 | .Os | 22 | .Os |
21 | .Sh NAME | 23 | .Sh NAME |
22 | .Nm d2i_X509_NAME , | 24 | .Nm d2i_X509_NAME , |
23 | .Nm i2d_X509_NAME , | 25 | .Nm i2d_X509_NAME , |
26 | .Nm X509_NAME_get0_der , | ||
24 | .Nm X509_NAME_dup , | 27 | .Nm X509_NAME_dup , |
25 | .Nm X509_NAME_hash , | 28 | .Nm X509_NAME_hash , |
26 | .Nm d2i_X509_NAME_ENTRY , | 29 | .Nm d2i_X509_NAME_ENTRY , |
@@ -28,7 +31,7 @@ | |||
28 | .Nm X509_NAME_ENTRY_dup | 31 | .Nm X509_NAME_ENTRY_dup |
29 | .\" In the following line, "X.501" and "Name" are not typos. | 32 | .\" In the following line, "X.501" and "Name" are not typos. |
30 | .\" The "Name" type is defined in X.501, not in X.509. | 33 | .\" The "Name" type is defined in X.501, not in X.509. |
31 | .\" The type in called "Name" with capital "N", not "name". | 34 | .\" The type is called "Name" with capital "N", not "name". |
32 | .Nd decode and encode X.501 Name objects | 35 | .Nd decode and encode X.501 Name objects |
33 | .Sh SYNOPSIS | 36 | .Sh SYNOPSIS |
34 | .In openssl/x509.h | 37 | .In openssl/x509.h |
@@ -43,6 +46,12 @@ | |||
43 | .Fa "X509_NAME *val_in" | 46 | .Fa "X509_NAME *val_in" |
44 | .Fa "unsigned char **der_out" | 47 | .Fa "unsigned char **der_out" |
45 | .Fc | 48 | .Fc |
49 | .Ft int | ||
50 | .Fo X509_NAME_get0_der | ||
51 | .Fa "X509_NAME *val_in" | ||
52 | .Fa "const unsigned char **der_out" | ||
53 | .Fa "size_t *out_len" | ||
54 | .Fc | ||
46 | .Ft X509_NAME * | 55 | .Ft X509_NAME * |
47 | .Fo X509_NAME_dup | 56 | .Fo X509_NAME_dup |
48 | .Fa "X509_NAME *val_in" | 57 | .Fa "X509_NAME *val_in" |
@@ -80,6 +89,17 @@ decode and encode an ASN.1 | |||
80 | .Vt Name | 89 | .Vt Name |
81 | structure defined in RFC 5280 section 4.1.2.4. | 90 | structure defined in RFC 5280 section 4.1.2.4. |
82 | .Pp | 91 | .Pp |
92 | .Fn X509_NAME_get0_der | ||
93 | is a variant of | ||
94 | .Fn i2d_X509_NAME | ||
95 | that does not copy the encoded output but instead returns a pointer | ||
96 | to the internally cached DER-encoded version of the name. | ||
97 | Also, it does not return the length of the output in bytes, | ||
98 | but instead stores it in | ||
99 | .Fa out_len . | ||
100 | If the cached encoded form happens to be out of date, both functions | ||
101 | update it before copying it or returning a pointer to it. | ||
102 | .Pp | ||
83 | .Fn X509_NAME_dup | 103 | .Fn X509_NAME_dup |
84 | copies | 104 | copies |
85 | .Fa val_in | 105 | .Fa val_in |
@@ -121,6 +141,9 @@ object or | |||
121 | .Dv NULL | 141 | .Dv NULL |
122 | if an error occurs. | 142 | if an error occurs. |
123 | .Pp | 143 | .Pp |
144 | .Fn X509_NAME_get0_der | ||
145 | returns 1 on success or 0 if an error occurs. | ||
146 | .Pp | ||
124 | .Fn X509_NAME_hash | 147 | .Fn X509_NAME_hash |
125 | returns the hash value or 0 if an error occurs. | 148 | returns the hash value or 0 if an error occurs. |
126 | .Pp | 149 | .Pp |