[CRYPT32]

* Sync with Wine 1.7.27.
CORE-8540

svn path=/trunk/; revision=64329
This commit is contained in:
Amine Khaldi 2014-09-27 10:36:45 +00:00
parent a61ee962b0
commit a563531830
6 changed files with 18 additions and 5 deletions

View file

@ -1874,6 +1874,12 @@ PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE hCertStore,
CertFreeCertificateContext(ret);
ret = NULL;
}
if (CRYPT_IsCertificateSelfSigned(pSubjectContext))
{
CertFreeCertificateContext(ret);
ret = NULL;
SetLastError(CRYPT_E_SELF_SIGNED);
}
}
TRACE("returning %p\n", ret);
return ret;

View file

@ -258,7 +258,7 @@ typedef struct _CertificateChain
LONG ref;
} CertificateChain;
static BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert)
BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert)
{
PCERT_EXTENSION ext;
DWORD size;

View file

@ -366,6 +366,7 @@ WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv,
WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv,
DWORD dwFlags, const void *pvPara) DECLSPEC_HIDDEN;
WINECRYPT_CERTSTORE *CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags) DECLSPEC_HIDDEN;
BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) DECLSPEC_HIDDEN;
/* Allocates and initializes a certificate chain engine, but without creating
* the root store. Instead, it uses root, and assumes the caller has done any

View file

@ -198,7 +198,7 @@ BOOL WINAPI CryptSIPAddProvider(SIP_ADD_NEWPROVIDER *psNewProv)
TRACE("%p\n", psNewProv);
if (!psNewProv ||
psNewProv->cbStruct != sizeof(SIP_ADD_NEWPROVIDER) ||
psNewProv->cbStruct < FIELD_OFFSET(SIP_ADD_NEWPROVIDER, pwszGetCapFuncName) ||
!psNewProv->pwszGetFuncName ||
!psNewProv->pwszPutFuncName ||
!psNewProv->pwszCreateFuncName ||

View file

@ -831,13 +831,14 @@ static BOOL CRYPT_GetNextKeyW(LPCWSTR str, struct X500TokenW *token,
/* Assumes separators are characters in the 0-255 range */
static BOOL CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
struct X500TokenW *token, LPCWSTR *ppszError)
WCHAR *separator_used, struct X500TokenW *token, LPCWSTR *ppszError)
{
BOOL ret = TRUE;
TRACE("(%s, %s, %p, %p)\n", debugstr_w(str), debugstr_w(separators), token,
ppszError);
*separator_used = 0;
while (*str && isspaceW(*str))
str++;
if (*str)
@ -877,6 +878,7 @@ static BOOL CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
while (*str && (*str >= 0xff || !map[*str]))
str++;
token->end = str;
if (map[*str]) *separator_used = *str;
}
}
else
@ -1068,6 +1070,7 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
static const WCHAR allSepsWithoutPlus[] = { ',',';','\r','\n',0 };
static const WCHAR allSeps[] = { '+',',',';','\r','\n',0 };
LPCWSTR sep;
WCHAR sep_used;
str++;
if (dwStrType & CERT_NAME_STR_COMMA_FLAG)
@ -1080,11 +1083,14 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
sep = allSepsWithoutPlus;
else
sep = allSeps;
ret = CRYPT_GetNextValueW(str, dwStrType, sep, &token,
ret = CRYPT_GetNextValueW(str, dwStrType, sep, &sep_used, &token,
ppszError);
if (ret)
{
str = token.end;
/* if token.end points to the separator, skip it */
if (str && sep_used && *str == sep_used) str++;
ret = CRYPT_ValueToRDN(dwCertEncodingType, &info,
keyOID, &token, dwStrType, ppszError);
}

View file

@ -64,7 +64,7 @@ reactos/dll/win32/comctl32 # Synced to Wine-1.7.27
reactos/dll/win32/comdlg32 # Synced to Wine-1.7.27
reactos/dll/win32/compstui # Synced to Wine-1.7.17
reactos/dll/win32/credui # Synced to Wine-1.7.17
reactos/dll/win32/crypt32 # Synced to Wine-1.7.17
reactos/dll/win32/crypt32 # Synced to Wine-1.7.27
reactos/dll/win32/cryptdlg # Synced to Wine-1.7.17
reactos/dll/win32/cryptdll # Synced to Wine-1.7.17
reactos/dll/win32/cryptnet # Synced to Wine-1.7.17