[CRYPT32] Sync with Wine Staging 1.7.55. CORE-10536

svn path=/trunk/; revision=69929
This commit is contained in:
Amine Khaldi 2015-11-17 21:12:00 +00:00
parent 305438d65e
commit f976f07653
7 changed files with 45 additions and 24 deletions

View file

@ -1,4 +1,7 @@
remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502)
add_definitions(-D_WIN32_WINNT=0x600 -DWINVER=0x600)
add_definitions(
-D__WINESRC__
-D_WINE
@ -42,7 +45,7 @@ add_library(crypt32 SHARED
set_module_type(crypt32 win32dll)
target_link_libraries(crypt32 wine ${PSEH_LIB} oldnames)
add_importlibs(crypt32 user32 advapi32 shlwapi msvcrt kernel32 ntdll)
add_importlibs(crypt32 user32 advapi32 advapi32_vista msvcrt kernel32 ntdll)
add_delay_importlibs(crypt32 cryptnet)
add_pch(crypt32 crypt32_private.h SOURCE)
add_cd_file(TARGET crypt32 DESTINATION reactos/system32 FOR all)

View file

@ -685,6 +685,7 @@ static BOOL CertContext_SetProperty(cert_t *cert, DWORD dwPropId,
case CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID:
case CERT_ENROLLMENT_PROP_ID:
case CERT_CROSS_CERT_DIST_POINTS_PROP_ID:
case CERT_OCSP_RESPONSE_PROP_ID:
case CERT_RENEWAL_PROP_ID:
{
if (pvData)

View file

@ -163,6 +163,7 @@
@ stub CryptMsgVerifyCountersignatureEncoded
@ stdcall CryptMsgVerifyCountersignatureEncodedEx(ptr long ptr long ptr long long ptr long ptr)
@ stdcall CryptProtectData(ptr wstr ptr ptr ptr long ptr)
@ stdcall CryptProtectMemory(ptr long long)
@ stdcall CryptQueryObject(long ptr long long long ptr ptr ptr ptr ptr ptr)
@ stdcall CryptRegisterDefaultOIDFunction(long str long wstr)
@ stdcall CryptRegisterOIDFunction(long str str wstr str)
@ -186,6 +187,7 @@
@ stdcall CryptSignMessage(ptr long long ptr ptr ptr ptr)
@ stub CryptSignMessageWithKey
@ stdcall CryptUnprotectData(ptr ptr ptr ptr ptr long ptr)
@ stdcall CryptUnprotectMemory(ptr long long)
@ stdcall CryptUnregisterDefaultOIDFunction(long str wstr)
@ stdcall CryptUnregisterOIDFunction(long str str)
@ stub CryptUnregisterOIDInfo

View file

@ -3985,18 +3985,19 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPrivKey(DWORD dwCertEncodingType,
&size, NULL, NULL);
if (ret)
{
halflen = decodedKey->modulus.cbData / 2;
if ((decodedKey->modulus.cbData != halflen * 2) ||
(decodedKey->prime1.cbData != halflen) ||
(decodedKey->prime2.cbData != halflen) ||
(decodedKey->exponent1.cbData != halflen) ||
(decodedKey->exponent2.cbData != halflen) ||
(decodedKey->coefficient.cbData != halflen) ||
(decodedKey->privexp.cbData != halflen * 2))
{
ret = FALSE;
SetLastError(CRYPT_E_BAD_ENCODE);
}
halflen = decodedKey->prime1.cbData;
if (halflen < decodedKey->prime2.cbData)
halflen = decodedKey->prime2.cbData;
if (halflen < decodedKey->exponent1.cbData)
halflen = decodedKey->exponent1.cbData;
if (halflen < decodedKey->exponent2.cbData)
halflen = decodedKey->exponent2.cbData;
if (halflen < decodedKey->coefficient.cbData)
halflen = decodedKey->coefficient.cbData;
if (halflen * 2 < decodedKey->modulus.cbData)
halflen = decodedKey->modulus.cbData / 2 + decodedKey->modulus.cbData % 2;
if (halflen * 2 < decodedKey->privexp.cbData)
halflen = decodedKey->privexp.cbData / 2 + decodedKey->privexp.cbData % 2;
if (ret)
{
@ -4031,20 +4032,21 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPrivKey(DWORD dwCertEncodingType,
rsaPubKey->bitlen = halflen * 16;
vardata = (BYTE*)(rsaPubKey + 1);
memset(vardata, 0, halflen * 9);
memcpy(vardata,
decodedKey->modulus.pbData, halflen * 2);
decodedKey->modulus.pbData, decodedKey->modulus.cbData);
memcpy(vardata + halflen * 2,
decodedKey->prime1.pbData, halflen);
decodedKey->prime1.pbData, decodedKey->prime1.cbData);
memcpy(vardata + halflen * 3,
decodedKey->prime2.pbData, halflen);
decodedKey->prime2.pbData, decodedKey->prime2.cbData);
memcpy(vardata + halflen * 4,
decodedKey->exponent1.pbData, halflen);
decodedKey->exponent1.pbData, decodedKey->exponent1.cbData);
memcpy(vardata + halflen * 5,
decodedKey->exponent2.pbData, halflen);
decodedKey->exponent2.pbData, decodedKey->exponent2.cbData);
memcpy(vardata + halflen * 6,
decodedKey->coefficient.pbData, halflen);
decodedKey->coefficient.pbData, decodedKey->coefficient.cbData);
memcpy(vardata + halflen * 7,
decodedKey->privexp.pbData, halflen * 2);
decodedKey->privexp.pbData, decodedKey->privexp.cbData);
}
}

View file

@ -241,3 +241,16 @@ ASN1encoding_t WINAPI I_CryptGetAsn1Encoder(HCRYPTASN1MODULE x)
FIXME("(%08x): stub\n", x);
return NULL;
}
BOOL WINAPI CryptProtectMemory(void *data, DWORD len, DWORD flags)
{
FIXME("(%p %u %08x): stub\n", data, len, flags);
return TRUE;
}
BOOL WINAPI CryptUnprotectMemory(void *data, DWORD len, DWORD flags)
{
static int fixme_once;
if (!fixme_once++) FIXME("(%p %u %08x): stub\n", data, len, flags);
return TRUE;
}

View file

@ -509,12 +509,12 @@ WINECRYPT_CERTSTORE *CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
if (dwFlags & CERT_STORE_DELETE_FLAG)
{
DWORD rc = SHDeleteKeyW((HKEY)pvPara, CertsW);
DWORD rc = RegDeleteTreeW((HKEY)pvPara, CertsW);
if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS)
rc = SHDeleteKeyW((HKEY)pvPara, CRLsW);
rc = RegDeleteTreeW((HKEY)pvPara, CRLsW);
if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS)
rc = SHDeleteKeyW((HKEY)pvPara, CTLsW);
rc = RegDeleteTreeW((HKEY)pvPara, CTLsW);
if (rc == ERROR_NO_MORE_ITEMS)
rc = ERROR_SUCCESS;
SetLastError(rc);

View file

@ -58,7 +58,7 @@ reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.47
reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.47
reactos/dll/win32/compstui # Synced to WineStaging-1.7.47
reactos/dll/win32/credui # Synced to WineStaging-1.7.47
reactos/dll/win32/crypt32 # Synced to WineStaging-1.7.47
reactos/dll/win32/crypt32 # Synced to WineStaging-1.7.55
reactos/dll/win32/cryptdlg # Synced to WineStaging-1.7.47
reactos/dll/win32/cryptdll # Synced to WineStaging-1.7.47
reactos/dll/win32/cryptnet # Synced to WineStaging-1.7.47