From: Shane Lontis Date: Wed, 31 Jul 2019 10:56:34 +0000 (+1000) Subject: Rename X509_STORE ptr stored in opaque struct X509_STORE_CTX X-Git-Tag: openssl-3.0.0-alpha1~1694 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=faa9dcd4d468441422254ab2d887bb267e0245b6;p=oweals%2Fopenssl.git Rename X509_STORE ptr stored in opaque struct X509_STORE_CTX Change name from 'ctx' to 'store' to remove ctx->ctx from code. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9405) --- diff --git a/crypto/include/internal/x509_int.h b/crypto/include/internal/x509_int.h index f6897e1421..11a776953b 100644 --- a/crypto/include/internal/x509_int.h +++ b/crypto/include/internal/x509_int.h @@ -197,7 +197,7 @@ struct x509_st { * kept and passed around. */ struct x509_store_ctx_st { /* X509_STORE_CTX */ - X509_STORE *ctx; + X509_STORE *store; /* The following are set by the caller */ /* The cert to check */ X509 *cert; diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index d3c1fef22c..3a90ce288e 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -289,7 +289,7 @@ X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, X509_NAME *name, X509_OBJECT *ret) { - X509_STORE *store = vs->ctx; + X509_STORE *store = vs->store; X509_LOOKUP *lu; X509_OBJECT stmp, *tmp; int i, j; @@ -533,7 +533,7 @@ STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) STACK_OF(X509) *sk = NULL; X509 *x; X509_OBJECT *obj; - X509_STORE *store = ctx->ctx; + X509_STORE *store = ctx->store; if (store == NULL) return NULL; @@ -586,7 +586,7 @@ STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) STACK_OF(X509_CRL) *sk = sk_X509_CRL_new_null(); X509_CRL *x; X509_OBJECT *obj, *xobj = X509_OBJECT_new(); - X509_STORE *store = ctx->ctx; + X509_STORE *store = ctx->store; /* Always do lookup to possibly add new CRLs to cache */ if (sk == NULL @@ -665,7 +665,7 @@ int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) { X509_NAME *xn; X509_OBJECT *obj = X509_OBJECT_new(), *pobj = NULL; - X509_STORE *store = ctx->ctx; + X509_STORE *store = ctx->store; int i, ok, idx, ret; if (obj == NULL) @@ -900,5 +900,5 @@ void *X509_STORE_get_ex_data(X509_STORE *ctx, int idx) X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx) { - return ctx->ctx; + return ctx->store; } diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index bbf61d44b2..0282c7aa9e 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -1276,7 +1276,7 @@ static int check_crl_path(X509_STORE_CTX *ctx, X509 *x) /* Don't allow recursive CRL path validation */ if (ctx->parent) return 0; - if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted)) + if (!X509_STORE_CTX_init(&crl_ctx, ctx->store, x, ctx->untrusted)) return -1; crl_ctx.crls = ctx->crls; @@ -2201,7 +2201,7 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, { int ret = 1; - ctx->ctx = store; + ctx->store = store; ctx->cert = x509; ctx->untrusted = chain; ctx->crls = NULL;