1.\" $OpenBSD: BIO_get_ex_new_index.3,v 1.9 2018/04/18 03:39:22 schwarze Exp $ 2.\" full merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400 3.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 4.\" 5.\" This file was written by Rich Salz <rsalz@akamai.com>. 6.\" Copyright (c) 2015, 2016 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: April 18 2018 $ 53.Dt BIO_GET_EX_NEW_INDEX 3 54.Os 55.Sh NAME 56.Nm BIO_get_ex_new_index , 57.Nm BIO_set_ex_data , 58.Nm BIO_get_ex_data , 59.Nm ENGINE_get_ex_new_index , 60.Nm ENGINE_set_ex_data , 61.Nm ENGINE_get_ex_data , 62.Nm UI_get_ex_new_index , 63.Nm UI_set_ex_data , 64.Nm UI_get_ex_data , 65.Nm X509_get_ex_new_index , 66.Nm X509_set_ex_data , 67.Nm X509_get_ex_data , 68.Nm ECDH_get_ex_new_index , 69.Nm ECDH_set_ex_data , 70.Nm ECDH_get_ex_data , 71.Nm ECDSA_get_ex_new_index , 72.Nm ECDSA_set_ex_data , 73.Nm ECDSA_get_ex_data 74.Nd application-specific data 75.Sh SYNOPSIS 76.In openssl/x509.h 77.Ft int 78.Fo TYPE_get_ex_new_index 79.Fa "long argl" 80.Fa "void *argp" 81.Fa "CRYPTO_EX_new *new_func" 82.Fa "CRYPTO_EX_dup *dup_func" 83.Fa "CRYPTO_EX_free *free_func" 84.Fc 85.Ft int 86.Fo TYPE_set_ex_data 87.Fa "TYPE *d" 88.Fa "int idx" 89.Fa "void *arg" 90.Fc 91.Ft void * 92.Fo TYPE_get_ex_data 93.Fa "TYPE *d" 94.Fa "int idx" 95.Fc 96.Sh DESCRIPTION 97In the description here, 98.Vt TYPE 99is used a placeholder for any of the OpenSSL datatypes listed in 100.Xr CRYPTO_get_ex_new_index 3 . 101.Pp 102These functions handle application-specific data for OpenSSL data 103structures. 104.Pp 105.Fn TYPE_get_ex_new_index 106is a macro that calls 107.Xr CRYPTO_get_ex_new_index 3 108with the correct index value. 109.Pp 110.Fn TYPE_set_ex_data 111is a function that calls 112.Xr CRYPTO_set_ex_data 3 113with an offset into the opaque exdata part of the 114.Vt TYPE 115object. 116.Pp 117.Fn TYPE_get_ex_data 118is a function that calls 119.Xr CRYPTO_get_ex_data 3 120with an offset into the opaque exdata part of the 121.Vt TYPE 122object. 123.Sh RETURN VALUES 124.Fn TYPE_get_new_ex_index 125returns a new index on success or \-1 on error. 126.Pp 127.Fn TYPE_set_ex_data 128returns 1 on success or 0 on error. 129.Pp 130.Fn TYPE_get_ex_data 131returns the application data or 132.Dv NULL 133if an error occurred. 134.Sh SEE ALSO 135.Xr CRYPTO_get_ex_new_index 3 , 136.Xr RSA_get_ex_new_index 3 137.Sh HISTORY 138.Fn BIO_get_ex_new_index , 139.Fn BIO_set_ex_data , 140and 141.Fn BIO_get_ex_data 142first appeared in SSLeay 0.9.0 and have been available since 143.Ox 2.4 . 144.Pp 145.Fn X509_get_ex_new_index , 146.Fn X509_set_ex_data , 147and 148.Fn X509_get_ex_data 149first appeared in OpenSSL 0.9.5 and have been available since 150.Ox 2.7 . 151.Pp 152.Fn ENGINE_get_ex_new_index , 153.Fn ENGINE_set_ex_data , 154.Fn ENGINE_get_ex_data , 155.Fn UI_get_ex_new_index , 156.Fn UI_set_ex_data , 157and 158.Fn UI_get_ex_data 159first appeared in OpenSSL 0.9.7 and have been available since 160.Ox 3.2 . 161.Pp 162.Fn ECDH_get_ex_new_index , 163.Fn ECDH_set_ex_data , 164.Fn ECDH_get_ex_data , 165.Fn ECDSA_get_ex_new_index , 166.Fn ECDSA_set_ex_data , 167and 168.Fn ECDSA_get_ex_data 169first appeared in OpenSSL 0.9.8 and have been available since 170.Ox 4.5 . 171