crypt32: Rename "crl" and "cloned" to "dst" and "src" in CRL_clone().

"cloned" is very ambiguous and can be interpreted as the destination rather than
the source.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-07-15 11:25:16 -05:00 committed by Alexandre Julliard
parent b3e321dfd5
commit 1c501c6587

View file

@ -40,40 +40,38 @@ static const context_vtbl_t crl_vtbl;
static context_t *CRL_clone(context_t *context, WINECRYPT_CERTSTORE *store, BOOL use_link)
{
crl_t *crl;
crl_t *dst;
if(use_link) {
crl = (crl_t*)Context_CreateLinkContext(sizeof(CRL_CONTEXT), context, store);
if(!crl)
if (!(dst = (crl_t *)Context_CreateLinkContext(sizeof(CRL_CONTEXT), context, store)))
return NULL;
}else {
const crl_t *cloned = (const crl_t*)context;
const crl_t *src = (const crl_t*)context;
DWORD size = 0;
BOOL res;
crl = (crl_t*)Context_CreateDataContext(sizeof(CRL_CONTEXT), &crl_vtbl, store);
if(!crl)
if (!(dst = (crl_t *)Context_CreateDataContext(sizeof(CRL_CONTEXT), &crl_vtbl, store)))
return NULL;
Context_CopyProperties(&crl->ctx, &cloned->ctx);
Context_CopyProperties(&dst->ctx, &src->ctx);
crl->ctx.dwCertEncodingType = cloned->ctx.dwCertEncodingType;
crl->ctx.pbCrlEncoded = CryptMemAlloc(cloned->ctx.cbCrlEncoded);
memcpy(crl->ctx.pbCrlEncoded, cloned->ctx.pbCrlEncoded, cloned->ctx.cbCrlEncoded);
crl->ctx.cbCrlEncoded = cloned->ctx.cbCrlEncoded;
dst->ctx.dwCertEncodingType = src->ctx.dwCertEncodingType;
dst->ctx.pbCrlEncoded = CryptMemAlloc(src->ctx.cbCrlEncoded);
memcpy(dst->ctx.pbCrlEncoded, src->ctx.pbCrlEncoded, src->ctx.cbCrlEncoded);
dst->ctx.cbCrlEncoded = src->ctx.cbCrlEncoded;
/* FIXME: We don't need to decode the object here, we could just clone crl info. */
res = CryptDecodeObjectEx(crl->ctx.dwCertEncodingType, X509_CERT_CRL_TO_BE_SIGNED,
crl->ctx.pbCrlEncoded, crl->ctx.cbCrlEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL,
&crl->ctx.pCrlInfo, &size);
/* FIXME: We don't need to decode the object here, we could just clone dst info. */
res = CryptDecodeObjectEx(dst->ctx.dwCertEncodingType, X509_CERT_CRL_TO_BE_SIGNED,
dst->ctx.pbCrlEncoded, dst->ctx.cbCrlEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL,
&dst->ctx.pCrlInfo, &size);
if(!res) {
CertFreeCRLContext(&crl->ctx);
CertFreeCRLContext(&dst->ctx);
return NULL;
}
}
crl->ctx.hCertStore = store;
return &crl->base;
dst->ctx.hCertStore = store;
return &dst->base;
}
static const context_vtbl_t crl_vtbl = {