summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/ASN1_INTEGER_get.3238
-rw-r--r--src/lib/libcrypto/man/Makefile3
2 files changed, 240 insertions, 1 deletions
diff --git a/src/lib/libcrypto/man/ASN1_INTEGER_get.3 b/src/lib/libcrypto/man/ASN1_INTEGER_get.3
new file mode 100644
index 0000000000..e3585b4088
--- /dev/null
+++ b/src/lib/libcrypto/man/ASN1_INTEGER_get.3
@@ -0,0 +1,238 @@
1.\" $OpenBSD: ASN1_INTEGER_get.3,v 1.1 2018/07/08 23:00:17 schwarze Exp $
2.\" selective merge up to:
3.\" OpenSSL man3/ASN1_INTEGER_get_int64 eaf39a9f Jun 23 10:24:00 2018 +0200
4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: July 8 2018 $
53.Dt ASN1_INTEGER_GET 3
54.Os
55.Sh NAME
56.Nm ASN1_INTEGER_get ,
57.Nm ASN1_INTEGER_set ,
58.Nm BN_to_ASN1_INTEGER ,
59.Nm ASN1_INTEGER_to_BN ,
60.Nm ASN1_ENUMERATED_get ,
61.Nm ASN1_ENUMERATED_set ,
62.Nm BN_to_ASN1_ENUMERATED ,
63.Nm ASN1_ENUMERATED_to_BN
64.Nd ASN.1 INTEGER and ENUMERATED utilities
65.Sh SYNOPSIS
66.In openssl/asn1.h
67.Ft long
68.Fo ASN1_INTEGER_get
69.Fa "const ASN1_INTEGER *a"
70.Fc
71.Ft int
72.Fo ASN1_INTEGER_set
73.Fa "ASN1_INTEGER *a"
74.Fa "long v"
75.Fc
76.Ft ASN1_INTEGER *
77.Fo BN_to_ASN1_INTEGER
78.Fa "const BIGNUM *bn"
79.Fa "ASN1_INTEGER *ai"
80.Fc
81.Ft BIGNUM *
82.Fo ASN1_INTEGER_to_BN
83.Fa "const ASN1_INTEGER *ai"
84.Fa "BIGNUM *bn"
85.Fc
86.Ft long
87.Fo ASN1_ENUMERATED_get
88.Fa "const ASN1_ENUMERATED *a"
89.Fc
90.Ft int
91.Fo ASN1_ENUMERATED_set
92.Fa "ASN1_ENUMERATED *a"
93.Fa "long v"
94.Fc
95.Ft ASN1_ENUMERATED *
96.Fo BN_to_ASN1_ENUMERATED
97.Fa "const BIGNUM *bn"
98.Fa "ASN1_ENUMERATED *ai"
99.Fc
100.Ft BIGNUM *
101.Fo ASN1_ENUMERATED_to_BN
102.Fa "const ASN1_ENUMERATED *ai"
103.Fa "BIGNUM *bn"
104.Fc
105.Sh DESCRIPTION
106These functions convert to and from
107.Vt ASN1_INTEGER
108and
109.Vt ASN1_ENUMERATED
110objects.
111.Pp
112.Fn ASN1_INTEGER_get
113converts
114.Fa a
115to the
116.Vt long
117type.
118.Pp
119.Fn ASN1_INTEGER_set
120sets the value of
121.Fa a
122to
123.Fa v .
124.Pp
125.Fn BN_to_ASN1_INTEGER
126converts
127.Fa bn
128to an
129.Vt ASN1_INTEGER .
130If
131.Fa ai
132is
133.Dv NULL ,
134a new
135.Vt ASN1_INTEGER
136object is returned.
137Otherwise, the existing object
138.Fa ai
139is used instead.
140.Pp
141.Fn ASN1_INTEGER_to_BN
142converts
143.Fa ai
144into a
145.Vt BIGNUM .
146If
147.Fa bn
148is
149.Dv NULL ,
150a new
151.Vt BIGNUM
152object is returned.
153Otherwise, the existing object
154.Fa bn
155is used instead.
156.Pp
157.Fn ASN1_ENUMERATED_get ,
158.Fn ASN1_ENUMERATED_set ,
159.Fn BN_to_ASN1_ENUMERATED ,
160and
161.Fn ASN1_ENUMERATED_to_BN
162behave like their
163.Vt ASN1_INTEGER
164counterparts except that they operate on an
165.Vt ASN1_ENUMERATED
166object.
167.Sh RETURN VALUES
168.Fn ASN1_INTEGER_get
169and
170.Fn ASN1_ENUMERATED_get
171return the converted value, 0 if
172.Fa a
173is
174.Dv NULL ,
175or \-1 on error, which is ambiguous because \-1 is a legitimate
176value for an
177.Vt ASN1_INTEGER .
178.Pp
179.Fn ASN1_INTEGER_set
180and
181.Fn ASN1_ENUMERATED_set
182return 1 for success or 0 for failure.
183They only fail if a memory allocation error occurs.
184.Pp
185.Fn BN_to_ASN1_INTEGER
186and
187.Fn BN_to_ASN1_ENUMERATED
188return an
189.Vt ASN1_INTEGER
190or
191.Vt ASN1_ENUMERATED
192object, respectively, or
193.Dv NULL
194if an error occurs.
195They only fail due to memory allocation errors.
196.Pp
197.Fn ASN1_INTEGER_to_BN
198and
199.Fn ASN1_ENUMERATED_to_BN
200return a
201.Vt BIGNUM
202object of
203.Dv NULL
204if an error occurs.
205They can fail if the passed type is incorrect (due to a programming error)
206or due to memory allocation failures.
207.Sh HISTORY
208.Fn ASN1_INTEGER_set
209first appeared in SSLeay 0.5.1.
210.Fn ASN1_INTEGER_get ,
211.Fn BN_to_ASN1_INTEGER ,
212and
213.Fn ASN1_INTEGER_to_BN
214first appeared in SSLeay 0.6.0.
215These functions have been available since
216.Ox 2.3 .
217.Pp
218.Fn ASN1_ENUMERATED_get ,
219.Fn ASN1_ENUMERATED_set ,
220.Fn BN_to_ASN1_ENUMERATED ,
221and
222.Fn ASN1_ENUMERATED_to_BN
223first appeared in OpenSSL 0.9.2b and have been available since
224.Ox 2.6 .
225.Sh CAVEATS
226In general an
227.Vt ASN1_INTEGER
228or
229.Vt ASN1_ENUMERATED
230type can contain an integer of almost arbitrary size
231and so cannot always be represented by a C
232.Vt long
233type.
234The ambiguous return values of
235.Fn ASN1_INTEGER_get
236and
237.Fn ASN1_ENUMERATED_get
238imply that these functions should be avoided if possible.
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index c8e5d51fd6..fe5a87e608 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,9 +1,10 @@
1# $OpenBSD: Makefile,v 1.141 2018/04/18 01:13:37 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.142 2018/07/08 23:00:17 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5MAN= \ 5MAN= \
6 ACCESS_DESCRIPTION_new.3 \ 6 ACCESS_DESCRIPTION_new.3 \
7 ASN1_INTEGER_get.3 \
7 ASN1_OBJECT_new.3 \ 8 ASN1_OBJECT_new.3 \
8 ASN1_STRING_length.3 \ 9 ASN1_STRING_length.3 \
9 ASN1_STRING_new.3 \ 10 ASN1_STRING_new.3 \