Commit 4eaaa913 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

crypt32: Remove some more superfluous pointer casts.

parent 6a5dda71
......@@ -83,7 +83,7 @@ PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT_TO_BE_SIGNED,
pbCertEncoded, cbCertEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL,
(BYTE *)&certInfo, &size);
&certInfo, &size);
if (ret)
{
BYTE *data = NULL;
......@@ -107,7 +107,7 @@ PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
}
end:
return (PCCERT_CONTEXT)cert;
return cert;
}
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(
......@@ -120,7 +120,7 @@ PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(
static void CertDataContext_Free(void *context)
{
PCERT_CONTEXT certContext = (PCERT_CONTEXT)context;
PCERT_CONTEXT certContext = context;
CryptMemFree(certContext->pbCertEncoded);
LocalFree(certContext->pCertInfo);
......@@ -140,7 +140,7 @@ DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext,
DWORD dwPropId)
{
PCONTEXT_PROPERTY_LIST properties = Context_GetProperties(
(void *)pCertContext, sizeof(CERT_CONTEXT));
pCertContext, sizeof(CERT_CONTEXT));
DWORD ret;
TRACE("(%p, %d)\n", pCertContext, dwPropId);
......@@ -191,7 +191,7 @@ static BOOL CertContext_CopyParam(void *pvData, DWORD *pcbData, const void *pb,
static BOOL CertContext_GetProperty(void *context, DWORD dwPropId,
void *pvData, DWORD *pcbData)
{
PCCERT_CONTEXT pCertContext = (PCCERT_CONTEXT)context;
PCCERT_CONTEXT pCertContext = context;
PCONTEXT_PROPERTY_LIST properties =
Context_GetProperties(context, sizeof(CERT_CONTEXT));
BOOL ret;
......@@ -349,7 +349,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
ret = CertContext_GetProperty((void *)pCertContext, dwPropId, pvData,
pcbData);
if (ret && pvData)
CRYPT_FixKeyProvInfoPointers((PCRYPT_KEY_PROV_INFO)pvData);
CRYPT_FixKeyProvInfoPointers(pvData);
break;
default:
ret = CertContext_GetProperty((void *)pCertContext, dwPropId, pvData,
......@@ -920,7 +920,7 @@ static BOOL compare_cert_by_md5_hash(PCCERT_CONTEXT pCertContext, DWORD dwType,
CERT_MD5_HASH_PROP_ID, hash, &size);
if (ret)
{
const CRYPT_HASH_BLOB *pHash = (const CRYPT_HASH_BLOB *)pvPara;
const CRYPT_HASH_BLOB *pHash = pvPara;
if (size == pHash->cbData)
ret = !memcmp(pHash->pbData, hash, size);
......@@ -941,7 +941,7 @@ static BOOL compare_cert_by_sha1_hash(PCCERT_CONTEXT pCertContext, DWORD dwType,
CERT_SHA1_HASH_PROP_ID, hash, &size);
if (ret)
{
const CRYPT_HASH_BLOB *pHash = (const CRYPT_HASH_BLOB *)pvPara;
const CRYPT_HASH_BLOB *pHash = pvPara;
if (size == pHash->cbData)
ret = !memcmp(pHash->pbData, hash, size);
......@@ -1043,7 +1043,7 @@ static BOOL compare_cert_by_issuer(PCCERT_CONTEXT pCertContext, DWORD dwType,
DWORD dwFlags, const void *pvPara)
{
BOOL ret = FALSE;
PCCERT_CONTEXT subject = (PCCERT_CONTEXT)pvPara;
PCCERT_CONTEXT subject = pvPara;
PCERT_EXTENSION ext;
DWORD size;
......@@ -1146,7 +1146,7 @@ static BOOL compare_cert_by_issuer(PCCERT_CONTEXT pCertContext, DWORD dwType,
static BOOL compare_existing_cert(PCCERT_CONTEXT pCertContext, DWORD dwType,
DWORD dwFlags, const void *pvPara)
{
PCCERT_CONTEXT toCompare = (PCCERT_CONTEXT)pvPara;
PCCERT_CONTEXT toCompare = pvPara;
return CertCompareCertificate(pCertContext->dwCertEncodingType,
pCertContext->pCertInfo, toCompare->pCertInfo);
}
......@@ -1154,7 +1154,7 @@ static BOOL compare_existing_cert(PCCERT_CONTEXT pCertContext, DWORD dwType,
static BOOL compare_cert_by_signature_hash(PCCERT_CONTEXT pCertContext, DWORD dwType,
DWORD dwFlags, const void *pvPara)
{
const CRYPT_HASH_BLOB *hash = (const CRYPT_HASH_BLOB *)pvPara;
const CRYPT_HASH_BLOB *hash = pvPara;
DWORD size = 0;
BOOL ret;
......@@ -1586,7 +1586,7 @@ BOOL WINAPI CryptHashToBeSigned(HCRYPTPROV_LEGACY hCryptProv,
pbEncoded, cbEncoded, pbComputedHash, *pcbComputedHash);
ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT,
pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, (void *)&info, &size);
pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size);
if (ret)
{
PCCRYPT_OID_INFO oidInfo;
......@@ -1808,7 +1808,7 @@ BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
{
case CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB:
{
PCRYPT_DATA_BLOB blob = (PCRYPT_DATA_BLOB)pvSubject;
PCRYPT_DATA_BLOB blob = pvSubject;
subjectBlob.pbData = blob->pbData;
subjectBlob.cbData = blob->cbData;
......@@ -1816,7 +1816,7 @@ BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
}
case CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT:
{
PCERT_CONTEXT context = (PCERT_CONTEXT)pvSubject;
PCERT_CONTEXT context = pvSubject;
subjectBlob.pbData = context->pbCertEncoded;
subjectBlob.cbData = context->cbCertEncoded;
......@@ -1824,7 +1824,7 @@ BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
}
case CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL:
{
PCRL_CONTEXT context = (PCRL_CONTEXT)pvSubject;
PCRL_CONTEXT context = pvSubject;
subjectBlob.pbData = context->pbCrlEncoded;
subjectBlob.cbData = context->cbCrlEncoded;
......@@ -1843,14 +1843,14 @@ BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT,
subjectBlob.pbData, subjectBlob.cbData,
CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL,
(BYTE *)&signedCert, &size);
&signedCert, &size);
if (ret)
{
switch (dwIssuerType)
{
case CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY:
ret = CRYPT_VerifyCertSignatureFromPublicKeyInfo(hCryptProv,
dwCertEncodingType, (PCERT_PUBLIC_KEY_INFO)pvIssuer,
dwCertEncodingType, pvIssuer,
signedCert);
break;
case CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT:
......@@ -2458,7 +2458,7 @@ static PCCERT_CONTEXT CRYPT_CreateSignedCert(const CRYPT_DER_BLOB *blob,
signedInfo.Signature.cUnusedBits = 0;
ret = CryptEncodeObjectEx(X509_ASN_ENCODING, X509_CERT,
&signedInfo, CRYPT_ENCODE_ALLOC_FLAG, NULL,
(BYTE *)&encodedSignedCert, &encodedSignedCertSize);
&encodedSignedCert, &encodedSignedCertSize);
if (ret)
{
context = CertCreateCertificateContext(X509_ASN_ENCODING,
......@@ -2687,7 +2687,7 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN
CRYPT_MakeCertInfo(&info, &serialBlob, pSubjectIssuerBlob,
pSignatureAlgorithm, pStartTime, pEndTime, pubKey, pExtensions);
ret = CryptEncodeObjectEx(X509_ASN_ENCODING, X509_CERT_TO_BE_SIGNED,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&blob.pbData,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &blob.pbData,
&blob.cbData);
if (ret)
{
......
......@@ -144,7 +144,7 @@ HCERTCHAINENGINE CRYPT_CreateChainEngine(HCERTSTORE root,
else
engine->CycleDetectionModulus = DEFAULT_CYCLE_MODULUS;
}
return (HCERTCHAINENGINE)engine;
return engine;
}
BOOL WINAPI CertCreateCertificateChainEngine(PCERT_CHAIN_ENGINE_CONFIG pConfig,
......@@ -383,7 +383,7 @@ static BOOL CRYPT_DecodeBasicConstraints(PCCERT_CONTEXT cert,
ret = CryptDecodeObjectEx(X509_ASN_ENCODING, szOID_BASIC_CONSTRAINTS,
ext->Value.pbData, ext->Value.cbData, CRYPT_DECODE_ALLOC_FLAG,
NULL, (LPBYTE)&info, &size);
NULL, &info, &size);
if (ret)
{
if (info->SubjectType.cbData == 1)
......
......@@ -42,7 +42,7 @@ typedef struct _WINE_COLLECTIONSTORE
static void WINAPI CRYPT_CollectionCloseStore(HCERTSTORE store, DWORD dwFlags)
{
PWINE_COLLECTIONSTORE cs = (PWINE_COLLECTIONSTORE)store;
PWINE_COLLECTIONSTORE cs = store;
PWINE_STORE_LIST_ENTRY entry, next;
TRACE("(%p, %08x)\n", store, dwFlags);
......@@ -51,12 +51,12 @@ static void WINAPI CRYPT_CollectionCloseStore(HCERTSTORE store, DWORD dwFlags)
entry)
{
TRACE("closing %p\n", entry);
CertCloseStore((HCERTSTORE)entry->store, dwFlags);
CertCloseStore(entry->store, dwFlags);
CryptMemFree(entry);
}
cs->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&cs->cs);
CRYPT_FreeStore((PWINECRYPT_CERTSTORE)store);
CRYPT_FreeStore(store);
}
static void *CRYPT_CollectionCreateContextFromChild(PWINE_COLLECTIONSTORE store,
......@@ -205,7 +205,7 @@ static BOOL CRYPT_CollectionAddCert(PWINECRYPT_CERTSTORE store, void *cert,
context->hCertStore = store;
*ppStoreContext = context;
}
CertFreeCertificateContext((PCCERT_CONTEXT)childContext);
CertFreeCertificateContext(childContext);
return ret;
}
......@@ -258,7 +258,7 @@ static BOOL CRYPT_CollectionDeleteCert(PWINECRYPT_CERTSTORE store,
TRACE("(%p, %p)\n", store, pCertContext);
ret = CertDeleteCertificateFromStore((PCCERT_CONTEXT)
ret = CertDeleteCertificateFromStore(
Context_GetLinkedContext(pCertContext, sizeof(CERT_CONTEXT)));
return ret;
}
......@@ -284,7 +284,7 @@ static BOOL CRYPT_CollectionAddCRL(PWINECRYPT_CERTSTORE store, void *crl,
context->hCertStore = store;
*ppStoreContext = context;
}
CertFreeCRLContext((PCCRL_CONTEXT)childContext);
CertFreeCRLContext(childContext);
return ret;
}
......@@ -336,7 +336,7 @@ static BOOL CRYPT_CollectionDeleteCRL(PWINECRYPT_CERTSTORE store,
TRACE("(%p, %p)\n", store, pCrlContext);
ret = CertDeleteCRLFromStore((PCCRL_CONTEXT)
ret = CertDeleteCRLFromStore(
Context_GetLinkedContext(pCrlContext, sizeof(CRL_CONTEXT)));
return ret;
}
......@@ -362,7 +362,7 @@ static BOOL CRYPT_CollectionAddCTL(PWINECRYPT_CERTSTORE store, void *ctl,
context->hCertStore = store;
*ppStoreContext = context;
}
CertFreeCTLContext((PCCTL_CONTEXT)childContext);
CertFreeCTLContext(childContext);
return ret;
}
......@@ -414,7 +414,7 @@ static BOOL CRYPT_CollectionDeleteCTL(PWINECRYPT_CERTSTORE store,
TRACE("(%p, %p)\n", store, pCtlContext);
ret = CertDeleteCTLFromStore((PCCTL_CONTEXT)
ret = CertDeleteCTLFromStore(
Context_GetLinkedContext(pCtlContext, sizeof(CTL_CONTEXT)));
return ret;
}
......@@ -457,8 +457,8 @@ PWINECRYPT_CERTSTORE CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv,
BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore,
HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority)
{
PWINE_COLLECTIONSTORE collection = (PWINE_COLLECTIONSTORE)hCollectionStore;
WINECRYPT_CERTSTORE *sibling = (WINECRYPT_CERTSTORE *)hSiblingStore;
PWINE_COLLECTIONSTORE collection = hCollectionStore;
WINECRYPT_CERTSTORE *sibling = hSiblingStore;
PWINE_STORE_LIST_ENTRY entry;
BOOL ret;
......@@ -525,8 +525,8 @@ BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore,
void WINAPI CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore,
HCERTSTORE hSiblingStore)
{
PWINE_COLLECTIONSTORE collection = (PWINE_COLLECTIONSTORE)hCollectionStore;
WINECRYPT_CERTSTORE *sibling = (WINECRYPT_CERTSTORE *)hSiblingStore;
PWINE_COLLECTIONSTORE collection = hCollectionStore;
WINECRYPT_CERTSTORE *sibling = hSiblingStore;
PWINE_STORE_LIST_ENTRY store, next;
TRACE("(%p, %p)\n", hCollectionStore, hSiblingStore);
......
......@@ -171,8 +171,8 @@ void Context_CopyProperties(const void *to, const void *from,
{
PCONTEXT_PROPERTY_LIST toProperties, fromProperties;
toProperties = Context_GetProperties((void *)to, contextSize);
fromProperties = Context_GetProperties((void *)from, contextSize);
toProperties = Context_GetProperties(to, contextSize);
fromProperties = Context_GetProperties(from, contextSize);
assert(toProperties && fromProperties);
ContextPropertyList_Copy(toProperties, fromProperties);
}
......
......@@ -45,7 +45,7 @@ PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType,
}
ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT_CRL_TO_BE_SIGNED,
pbCrlEncoded, cbCrlEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL,
(BYTE *)&crlInfo, &size);
&crlInfo, &size);
if (ret)
{
BYTE *data = NULL;
......@@ -69,7 +69,7 @@ PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType,
}
end:
return (PCCRL_CONTEXT)crl;
return crl;
}
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore,
......@@ -110,7 +110,7 @@ static BOOL compare_crl_issued_by(PCCRL_CONTEXT pCrlContext, DWORD dwType,
if (pvPara)
{
PCCERT_CONTEXT issuer = (PCCERT_CONTEXT)pvPara;
PCCERT_CONTEXT issuer = pvPara;
ret = CertCompareCertificateName(issuer->dwCertEncodingType,
&issuer->pCertInfo->Issuer, &pCrlContext->pCrlInfo->Issuer);
......@@ -127,7 +127,7 @@ static BOOL compare_crl_existing(PCCRL_CONTEXT pCrlContext, DWORD dwType,
if (pvPara)
{
PCCRL_CONTEXT crl = (PCCRL_CONTEXT)pvPara;
PCCRL_CONTEXT crl = pvPara;
ret = CertCompareCertificateName(pCrlContext->dwCertEncodingType,
&pCrlContext->pCrlInfo->Issuer, &crl->pCrlInfo->Issuer);
......@@ -234,7 +234,7 @@ PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext)
static void CrlDataContext_Free(void *context)
{
PCRL_CONTEXT crlContext = (PCRL_CONTEXT)context;
PCRL_CONTEXT crlContext = context;
CryptMemFree(crlContext->pbCrlEncoded);
LocalFree(crlContext->pCrlInfo);
......@@ -254,7 +254,7 @@ DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext,
DWORD dwPropId)
{
PCONTEXT_PROPERTY_LIST properties = Context_GetProperties(
(void *)pCRLContext, sizeof(CRL_CONTEXT));
pCRLContext, sizeof(CRL_CONTEXT));
DWORD ret;
TRACE("(%p, %d)\n", pCRLContext, dwPropId);
......@@ -428,7 +428,7 @@ static BOOL CRLContext_SetProperty(PCCRL_CONTEXT context, DWORD dwPropId,
}
case CERT_DATE_STAMP_PROP_ID:
ret = ContextPropertyList_SetProperty(properties, dwPropId,
(const BYTE *)pvData, sizeof(FILETIME));
pvData, sizeof(FILETIME));
break;
default:
FIXME("%d: stub\n", dwPropId);
......
......@@ -36,7 +36,7 @@ BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore,
PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
PCCTL_CONTEXT* ppStoreContext)
{
PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore;
PWINECRYPT_CERTSTORE store = hCertStore;
BOOL ret = TRUE;
PCCTL_CONTEXT toAdd = NULL, existing = NULL;
......@@ -161,7 +161,7 @@ BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore,
PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore,
PCCTL_CONTEXT pPrev)
{
WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore;
WINECRYPT_CERTSTORE *hcs = hCertStore;
PCCTL_CONTEXT ret;
TRACE("(%p, %p)\n", hCertStore, pPrev);
......@@ -194,7 +194,7 @@ static BOOL compare_ctl_by_md5_hash(PCCTL_CONTEXT pCtlContext, DWORD dwType,
&size);
if (ret)
{
const CRYPT_HASH_BLOB *pHash = (const CRYPT_HASH_BLOB *)pvPara;
const CRYPT_HASH_BLOB *pHash = pvPara;
if (size == pHash->cbData)
ret = !memcmp(pHash->pbData, hash, size);
......@@ -215,7 +215,7 @@ static BOOL compare_ctl_by_sha1_hash(PCCTL_CONTEXT pCtlContext, DWORD dwType,
&size);
if (ret)
{
const CRYPT_HASH_BLOB *pHash = (const CRYPT_HASH_BLOB *)pvPara;
const CRYPT_HASH_BLOB *pHash = pvPara;
if (size == pHash->cbData)
ret = !memcmp(pHash->pbData, hash, size);
......@@ -232,7 +232,7 @@ static BOOL compare_ctl_existing(PCCTL_CONTEXT pCtlContext, DWORD dwType,
if (pvPara)
{
PCCTL_CONTEXT ctl = (PCCTL_CONTEXT)pvPara;
PCCTL_CONTEXT ctl = pvPara;
if (pCtlContext->cbCtlContext == ctl->cbCtlContext)
{
......@@ -315,8 +315,7 @@ BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
}
else
{
PWINECRYPT_CERTSTORE hcs =
(PWINECRYPT_CERTSTORE)pCtlContext->hCertStore;
PWINECRYPT_CERTSTORE hcs = pCtlContext->hCertStore;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
ret = FALSE;
......@@ -400,7 +399,7 @@ PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType,
{
ret = CryptDecodeObjectEx(dwMsgAndCertEncodingType, PKCS_CTL,
content, contentSize, CRYPT_DECODE_ALLOC_FLAG, NULL,
(BYTE *)&ctlInfo, &size);
&ctlInfo, &size);
if (ret)
{
ctl = Context_CreateDataContext(sizeof(CTL_CONTEXT));
......@@ -450,7 +449,7 @@ end:
CryptMemFree(content);
CryptMsgClose(msg);
}
return (PCCTL_CONTEXT)ctl;
return ctl;
}
PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext)
......@@ -462,7 +461,7 @@ PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext)
static void CTLDataContext_Free(void *context)
{
PCTL_CONTEXT ctlContext = (PCTL_CONTEXT)context;
PCTL_CONTEXT ctlContext = context;
CryptMsgClose(ctlContext->hCryptMsg);
CryptMemFree(ctlContext->pbCtlEncoded);
......@@ -484,7 +483,7 @@ DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext,
DWORD dwPropId)
{
PCONTEXT_PROPERTY_LIST properties = Context_GetProperties(
(void *)pCTLContext, sizeof(CTL_CONTEXT));
pCTLContext, sizeof(CTL_CONTEXT));
DWORD ret;
TRACE("(%p, %d)\n", pCTLContext, dwPropId);
......@@ -656,7 +655,7 @@ static BOOL CTLContext_SetProperty(PCCTL_CONTEXT context, DWORD dwPropId,
}
case CERT_DATE_STAMP_PROP_ID:
ret = ContextPropertyList_SetProperty(properties, dwPropId,
(const BYTE *)pvData, sizeof(FILETIME));
pvData, sizeof(FILETIME));
break;
default:
FIXME("%d: stub\n", dwPropId);
......
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