1.\" $OpenBSD: X509_STORE_CTX_get_ex_new_index.3,v 1.6 2021/07/29 08:32:13 schwarze Exp $ 2.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 3.\" 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 5.\" Copyright (c) 2009, 2014 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: July 29 2021 $ 52.Dt X509_STORE_CTX_GET_EX_NEW_INDEX 3 53.Os 54.Sh NAME 55.Nm X509_STORE_CTX_get_ex_new_index , 56.Nm X509_STORE_CTX_set_ex_data , 57.Nm X509_STORE_CTX_get_ex_data , 58.Nm X509_STORE_CTX_set_app_data , 59.Nm X509_STORE_CTX_get_app_data 60.Nd add application specific data to X509_STORE_CTX structures 61.Sh SYNOPSIS 62.In openssl/x509_vfy.h 63.Ft int 64.Fo X509_STORE_CTX_get_ex_new_index 65.Fa "long argl" 66.Fa "void *argp" 67.Fa "CRYPTO_EX_new *new_func" 68.Fa "CRYPTO_EX_dup *dup_func" 69.Fa "CRYPTO_EX_free *free_func" 70.Fc 71.Ft int 72.Fo X509_STORE_CTX_set_ex_data 73.Fa "X509_STORE_CTX *d" 74.Fa "int idx" 75.Fa "void *arg" 76.Fc 77.Ft void * 78.Fo X509_STORE_CTX_get_ex_data 79.Fa "X509_STORE_CTX *d" 80.Fa "int idx" 81.Fc 82.Ft int 83.Fo X509_STORE_CTX_set_app_data 84.Fa "X509_STORE_CTX *d" 85.Fa "void *arg" 86.Fc 87.Ft void * 88.Fo X509_STORE_CTX_get_app_data 89.Fa "X509_STORE_CTX *d" 90.Fc 91.Sh DESCRIPTION 92These functions handle application specific data in 93.Vt X509_STORE_CTX 94structures. 95Their usage is identical to that of 96.Xr RSA_get_ex_new_index 3 , 97.Xr RSA_set_ex_data 3 , 98and 99.Xr RSA_get_ex_data 3 . 100.Pp 101This mechanism is used internally by the 102.Xr ssl 3 103library to store the 104.Vt SSL 105structure associated with a verification operation in an 106.Vt X509_STORE_CTX 107structure. 108.Pp 109.Fn X509_STORE_CTX_set_app_data 110and 111.Fn X509_STORE_CTX_get_app_data 112are macros calling 113.Fn X509_STORE_CTX_set_ex_data 114and 115.Fn X509_STORE_CTX_get_ex_data , 116respectively, with an 117.Fa idx 118of 0. 119.Sh RETURN VALUES 120.Fn X509_STORE_CTX_get_ex_new_index 121returns a new index or \-1 on failure. 122.Pp 123.Fn X509_STORE_CTX_set_ex_data 124and 125.Fn X509_STORE_CTX_set_app_data 126return 1 on success or 0 on failure. 127.Pp 128.Fn X509_STORE_CTX_get_ex_data 129and 130.Fn X509_STORE_CTX_get_app_data 131return the application data or 132.Dv NULL 133on failure. 134.Dv NULL 135may also be valid application data, but currently these functions 136can only fail if given an invalid 137.Fa idx 138argument. 139.Sh SEE ALSO 140.Xr RSA_get_ex_new_index 3 , 141.Xr X509_STORE_CTX_new 3 142.Sh HISTORY 143.Fn X509_STORE_CTX_set_app_data 144and 145.Fn X509_STORE_CTX_get_app_data 146first appeared in SSLeay 0.8.0 and 147.Fn X509_STORE_CTX_get_ex_new_index , 148.Fn X509_STORE_CTX_set_ex_data , 149and 150.Fn X509_STORE_CTX_get_ex_data 151in SSLeay 0.9.0. 152All these functions have been available since 153.Ox 2.4 . 154