mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
implement X509 store ctx set error function
This commit is contained in:
22
src/ssl.c
22
src/ssl.c
@@ -18418,14 +18418,6 @@ int wolfSSL_X509_CRL_verify(WOLFSSL_X509_CRL* crl, WOLFSSL_EVP_PKEY* key)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_WOLFSSL_STUB
|
||||
void wolfSSL_X509_STORE_CTX_set_error(WOLFSSL_X509_STORE_CTX* ctx, int err)
|
||||
{
|
||||
(void)ctx;
|
||||
(void)err;
|
||||
WOLFSSL_STUB("X509_STORE_CTX_set_error");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_EXTRA
|
||||
void wolfSSL_X509_STORE_CTX_set_time(WOLFSSL_X509_STORE_CTX* ctx,
|
||||
@@ -18780,6 +18772,20 @@ int wolfSSL_get_ex_data_X509_STORE_CTX_idx(void)
|
||||
}
|
||||
|
||||
|
||||
/* Set an error stat in the X509 STORE CTX
|
||||
*
|
||||
* Returns positive index on success and negative values on failure
|
||||
*/
|
||||
void wolfSSL_X509_STORE_CTX_set_error(WOLFSSL_X509_STORE_CTX* ctx, int er)
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_X509_STORE_CTX_set_error");
|
||||
|
||||
if (ctx != NULL) {
|
||||
ctx->error = er;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Sets a function callback that will send information about the state of all
|
||||
* WOLFSSL objects that have been created by the WOLFSSL_CTX structure passed
|
||||
* in.
|
||||
|
@@ -14355,6 +14355,8 @@ static void test_wolfSSL_X509_STORE_CTX(void)
|
||||
AssertIntEQ(X509_STORE_add_cert(str, x509), SSL_SUCCESS);
|
||||
AssertIntEQ(X509_STORE_CTX_init(ctx, str, x509, NULL), SSL_SUCCESS);
|
||||
AssertIntEQ(SSL_get_ex_data_X509_STORE_CTX_idx(), 0);
|
||||
X509_STORE_CTX_set_error(ctx, -5);
|
||||
X509_STORE_CTX_set_error(NULL, -5);
|
||||
|
||||
X509_STORE_CTX_free(ctx);
|
||||
|
||||
|
@@ -897,8 +897,6 @@ WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_nextUpdate(WOLFSSL_X509_CRL*
|
||||
|
||||
WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509*);
|
||||
WOLFSSL_API int wolfSSL_X509_CRL_verify(WOLFSSL_X509_CRL*, WOLFSSL_EVP_PKEY*);
|
||||
WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_error(WOLFSSL_X509_STORE_CTX*,
|
||||
int);
|
||||
WOLFSSL_API void wolfSSL_X509_OBJECT_free_contents(WOLFSSL_X509_OBJECT*);
|
||||
WOLFSSL_API WOLFSSL_PKCS8_PRIV_KEY_INFO* wolfSSL_d2i_PKCS8_PKEY_bio(
|
||||
WOLFSSL_BIO* bio, WOLFSSL_PKCS8_PRIV_KEY_INFO** pkey);
|
||||
@@ -943,6 +941,8 @@ WOLFSSL_API void wolfSSL_CTX_set_client_CA_list(WOLFSSL_CTX*,
|
||||
WOLF_STACK_OF(WOLFSSL_X509_NAME)*);
|
||||
WOLFSSL_API void* wolfSSL_X509_STORE_CTX_get_ex_data(WOLFSSL_X509_STORE_CTX*, int);
|
||||
WOLFSSL_API int wolfSSL_get_ex_data_X509_STORE_CTX_idx(void);
|
||||
WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_error(
|
||||
WOLFSSL_X509_STORE_CTX* ctx, int er);
|
||||
WOLFSSL_API void* wolfSSL_get_ex_data(const WOLFSSL*, int);
|
||||
|
||||
WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX*,
|
||||
|
Reference in New Issue
Block a user