Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
63c7f8d8
Commit
63c7f8d8
authored
Jan 21, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Added SECPKG_ATTR_REMOTE_CERT_CONTEXT tests.
parent
303ec3ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
schannel.c
dlls/secur32/tests/schannel.c
+28
-0
No files found.
dlls/secur32/tests/schannel.c
View file @
63c7f8d8
...
...
@@ -45,6 +45,7 @@ static ENCRYPT_MESSAGE_FN pEncryptMessage;
static
PCCERT_CONTEXT
(
WINAPI
*
pCertCreateCertificateContext
)(
DWORD
,
const
BYTE
*
,
DWORD
);
static
BOOL
(
WINAPI
*
pCertFreeCertificateContext
)(
PCCERT_CONTEXT
);
static
BOOL
(
WINAPI
*
pCertSetCertificateContextProperty
)(
PCCERT_CONTEXT
,
DWORD
,
DWORD
,
const
void
*
);
static
PCCERT_CONTEXT
(
WINAPI
*
pCertEnumCertificatesInStore
)(
HCERTSTORE
,
PCCERT_CONTEXT
);
static
BOOL
(
WINAPI
*
pCryptAcquireContextW
)(
HCRYPTPROV
*
,
LPCWSTR
,
LPCWSTR
,
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pCryptDestroyKey
)(
HCRYPTKEY
);
...
...
@@ -148,6 +149,7 @@ static void InitFunctionPtrs(void)
GET_PROC
(
crypt32dll
,
CertFreeCertificateContext
);
GET_PROC
(
crypt32dll
,
CertSetCertificateContextProperty
);
GET_PROC
(
crypt32dll
,
CertCreateCertificateContext
);
GET_PROC
(
crypt32dll
,
CertEnumCertificatesInStore
);
#undef GET_PROC
}
...
...
@@ -467,6 +469,24 @@ static void testAcquireSecurityContext(void)
}
}
static
void
test_remote_cert
(
PCCERT_CONTEXT
remote_cert
)
{
PCCERT_CONTEXT
iter
=
NULL
;
BOOL
incl_remote
=
FALSE
;
unsigned
cert_cnt
=
0
;
ok
(
remote_cert
->
hCertStore
!=
NULL
,
"hCertStore == NULL
\n
"
);
while
((
iter
=
pCertEnumCertificatesInStore
(
remote_cert
->
hCertStore
,
iter
)))
{
if
(
iter
==
remote_cert
)
incl_remote
=
TRUE
;
cert_cnt
++
;
}
ok
(
cert_cnt
==
2
,
"cert_cnt = %u
\n
"
,
cert_cnt
);
ok
(
incl_remote
,
"context does not contain cert itself
\n
"
);
}
static
const
char
http_request
[]
=
"HEAD /test.html HTTP/1.1
\r\n
Host: www.codeweavers.com
\r\n
Connection: close
\r\n\r\n
"
;
static
void
init_cred
(
SCHANNEL_CRED
*
cred
)
...
...
@@ -572,6 +592,7 @@ static void test_communication(void)
CredHandle
cred_handle
;
CtxtHandle
context
;
SecPkgContext_StreamSizes
sizes
;
CERT_CONTEXT
*
cert
;
SecBufferDesc
buffers
[
2
];
SecBuffer
*
buf
;
...
...
@@ -726,6 +747,13 @@ static void test_communication(void)
return
;
}
status
=
pQueryContextAttributesA
(
&
context
,
SECPKG_ATTR_REMOTE_CERT_CONTEXT
,
(
void
*
)
&
cert
);
ok
(
status
==
SEC_E_OK
,
"QueryContextAttributesW(SECPKG_ATTR_REMOTE_CERT_CONTEXT) failed: %08x
\n
"
,
status
);
if
(
status
==
SEC_E_OK
)
{
test_remote_cert
(
cert
);
pCertFreeCertificateContext
(
cert
);
}
pQueryContextAttributesA
(
&
context
,
SECPKG_ATTR_STREAM_SIZES
,
&
sizes
);
reset_buffers
(
&
buffers
[
0
]);
...
...
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