Commit 1c501c65 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent b3e321df
......@@ -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 = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment