xref: /openbsd-src/lib/libcrypto/man/BIO_get_ex_new_index.3 (revision 8e0c768258d4632c51876b4397034bc3152bf8db)
1.\" $OpenBSD: BIO_get_ex_new_index.3,v 1.12 2019/08/16 12:16:22 schwarze Exp $
2.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
3.\"
4.\" This file was written by Rich Salz <rsalz@akamai.com>.
5.\" Copyright (c) 2015, 2016 The OpenSSL Project.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in
16.\"    the documentation and/or other materials provided with the
17.\"    distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\"    software must display the following acknowledgment:
21.\"    "This product includes software developed by the OpenSSL Project
22.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\"    endorse or promote products derived from this software without
26.\"    prior written permission. For written permission, please contact
27.\"    openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\"    nor may "OpenSSL" appear in their names without prior written
31.\"    permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\"    acknowledgment:
35.\"    "This product includes software developed by the OpenSSL Project
36.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: August 16 2019 $
52.Dt BIO_GET_EX_NEW_INDEX 3
53.Os
54.Sh NAME
55.Nm BIO_get_ex_new_index ,
56.Nm BIO_set_ex_data ,
57.Nm BIO_get_ex_data ,
58.Nm ENGINE_get_ex_new_index ,
59.Nm ENGINE_set_ex_data ,
60.Nm ENGINE_get_ex_data ,
61.Nm UI_get_ex_new_index ,
62.Nm UI_set_ex_data ,
63.Nm UI_get_ex_data ,
64.Nm X509_get_ex_new_index ,
65.Nm X509_set_ex_data ,
66.Nm X509_get_ex_data ,
67.Nm EC_KEY_get_ex_new_index ,
68.Nm EC_KEY_get_ex_data ,
69.Nm EC_KEY_set_ex_data ,
70.Nm ECDH_get_ex_new_index ,
71.Nm ECDH_set_ex_data ,
72.Nm ECDH_get_ex_data ,
73.Nm ECDSA_get_ex_new_index ,
74.Nm ECDSA_set_ex_data ,
75.Nm ECDSA_get_ex_data
76.Nd application-specific data
77.Sh SYNOPSIS
78.In openssl/bio.h
79.In openssl/engine.h
80.In openssl/ui.h
81.In openssl/x509.h
82.In openssl/ec.h
83.In openssl/ecdh.h
84.In openssl/ecdsa.h
85.Ft int
86.Fo TYPE_get_ex_new_index
87.Fa "long argl"
88.Fa "void *argp"
89.Fa "CRYPTO_EX_new *new_func"
90.Fa "CRYPTO_EX_dup *dup_func"
91.Fa "CRYPTO_EX_free *free_func"
92.Fc
93.Ft int
94.Fo TYPE_set_ex_data
95.Fa "TYPE *d"
96.Fa "int idx"
97.Fa "void *arg"
98.Fc
99.Ft void *
100.Fo TYPE_get_ex_data
101.Fa "TYPE *d"
102.Fa "int idx"
103.Fc
104.Sh DESCRIPTION
105In the description here,
106.Vt TYPE
107is used a placeholder for any of the OpenSSL datatypes listed in
108.Xr CRYPTO_get_ex_new_index 3 .
109.Pp
110These functions handle application-specific data in OpenSSL data
111structures.
112Their usage is identical to that of
113.Xr RSA_get_ex_new_index 3 ,
114.Xr RSA_set_ex_data 3 ,
115and
116.Xr RSA_get_ex_data 3 .
117.Pp
118.Fn TYPE_get_ex_new_index
119is a macro that calls
120.Xr CRYPTO_get_ex_new_index 3
121with the correct index value.
122.Pp
123.Fn TYPE_set_ex_data
124is a function that calls
125.Xr CRYPTO_set_ex_data 3
126with an offset into the opaque exdata part of the
127.Vt TYPE
128object.
129.Pp
130.Fn TYPE_get_ex_data
131is a function that calls
132.Xr CRYPTO_get_ex_data 3
133with an offset into the opaque exdata part of the
134.Vt TYPE
135object.
136.Sh RETURN VALUES
137.Fn TYPE_get_new_ex_index
138returns a new index on success or \-1 on error.
139.Pp
140.Fn TYPE_set_ex_data
141returns 1 on success or 0 on error.
142.Pp
143.Fn TYPE_get_ex_data
144returns the application data or
145.Dv NULL
146if an error occurred.
147.Sh SEE ALSO
148.Xr BIO_new 3 ,
149.Xr CRYPTO_get_ex_new_index 3 ,
150.Xr RSA_get_ex_new_index 3 ,
151.Xr X509_new 3
152.Sh HISTORY
153.Fn BIO_get_ex_new_index ,
154.Fn BIO_set_ex_data ,
155and
156.Fn BIO_get_ex_data
157first appeared in SSLeay 0.9.0 and have been available since
158.Ox 2.4 .
159.Pp
160.Fn X509_get_ex_new_index ,
161.Fn X509_set_ex_data ,
162and
163.Fn X509_get_ex_data
164first appeared in OpenSSL 0.9.5 and have been available since
165.Ox 2.7 .
166.Pp
167.Fn ENGINE_get_ex_new_index ,
168.Fn ENGINE_set_ex_data ,
169.Fn ENGINE_get_ex_data ,
170.Fn UI_get_ex_new_index ,
171.Fn UI_set_ex_data ,
172and
173.Fn UI_get_ex_data
174first appeared in OpenSSL 0.9.7 and have been available since
175.Ox 3.2 .
176.Pp
177.Fn ECDH_get_ex_new_index ,
178.Fn ECDH_set_ex_data ,
179.Fn ECDH_get_ex_data ,
180.Fn ECDSA_get_ex_new_index ,
181.Fn ECDSA_set_ex_data ,
182and
183.Fn ECDSA_get_ex_data
184first appeared in OpenSSL 0.9.8 and have been available since
185.Ox 4.5 .
186.Pp
187.Fn EC_KEY_get_ex_new_index ,
188.Fn EC_KEY_set_ex_data ,
189and
190.Fn EC_KEY_get_ex_data
191first appeared in OpenSSL 1.1.0 and have been available since
192.Ox 6.5 .
193