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
4d97b323
Commit
4d97b323
authored
Oct 21, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Cache certificate context instead of store in schannel handle.
parent
afec0b00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
schannel.c
dlls/secur32/schannel.c
+17
-8
No files found.
dlls/secur32/schannel.c
View file @
4d97b323
...
...
@@ -57,7 +57,7 @@ struct schan_context
{
schan_imp_session
session
;
ULONG
req_ctx_attr
;
HCERTSTORE
cert_store
;
const
CERT_CONTEXT
*
cert
;
};
static
struct
schan_handle
*
schan_handle_table
;
...
...
@@ -810,7 +810,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
ctx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ctx
));
if
(
!
ctx
)
return
SEC_E_INSUFFICIENT_MEMORY
;
ctx
->
cert
_store
=
NULL
;
ctx
->
cert
=
NULL
;
handle
=
schan_alloc_handle
(
ctx
,
SCHAN_HANDLE_CTX
);
if
(
handle
==
SCHAN_INVALID_HANDLE
)
{
...
...
@@ -987,13 +987,22 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesW(
{
PCCERT_CONTEXT
*
cert
=
buffer
;
if
(
!
ctx
->
cert_store
)
{
ctx
->
cert_store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
if
(
!
ctx
->
cert_store
)
if
(
!
ctx
->
cert
)
{
HCERTSTORE
cert_store
;
SECURITY_STATUS
status
;
cert_store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
if
(
!
cert_store
)
return
GetLastError
();
status
=
schan_imp_get_session_peer_certificate
(
ctx
->
session
,
cert_store
,
&
ctx
->
cert
);
CertCloseStore
(
cert_store
,
0
);
if
(
status
!=
SEC_E_OK
)
return
status
;
}
return
schan_imp_get_session_peer_certificate
(
ctx
->
session
,
ctx
->
cert_store
,
cert
);
*
cert
=
CertDuplicateCertificateContext
(
ctx
->
cert
);
return
SEC_E_OK
;
}
case
SECPKG_ATTR_CONNECTION_INFO
:
{
...
...
@@ -1301,8 +1310,8 @@ static SECURITY_STATUS SEC_ENTRY schan_DeleteSecurityContext(PCtxtHandle context
ctx
=
schan_free_handle
(
context_handle
->
dwLower
,
SCHAN_HANDLE_CTX
);
if
(
!
ctx
)
return
SEC_E_INVALID_HANDLE
;
if
(
ctx
->
cert
_store
)
Cert
CloseStore
(
ctx
->
cert_store
,
0
);
if
(
ctx
->
cert
)
Cert
FreeCertificateContext
(
ctx
->
cert
);
schan_imp_dispose_session
(
ctx
->
session
);
HeapFree
(
GetProcessHeap
(),
0
,
ctx
);
...
...
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