Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dc6fc6ad
Commit
dc6fc6ad
authored
Jul 30, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Aug 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Use CryptAcquireContextA instead of CryptAcquireContextW.
parent
a7cb4354
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
cert.c
dlls/crypt32/tests/cert.c
+14
-13
No files found.
dlls/crypt32/tests/cert.c
View file @
dc6fc6ad
...
...
@@ -37,8 +37,8 @@ static BOOL (WINAPI *pCryptEncodeObjectEx)(DWORD,LPCSTR,const void*,DWORD,PCRYPT
static
BOOL
(
WINAPI
*
pCryptVerifyCertificateSignatureEx
)
(
HCRYPTPROV
,
DWORD
,
DWORD
,
void
*
,
DWORD
,
void
*
,
DWORD
,
void
*
);
static
BOOL
(
WINAPI
*
pCryptAcquireContext
W
)
(
HCRYPTPROV
*
,
LPC
WSTR
,
LPCW
STR
,
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pCryptAcquireContext
A
)
(
HCRYPTPROV
*
,
LPC
STR
,
LPC
STR
,
DWORD
,
DWORD
);
static
void
init_function_pointers
(
void
)
{
...
...
@@ -57,7 +57,7 @@ static void init_function_pointers(void)
GET_PROC
(
hCrypt32
,
CryptEncodeObjectEx
)
GET_PROC
(
hCrypt32
,
CryptVerifyCertificateSignatureEx
)
GET_PROC
(
hAdvapi32
,
CryptAcquireContext
W
)
GET_PROC
(
hAdvapi32
,
CryptAcquireContext
A
)
#undef GET_PROC
}
...
...
@@ -346,6 +346,7 @@ static void checkHash(const BYTE *data, DWORD dataLen, ALG_ID algID,
dwSizeWithNull
,
size
);
}
static
CHAR
cspNameA
[]
=
"WineCryptTemp"
;
static
WCHAR
cspNameW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'C'
,
'r'
,
'y'
,
'p'
,
't'
,
'T'
,
'e'
,
'm'
,
'p'
,
0
};
static
const
BYTE
v1CertWithPubKey
[]
=
{
0x30
,
0x81
,
0x95
,
0x02
,
0x01
,
0x01
,
0x30
,
0x02
,
0x06
,
0x00
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
...
...
@@ -1693,9 +1694,9 @@ static void testCertSigs(void)
DWORD
sigSize
=
sizeof
(
sig
);
/* Just in case a previous run failed, delete this thing */
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
ret
=
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
ret
=
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
ok
(
ret
,
"CryptAcquireContext failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -1704,7 +1705,7 @@ static void testCertSigs(void)
CryptDestroyKey
(
key
);
CryptReleaseContext
(
csp
,
0
);
ret
=
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
ret
=
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
}
...
...
@@ -1830,9 +1831,9 @@ static void testCreateSelfSignCert(void)
*/
/* Acquire a CSP */
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
ret
=
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
ret
=
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
ok
(
ret
,
"CryptAcquireContext failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -1887,7 +1888,7 @@ static void testCreateSelfSignCert(void)
}
CryptReleaseContext
(
csp
,
0
);
ret
=
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
ret
=
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
/* do the same test with AT_KEYEXCHANGE and key info*/
...
...
@@ -1935,7 +1936,7 @@ static void testCreateSelfSignCert(void)
CertFreeCertificateContext
(
context
);
}
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
}
...
...
@@ -2767,7 +2768,7 @@ static void testAcquireCertPrivateKey(void)
keyProvInfo
.
rgProvParam
=
NULL
;
keyProvInfo
.
dwKeySpec
=
AT_SIGNATURE
;
pCryptAcquireContext
W
(
NULL
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
pCryptAcquireContext
A
(
NULL
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
cert
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
selfSignedCert
,
...
...
@@ -2800,7 +2801,7 @@ static void testAcquireCertPrivateKey(void)
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NO_KEY_PROPERTY
,
"Expected CRYPT_E_NO_KEY_PROPERTY, got %08x
\n
"
,
GetLastError
());
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
ret
=
CryptImportKey
(
csp
,
privKey
,
sizeof
(
privKey
),
0
,
0
,
&
key
);
ok
(
ret
,
"CryptImportKey failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -2922,7 +2923,7 @@ static void testAcquireCertPrivateKey(void)
}
CryptReleaseContext
(
csp
,
0
);
pCryptAcquireContext
W
(
&
csp
,
cspNameW
,
MS_DEF_PROV_W
,
PROV_RSA_FULL
,
pCryptAcquireContext
A
(
&
csp
,
cspNameA
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
CertFreeCertificateContext
(
cert
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment