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
9124cdc2
Commit
9124cdc2
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_allocate/free_certificate_credentials functions.
parent
e02ac5f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
schannel.c
dlls/secur32/schannel.c
+21
-9
No files found.
dlls/secur32/schannel.c
View file @
9124cdc2
...
@@ -73,6 +73,7 @@ MAKE_FUNCPTR(gnutls_transport_set_push_function);
...
@@ -73,6 +73,7 @@ MAKE_FUNCPTR(gnutls_transport_set_push_function);
typedef
struct
schan_imp_session_opaque
*
schan_imp_session
;
typedef
struct
schan_imp_session_opaque
*
schan_imp_session
;
typedef
struct
schan_imp_certificate_credentials_opaque
*
schan_imp_certificate_credentials
;
struct
schan_transport
;
struct
schan_transport
;
...
@@ -116,7 +117,7 @@ static ssize_t schan_push_adapter(gnutls_transport_ptr_t transport,
...
@@ -116,7 +117,7 @@ static ssize_t schan_push_adapter(gnutls_transport_ptr_t transport,
}
}
static
BOOL
schan_imp_create_session
(
schan_imp_session
*
session
,
BOOL
is_server
,
static
BOOL
schan_imp_create_session
(
schan_imp_session
*
session
,
BOOL
is_server
,
gnutls
_certificate_credentials
cred
)
schan_imp
_certificate_credentials
cred
)
{
{
gnutls_session_t
*
s
=
(
gnutls_session_t
*
)
session
;
gnutls_session_t
*
s
=
(
gnutls_session_t
*
)
session
;
...
@@ -137,7 +138,8 @@ static BOOL schan_imp_create_session(schan_imp_session *session, BOOL is_server,
...
@@ -137,7 +138,8 @@ static BOOL schan_imp_create_session(schan_imp_session *session, BOOL is_server,
return
FALSE
;
return
FALSE
;
}
}
err
=
pgnutls_credentials_set
(
*
s
,
GNUTLS_CRD_CERTIFICATE
,
cred
);
err
=
pgnutls_credentials_set
(
*
s
,
GNUTLS_CRD_CERTIFICATE
,
(
gnutls_certificate_credentials
)
cred
);
if
(
err
!=
GNUTLS_E_SUCCESS
)
if
(
err
!=
GNUTLS_E_SUCCESS
)
{
{
pgnutls_perror
(
err
);
pgnutls_perror
(
err
);
...
@@ -376,6 +378,19 @@ static SECURITY_STATUS schan_imp_recv(schan_imp_session session, void *buffer,
...
@@ -376,6 +378,19 @@ static SECURITY_STATUS schan_imp_recv(schan_imp_session session, void *buffer,
return
SEC_E_OK
;
return
SEC_E_OK
;
}
}
static
BOOL
schan_imp_allocate_certificate_credentials
(
schan_imp_certificate_credentials
*
c
)
{
int
ret
=
pgnutls_certificate_allocate_credentials
((
gnutls_certificate_credentials
*
)
c
);
if
(
ret
!=
GNUTLS_E_SUCCESS
)
pgnutls_perror
(
ret
);
return
(
ret
==
GNUTLS_E_SUCCESS
);
}
static
void
schan_imp_free_certificate_credentials
(
schan_imp_certificate_credentials
c
)
{
pgnutls_certificate_free_credentials
((
gnutls_certificate_credentials
)
c
);
}
#define SCHAN_INVALID_HANDLE ~0UL
#define SCHAN_INVALID_HANDLE ~0UL
...
@@ -395,7 +410,7 @@ struct schan_handle
...
@@ -395,7 +410,7 @@ struct schan_handle
struct
schan_credentials
struct
schan_credentials
{
{
ULONG
credential_use
;
ULONG
credential_use
;
gnutls
_certificate_credentials
credentials
;
schan_imp
_certificate_credentials
credentials
;
};
};
struct
schan_context
struct
schan_context
...
@@ -666,7 +681,6 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
...
@@ -666,7 +681,6 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
if
(
st
==
SEC_E_OK
)
if
(
st
==
SEC_E_OK
)
{
{
ULONG_PTR
handle
;
ULONG_PTR
handle
;
int
ret
;
creds
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
creds
));
creds
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
creds
));
if
(
!
creds
)
return
SEC_E_INSUFFICIENT_MEMORY
;
if
(
!
creds
)
return
SEC_E_INSUFFICIENT_MEMORY
;
...
@@ -675,10 +689,8 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
...
@@ -675,10 +689,8 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
if
(
handle
==
SCHAN_INVALID_HANDLE
)
goto
fail
;
if
(
handle
==
SCHAN_INVALID_HANDLE
)
goto
fail
;
creds
->
credential_use
=
SECPKG_CRED_OUTBOUND
;
creds
->
credential_use
=
SECPKG_CRED_OUTBOUND
;
ret
=
pgnutls_certificate_allocate_credentials
(
&
creds
->
credentials
);
if
(
!
schan_imp_allocate_certificate_credentials
(
&
creds
->
credentials
))
if
(
ret
!=
GNUTLS_E_SUCCESS
)
{
{
pgnutls_perror
(
ret
);
schan_free_handle
(
handle
,
SCHAN_HANDLE_CRED
);
schan_free_handle
(
handle
,
SCHAN_HANDLE_CRED
);
goto
fail
;
goto
fail
;
}
}
...
@@ -785,7 +797,7 @@ static SECURITY_STATUS SEC_ENTRY schan_FreeCredentialsHandle(
...
@@ -785,7 +797,7 @@ static SECURITY_STATUS SEC_ENTRY schan_FreeCredentialsHandle(
if
(
!
creds
)
return
SEC_E_INVALID_HANDLE
;
if
(
!
creds
)
return
SEC_E_INVALID_HANDLE
;
if
(
creds
->
credential_use
==
SECPKG_CRED_OUTBOUND
)
if
(
creds
->
credential_use
==
SECPKG_CRED_OUTBOUND
)
pgnutls_certificate_fre
e_credentials
(
creds
->
credentials
);
schan_imp_free_certificat
e_credentials
(
creds
->
credentials
);
HeapFree
(
GetProcessHeap
(),
0
,
creds
);
HeapFree
(
GetProcessHeap
(),
0
,
creds
);
return
SEC_E_OK
;
return
SEC_E_OK
;
...
@@ -1713,7 +1725,7 @@ void SECUR32_deinitSchannelSP(void)
...
@@ -1713,7 +1725,7 @@ void SECUR32_deinitSchannelSP(void)
{
{
struct
schan_credentials
*
cred
;
struct
schan_credentials
*
cred
;
cred
=
schan_free_handle
(
i
,
SCHAN_HANDLE_CRED
);
cred
=
schan_free_handle
(
i
,
SCHAN_HANDLE_CRED
);
pgnutls_certificate_fre
e_credentials
(
cred
->
credentials
);
schan_imp_free_certificat
e_credentials
(
cred
->
credentials
);
HeapFree
(
GetProcessHeap
(),
0
,
cred
);
HeapFree
(
GetProcessHeap
(),
0
,
cred
);
}
}
}
}
...
...
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