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
aeefb818
Commit
aeefb818
authored
Mar 13, 2011
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Extract schan_imp_create/dispose_session functions.
parent
d7fe60c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
17 deletions
+31
-17
schannel.c
dlls/secur32/schannel.c
+31
-17
No files found.
dlls/secur32/schannel.c
View file @
aeefb818
...
...
@@ -75,6 +75,33 @@ MAKE_FUNCPTR(gnutls_transport_set_push_function);
struct
schan_transport
;
static
BOOL
schan_imp_create_session
(
gnutls_session_t
*
s
,
BOOL
is_server
)
{
int
err
=
pgnutls_init
(
s
,
is_server
?
GNUTLS_SERVER
:
GNUTLS_CLIENT
);
if
(
err
!=
GNUTLS_E_SUCCESS
)
{
pgnutls_perror
(
err
);
return
FALSE
;
}
/* FIXME: We should be using the information from the credentials here. */
FIXME
(
"Using hardcoded
\"
NORMAL
\"
priority
\n
"
);
err
=
pgnutls_set_default_priority
(
*
s
);
if
(
err
!=
GNUTLS_E_SUCCESS
)
{
pgnutls_perror
(
err
);
pgnutls_deinit
(
*
s
);
return
FALSE
;
}
return
TRUE
;
}
static
void
schan_imp_dispose_session
(
gnutls_session_t
s
)
{
pgnutls_deinit
(
s
);
}
static
void
schan_imp_set_session_transport
(
gnutls_session_t
s
,
struct
schan_transport
*
t
)
{
...
...
@@ -939,31 +966,18 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
return
SEC_E_INTERNAL_ERROR
;
}
err
=
pgnutls_init
(
&
ctx
->
session
,
GNUTLS_CLIENT
);
if
(
err
!=
GNUTLS_E_SUCCESS
)
if
(
!
schan_imp_create_session
(
&
ctx
->
session
,
FALSE
))
{
pgnutls_perror
(
err
);
schan_free_handle
(
handle
,
SCHAN_HANDLE_CTX
);
HeapFree
(
GetProcessHeap
(),
0
,
ctx
);
return
SEC_E_INTERNAL_ERROR
;
}
/* FIXME: We should be using the information from the credentials here. */
FIXME
(
"Using hardcoded
\"
NORMAL
\"
priority
\n
"
);
err
=
pgnutls_set_default_priority
(
ctx
->
session
);
if
(
err
!=
GNUTLS_E_SUCCESS
)
{
pgnutls_perror
(
err
);
pgnutls_deinit
(
ctx
->
session
);
schan_free_handle
(
handle
,
SCHAN_HANDLE_CTX
);
HeapFree
(
GetProcessHeap
(),
0
,
ctx
);
}
err
=
pgnutls_credentials_set
(
ctx
->
session
,
GNUTLS_CRD_CERTIFICATE
,
cred
->
credentials
);
if
(
err
!=
GNUTLS_E_SUCCESS
)
{
pgnutls_perror
(
err
);
pgnutls_deinit
(
ctx
->
session
);
schan_imp_dispose_session
(
ctx
->
session
);
schan_free_handle
(
handle
,
SCHAN_HANDLE_CTX
);
HeapFree
(
GetProcessHeap
(),
0
,
ctx
);
}
...
...
@@ -1401,7 +1415,7 @@ 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
;
pgnutls_deinit
(
ctx
->
session
);
schan_imp_dispose_session
(
ctx
->
session
);
HeapFree
(
GetProcessHeap
(),
0
,
ctx
);
return
SEC_E_OK
;
...
...
@@ -1601,7 +1615,7 @@ void SECUR32_deinitSchannelSP(void)
if
(
schan_handle_table
[
i
].
type
==
SCHAN_HANDLE_CTX
)
{
struct
schan_context
*
ctx
=
schan_free_handle
(
i
,
SCHAN_HANDLE_CTX
);
pgnutls_deinit
(
ctx
->
session
);
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