1.\" $OpenBSD: BIO_get_ex_new_index.3,v 1.11 2019/06/06 01:06:58 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: June 6 2019 $ 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/bio.h 77.In openssl/engine.h 78.In openssl/ui.h 79.In openssl/x509.h 80.In openssl/ecdh.h 81.In openssl/ecdsa.h 82.Ft int 83.Fo TYPE_get_ex_new_index 84.Fa "long argl" 85.Fa "void *argp" 86.Fa "CRYPTO_EX_new *new_func" 87.Fa "CRYPTO_EX_dup *dup_func" 88.Fa "CRYPTO_EX_free *free_func" 89.Fc 90.Ft int 91.Fo TYPE_set_ex_data 92.Fa "TYPE *d" 93.Fa "int idx" 94.Fa "void *arg" 95.Fc 96.Ft void * 97.Fo TYPE_get_ex_data 98.Fa "TYPE *d" 99.Fa "int idx" 100.Fc 101.Sh DESCRIPTION 102In the description here, 103.Vt TYPE 104is used a placeholder for any of the OpenSSL datatypes listed in 105.Xr CRYPTO_get_ex_new_index 3 . 106.Pp 107These functions handle application-specific data in OpenSSL data 108structures. 109Their usage is identical to that of 110.Xr RSA_get_ex_new_index 3 , 111.Xr RSA_set_ex_data 3 , 112and 113.Xr RSA_get_ex_data 3 . 114.Pp 115.Fn TYPE_get_ex_new_index 116is a macro that calls 117.Xr CRYPTO_get_ex_new_index 3 118with the correct index value. 119.Pp 120.Fn TYPE_set_ex_data 121is a function that calls 122.Xr CRYPTO_set_ex_data 3 123with an offset into the opaque exdata part of the 124.Vt TYPE 125object. 126.Pp 127.Fn TYPE_get_ex_data 128is a function that calls 129.Xr CRYPTO_get_ex_data 3 130with an offset into the opaque exdata part of the 131.Vt TYPE 132object. 133.Sh RETURN VALUES 134.Fn TYPE_get_new_ex_index 135returns a new index on success or \-1 on error. 136.Pp 137.Fn TYPE_set_ex_data 138returns 1 on success or 0 on error. 139.Pp 140.Fn TYPE_get_ex_data 141returns the application data or 142.Dv NULL 143if an error occurred. 144.Sh SEE ALSO 145.Xr BIO_new 3 , 146.Xr CRYPTO_get_ex_new_index 3 , 147.Xr RSA_get_ex_new_index 3 , 148.Xr X509_new 3 149.Sh HISTORY 150.Fn BIO_get_ex_new_index , 151.Fn BIO_set_ex_data , 152and 153.Fn BIO_get_ex_data 154first appeared in SSLeay 0.9.0 and have been available since 155.Ox 2.4 . 156.Pp 157.Fn X509_get_ex_new_index , 158.Fn X509_set_ex_data , 159and 160.Fn X509_get_ex_data 161first appeared in OpenSSL 0.9.5 and have been available since 162.Ox 2.7 . 163.Pp 164.Fn ENGINE_get_ex_new_index , 165.Fn ENGINE_set_ex_data , 166.Fn ENGINE_get_ex_data , 167.Fn UI_get_ex_new_index , 168.Fn UI_set_ex_data , 169and 170.Fn UI_get_ex_data 171first appeared in OpenSSL 0.9.7 and have been available since 172.Ox 3.2 . 173.Pp 174.Fn ECDH_get_ex_new_index , 175.Fn ECDH_set_ex_data , 176.Fn ECDH_get_ex_data , 177.Fn ECDSA_get_ex_new_index , 178.Fn ECDSA_set_ex_data , 179and 180.Fn ECDSA_get_ex_data 181first appeared in OpenSSL 0.9.8 and have been available since 182.Ox 4.5 . 183