diff options
author | schwarze <> | 2021-11-15 11:51:09 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-15 11:51:09 +0000 |
commit | 586247e7876a461b4d379f784308a960f02d0b19 (patch) | |
tree | 20b0fa1404dfc2f1923804810fcfca66c7ff0a8a /src/lib | |
parent | ad83e141cc258e6ba6fb7328d224c613a3cc0510 (diff) | |
download | openbsd-586247e7876a461b4d379f784308a960f02d0b19.tar.gz openbsd-586247e7876a461b4d379f784308a960f02d0b19.tar.bz2 openbsd-586247e7876a461b4d379f784308a960f02d0b19.zip |
document ASN1_item_pack(3) and ASN1_item_unpack(3)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/man/ASN1_STRING_new.3 | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ASN1_item_d2i.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ASN1_item_new.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ASN1_item_pack.3 | 84 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
5 files changed, 94 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/ASN1_STRING_new.3 b/src/lib/libcrypto/man/ASN1_STRING_new.3 index 54c5f7163f..a2cd27ecb8 100644 --- a/src/lib/libcrypto/man/ASN1_STRING_new.3 +++ b/src/lib/libcrypto/man/ASN1_STRING_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_STRING_new.3,v 1.19 2021/11/15 10:41:11 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_STRING_new.3,v 1.20 2021/11/15 11:51:09 schwarze Exp $ |
2 | .\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400 | 2 | .\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400 |
3 | .\" | 3 | .\" |
4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | 4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> |
@@ -204,6 +204,7 @@ is returned and an error code can be retrieved with | |||
204 | .Xr ERR_get_error 3 . | 204 | .Xr ERR_get_error 3 . |
205 | .Sh SEE ALSO | 205 | .Sh SEE ALSO |
206 | .Xr ASN1_INTEGER_get 3 , | 206 | .Xr ASN1_INTEGER_get 3 , |
207 | .Xr ASN1_item_pack 3 , | ||
207 | .Xr ASN1_mbstring_copy 3 , | 208 | .Xr ASN1_mbstring_copy 3 , |
208 | .Xr ASN1_STRING_length 3 , | 209 | .Xr ASN1_STRING_length 3 , |
209 | .Xr ASN1_STRING_print_ex 3 , | 210 | .Xr ASN1_STRING_print_ex 3 , |
diff --git a/src/lib/libcrypto/man/ASN1_item_d2i.3 b/src/lib/libcrypto/man/ASN1_item_d2i.3 index 19b290ef63..8f716f6f36 100644 --- a/src/lib/libcrypto/man/ASN1_item_d2i.3 +++ b/src/lib/libcrypto/man/ASN1_item_d2i.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_item_d2i.3,v 1.11 2021/11/07 15:29:01 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_item_d2i.3,v 1.12 2021/11/15 11:51:09 schwarze Exp $ |
2 | .\" OpenSSL doc/man3/d2i_X509.pod b97fdb57 Nov 11 09:33:09 2016 +0100 | 2 | .\" OpenSSL doc/man3/d2i_X509.pod b97fdb57 Nov 11 09:33:09 2016 +0100 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
@@ -65,7 +65,7 @@ | |||
65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
67 | .\" | 67 | .\" |
68 | .Dd $Mdocdate: November 7 2021 $ | 68 | .Dd $Mdocdate: November 15 2021 $ |
69 | .Dt ASN1_ITEM_D2I 3 | 69 | .Dt ASN1_ITEM_D2I 3 |
70 | .Os | 70 | .Os |
71 | .Sh NAME | 71 | .Sh NAME |
@@ -364,6 +364,7 @@ if (d2i_X509(&x, &p, len) == NULL) | |||
364 | .Xr ASN1_get_object 3 , | 364 | .Xr ASN1_get_object 3 , |
365 | .Xr ASN1_item_digest 3 , | 365 | .Xr ASN1_item_digest 3 , |
366 | .Xr ASN1_item_new 3 , | 366 | .Xr ASN1_item_new 3 , |
367 | .Xr ASN1_item_pack 3 , | ||
367 | .Xr ASN1_item_sign 3 , | 368 | .Xr ASN1_item_sign 3 , |
368 | .Xr ASN1_item_verify 3 , | 369 | .Xr ASN1_item_verify 3 , |
369 | .Xr ASN1_TYPE_new 3 | 370 | .Xr ASN1_TYPE_new 3 |
diff --git a/src/lib/libcrypto/man/ASN1_item_new.3 b/src/lib/libcrypto/man/ASN1_item_new.3 index fd967bfc3f..12340c7443 100644 --- a/src/lib/libcrypto/man/ASN1_item_new.3 +++ b/src/lib/libcrypto/man/ASN1_item_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_item_new.3,v 1.7 2021/11/07 15:29:01 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_item_new.3,v 1.8 2021/11/15 11:51:09 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -14,7 +14,7 @@ | |||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .\" | 16 | .\" |
17 | .Dd $Mdocdate: November 7 2021 $ | 17 | .Dd $Mdocdate: November 15 2021 $ |
18 | .Dt ASN1_ITEM_NEW 3 | 18 | .Dt ASN1_ITEM_NEW 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -108,6 +108,7 @@ is returned and an error code can be retrieved with | |||
108 | .Xr ASN1_get_object 3 , | 108 | .Xr ASN1_get_object 3 , |
109 | .Xr ASN1_item_d2i 3 , | 109 | .Xr ASN1_item_d2i 3 , |
110 | .Xr ASN1_item_digest 3 , | 110 | .Xr ASN1_item_digest 3 , |
111 | .Xr ASN1_item_pack 3 , | ||
111 | .Xr ASN1_item_sign 3 , | 112 | .Xr ASN1_item_sign 3 , |
112 | .Xr ASN1_item_verify 3 , | 113 | .Xr ASN1_item_verify 3 , |
113 | .Xr ASN1_TYPE_new 3 , | 114 | .Xr ASN1_TYPE_new 3 , |
diff --git a/src/lib/libcrypto/man/ASN1_item_pack.3 b/src/lib/libcrypto/man/ASN1_item_pack.3 new file mode 100644 index 0000000000..4c87530622 --- /dev/null +++ b/src/lib/libcrypto/man/ASN1_item_pack.3 | |||
@@ -0,0 +1,84 @@ | |||
1 | .\" $OpenBSD: ASN1_item_pack.3,v 1.1 2021/11/15 11:51:09 schwarze Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: November 15 2021 $ | ||
18 | .Dt ASN1_ITEM_PACK 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm ASN1_item_pack , | ||
22 | .Nm ASN1_item_unpack | ||
23 | .Nd pack an ASN.1 object into an ASN1_STRING | ||
24 | .Sh SYNOPSIS | ||
25 | .In openssl/asn1.h | ||
26 | .Ft ASN1_STRING * | ||
27 | .Fo ASN1_item_pack | ||
28 | .Fa "void *val_in" | ||
29 | .Fa "const ASN1_ITEM *it" | ||
30 | .Fa "ASN1_STRING **string_out" | ||
31 | .Fc | ||
32 | .Ft void * | ||
33 | .Fo ASN1_item_unpack | ||
34 | .Fa "const ASN1_STRING *string_in" | ||
35 | .Fa "const ASN1_ITEM *it" | ||
36 | .Fc | ||
37 | .Sh DESCRIPTION | ||
38 | .Fn ASN1_item_pack | ||
39 | encodes the object pointed to by | ||
40 | .Fa val_in | ||
41 | into DER format using | ||
42 | .Xr ASN1_item_i2d 3 | ||
43 | and stores the encoded form in | ||
44 | .Pf ** Fa string_out . | ||
45 | If | ||
46 | .Fa string_out | ||
47 | or | ||
48 | .Pf * Fa string_out | ||
49 | is a | ||
50 | .Dv NULL | ||
51 | pointer, a new | ||
52 | .Vt ASN1_STRING | ||
53 | object is allocated and returned. | ||
54 | .Pp | ||
55 | .Fn ASN1_item_unpack | ||
56 | interprets the data in | ||
57 | .Fa string_in | ||
58 | as a DER- or BER-encoded byte array and decodes one value of the type | ||
59 | .Fa it | ||
60 | into a newly allocated object using | ||
61 | .Xr ASN1_item_d2i 3 . | ||
62 | .Sh RETURN VALUES | ||
63 | .Fn ASN1_item_pack | ||
64 | returns the modified or new object or | ||
65 | .Dv NULL | ||
66 | if memory allocation or encoding fails. | ||
67 | .Pp | ||
68 | .Fn ASN1_item_unpack | ||
69 | returns the new object or | ||
70 | .Dv NULL | ||
71 | if memory allocation or decoding fails. | ||
72 | .Sh SEE ALSO | ||
73 | .Xr ASN1_item_d2i 3 , | ||
74 | .Xr ASN1_item_new 3 , | ||
75 | .Xr ASN1_STRING_new 3 | ||
76 | .Sh HISTORY | ||
77 | .Fn ASN1_item_pack | ||
78 | and | ||
79 | .Fn ASN1_item_unpack | ||
80 | first appeared in OpenSSL 0.9.7 and have been available since | ||
81 | .Ox 3.2 . | ||
82 | .Sh BUGS | ||
83 | See the BUGS section in | ||
84 | .Xr ASN1_item_i2d 3 . | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index a1e1c97b81..ab7740054e 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.212 2021/11/15 10:41:11 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.213 2021/11/15 11:51:09 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -18,6 +18,7 @@ MAN= \ | |||
18 | ASN1_item_d2i.3 \ | 18 | ASN1_item_d2i.3 \ |
19 | ASN1_item_digest.3 \ | 19 | ASN1_item_digest.3 \ |
20 | ASN1_item_new.3 \ | 20 | ASN1_item_new.3 \ |
21 | ASN1_item_pack.3 \ | ||
21 | ASN1_item_sign.3 \ | 22 | ASN1_item_sign.3 \ |
22 | ASN1_item_verify.3 \ | 23 | ASN1_item_verify.3 \ |
23 | ASN1_mbstring_copy.3 \ | 24 | ASN1_mbstring_copy.3 \ |