---
name: "libressl-X509_STORE_CTX_get_ex_new_index"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-X509_STORE_CTX_get_ex_new_index"
---

# libressl-X509\_STORE\_CTX\_get\_ex\_new\_index(3)

add application specific data to X509\_STORE\_CTX structures

## NAME

**X509\_STORE\_CTX\_get\_ex\_new\_index**, **X509\_STORE\_CTX\_set\_ex\_data**, **X509\_STORE\_CTX\_get\_ex\_data**, **X509\_STORE\_CTX\_set\_app\_data**, **X509\_STORE\_CTX\_get\_app\_data** – add application specific data to X509\_STORE\_CTX structures

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/x509\_vfy.h\>**

*int*\

**X509\_STORE\_CTX\_get\_ex\_new\_index**(*long argl*, *void \*argp*, *CRYPTO\_EX\_new \*new\_func*, *CRYPTO\_EX\_dup \*dup\_func*, *CRYPTO\_EX\_free \*free\_func*);

*int*\

**X509\_STORE\_CTX\_set\_ex\_data**(*X509\_STORE\_CTX \*d*, *int idx*, *void \*arg*);

*void* *\**\

**X509\_STORE\_CTX\_get\_ex\_data**(*X509\_STORE\_CTX \*d*, *int idx*);

*int*\

**X509\_STORE\_CTX\_set\_app\_data**(*X509\_STORE\_CTX \*d*, *void \*arg*);

*void* *\**\

**X509\_STORE\_CTX\_get\_app\_data**(*X509\_STORE\_CTX \*d*);

## DESCRIPTION

These functions handle application specific data in *X509\_STORE\_CTX* structures. Their usage is identical to that of RSA\_get\_ex\_new\_index(3), RSA\_set\_ex\_data(3), and RSA\_get\_ex\_data(3).

This mechanism is used internally by the [ssl(3)](/ssl/3.md) library to store the *SSL* structure associated with a verification operation in an *X509\_STORE\_CTX* structure.

**X509\_STORE\_CTX\_set\_app\_data**() and **X509\_STORE\_CTX\_get\_app\_data**() are macros calling **X509\_STORE\_CTX\_set\_ex\_data**() and **X509\_STORE\_CTX\_get\_ex\_data**(), respectively, with an *idx* of 0.

## RETURN VALUES

**X509\_STORE\_CTX\_get\_ex\_new\_index**() returns a new index or -1 on failure.

**X509\_STORE\_CTX\_set\_ex\_data**() and **X509\_STORE\_CTX\_set\_app\_data**() return 1 on success or 0 on failure.

**X509\_STORE\_CTX\_get\_ex\_data**() and **X509\_STORE\_CTX\_get\_app\_data**() return the application data or NULL on failure. NULL may also be valid application data, but currently these functions can only fail if given an invalid *idx* argument.

## SEE ALSO

RSA\_get\_ex\_new\_index(3), X509\_STORE\_CTX\_new(3)

## HISTORY

**X509\_STORE\_CTX\_set\_app\_data**() and **X509\_STORE\_CTX\_get\_app\_data**() first appeared in SSLeay 0.8.0 and **X509\_STORE\_CTX\_get\_ex\_new\_index**(), **X509\_STORE\_CTX\_set\_ex\_data**(), and **X509\_STORE\_CTX\_get\_ex\_data**() in SSLeay 0.9.0. All these functions have been available since OpenBSD 2.4.
