mirror of
https://github.com/reactos/reactos.git
synced 2024-08-22 03:12:51 +00:00
[CRYPTNET]
* Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62885
This commit is contained in:
parent
e0cf48f17f
commit
afd0889185
|
@ -466,7 +466,6 @@ static BOOL CRYPT_GetObjectFromFile(HANDLE hFile, PCRYPT_BLOB_ARRAY pObject)
|
||||||
blob.pbData = CryptMemAlloc(size.u.LowPart);
|
blob.pbData = CryptMemAlloc(size.u.LowPart);
|
||||||
if (blob.pbData)
|
if (blob.pbData)
|
||||||
{
|
{
|
||||||
blob.cbData = size.u.LowPart;
|
|
||||||
ret = ReadFile(hFile, blob.pbData, size.u.LowPart, &blob.cbData,
|
ret = ReadFile(hFile, blob.pbData, size.u.LowPart, &blob.cbData,
|
||||||
NULL);
|
NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1427,61 +1426,24 @@ static BOOL CRYPT_GetCreateFunction(LPCSTR pszObjectOid,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef BOOL (*get_object_expiration_func)(const void *pvContext,
|
static BOOL CRYPT_GetExpiration(const void *object, const char *pszObjectOid, FILETIME *expiration)
|
||||||
FILETIME *expiration);
|
|
||||||
|
|
||||||
static BOOL CRYPT_GetExpirationFromCert(const void *pvObject, FILETIME *expiration)
|
|
||||||
{
|
{
|
||||||
PCCERT_CONTEXT cert = pvObject;
|
if (!IS_INTOID(pszObjectOid))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
*expiration = cert->pCertInfo->NotAfter;
|
switch (LOWORD(pszObjectOid)) {
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL CRYPT_GetExpirationFromCRL(const void *pvObject, FILETIME *expiration)
|
|
||||||
{
|
|
||||||
PCCRL_CONTEXT cert = pvObject;
|
|
||||||
|
|
||||||
*expiration = cert->pCrlInfo->NextUpdate;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL CRYPT_GetExpirationFromCTL(const void *pvObject, FILETIME *expiration)
|
|
||||||
{
|
|
||||||
PCCTL_CONTEXT cert = pvObject;
|
|
||||||
|
|
||||||
*expiration = cert->pCtlInfo->NextUpdate;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL CRYPT_GetExpirationFunction(LPCSTR pszObjectOid,
|
|
||||||
get_object_expiration_func *getExpiration)
|
|
||||||
{
|
|
||||||
BOOL ret;
|
|
||||||
|
|
||||||
if (IS_INTOID(pszObjectOid))
|
|
||||||
{
|
|
||||||
switch (LOWORD(pszObjectOid))
|
|
||||||
{
|
|
||||||
case LOWORD(CONTEXT_OID_CERTIFICATE):
|
case LOWORD(CONTEXT_OID_CERTIFICATE):
|
||||||
*getExpiration = CRYPT_GetExpirationFromCert;
|
*expiration = ((const CERT_CONTEXT*)object)->pCertInfo->NotAfter;
|
||||||
ret = TRUE;
|
return TRUE;
|
||||||
break;
|
|
||||||
case LOWORD(CONTEXT_OID_CRL):
|
case LOWORD(CONTEXT_OID_CRL):
|
||||||
*getExpiration = CRYPT_GetExpirationFromCRL;
|
*expiration = ((const CRL_CONTEXT*)object)->pCrlInfo->NextUpdate;
|
||||||
ret = TRUE;
|
return TRUE;
|
||||||
break;
|
|
||||||
case LOWORD(CONTEXT_OID_CTL):
|
case LOWORD(CONTEXT_OID_CTL):
|
||||||
*getExpiration = CRYPT_GetExpirationFromCTL;
|
*expiration = ((const CTL_CONTEXT*)object)->pCtlInfo->NextUpdate;
|
||||||
ret = TRUE;
|
return TRUE;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
return FALSE;
|
||||||
ret = FALSE;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1514,21 +1476,17 @@ BOOL WINAPI CryptRetrieveObjectByUrlW(LPCWSTR pszURL, LPCSTR pszObjectOid,
|
||||||
CRYPT_BLOB_ARRAY object = { 0, NULL };
|
CRYPT_BLOB_ARRAY object = { 0, NULL };
|
||||||
PFN_FREE_ENCODED_OBJECT_FUNC freeObject;
|
PFN_FREE_ENCODED_OBJECT_FUNC freeObject;
|
||||||
void *freeContext;
|
void *freeContext;
|
||||||
|
FILETIME expires;
|
||||||
|
|
||||||
ret = retrieve(pszURL, pszObjectOid, dwRetrievalFlags, dwTimeout,
|
ret = retrieve(pszURL, pszObjectOid, dwRetrievalFlags, dwTimeout,
|
||||||
&object, &freeObject, &freeContext, hAsyncRetrieve, pCredentials,
|
&object, &freeObject, &freeContext, hAsyncRetrieve, pCredentials,
|
||||||
pAuxInfo);
|
pAuxInfo);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
get_object_expiration_func getExpiration;
|
|
||||||
|
|
||||||
ret = create(pszObjectOid, dwRetrievalFlags, &object, ppvObject);
|
ret = create(pszObjectOid, dwRetrievalFlags, &object, ppvObject);
|
||||||
if (ret && !(dwRetrievalFlags & CRYPT_DONT_CACHE_RESULT) &&
|
if (ret && !(dwRetrievalFlags & CRYPT_DONT_CACHE_RESULT) &&
|
||||||
CRYPT_GetExpirationFunction(pszObjectOid, &getExpiration))
|
CRYPT_GetExpiration(*ppvObject, pszObjectOid, &expires))
|
||||||
{
|
{
|
||||||
FILETIME expires;
|
|
||||||
|
|
||||||
if (getExpiration(*ppvObject, &expires))
|
|
||||||
CRYPT_CacheURL(pszURL, &object, dwRetrievalFlags, expires);
|
CRYPT_CacheURL(pszURL, &object, dwRetrievalFlags, expires);
|
||||||
}
|
}
|
||||||
freeObject(pszObjectOid, &object, freeContext);
|
freeObject(pszObjectOid, &object, freeContext);
|
||||||
|
@ -1814,14 +1772,14 @@ typedef struct _CERT_REVOCATION_PARA_NO_EXTRA_FIELDS {
|
||||||
HCERTSTORE *rgCertStore;
|
HCERTSTORE *rgCertStore;
|
||||||
HCERTSTORE hCrlStore;
|
HCERTSTORE hCrlStore;
|
||||||
LPFILETIME pftTimeToUse;
|
LPFILETIME pftTimeToUse;
|
||||||
} CERT_REVOCATION_PARA_NO_EXTRA_FIELDS, *PCERT_REVOCATION_PARA_NO_EXTRA_FIELDS;
|
} CERT_REVOCATION_PARA_NO_EXTRA_FIELDS;
|
||||||
|
|
||||||
typedef struct _OLD_CERT_REVOCATION_STATUS {
|
typedef struct _OLD_CERT_REVOCATION_STATUS {
|
||||||
DWORD cbSize;
|
DWORD cbSize;
|
||||||
DWORD dwIndex;
|
DWORD dwIndex;
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
DWORD dwReason;
|
DWORD dwReason;
|
||||||
} OLD_CERT_REVOCATION_STATUS, *POLD_CERT_REVOCATION_STATUS;
|
} OLD_CERT_REVOCATION_STATUS;
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* CertDllVerifyRevocation (CRYPTNET.@)
|
* CertDllVerifyRevocation (CRYPTNET.@)
|
||||||
|
|
|
@ -67,7 +67,7 @@ reactos/dll/win32/credui # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/crypt32 # Synced to Wine-1.7.17
|
reactos/dll/win32/crypt32 # Synced to Wine-1.7.17
|
||||||
reactos/dll/win32/cryptdlg # Synced to Wine-1.7.1
|
reactos/dll/win32/cryptdlg # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/cryptdll # Synced to Wine-1.7.1
|
reactos/dll/win32/cryptdll # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/cryptnet # Synced to Wine-1.7.1
|
reactos/dll/win32/cryptnet # Synced to Wine-1.7.17
|
||||||
reactos/dll/win32/cryptui # Synced to Wine-1.7.1
|
reactos/dll/win32/cryptui # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/dbghelp # Synced to Wine-1.7.1
|
reactos/dll/win32/dbghelp # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/dciman32 # Synced to Wine-1.7.1
|
reactos/dll/win32/dciman32 # Synced to Wine-1.7.1
|
||||||
|
|
Loading…
Reference in a new issue