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
7c7702f9
Commit
7c7702f9
authored
Mar 05, 2024
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kerberos: Allocate memory for the output token if requested.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
2c8d4f5a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
krb5_ap.c
dlls/kerberos/krb5_ap.c
+27
-3
No files found.
dlls/kerberos/krb5_ap.c
View file @
7c7702f9
...
...
@@ -477,7 +477,7 @@ static NTSTATUS NTAPI kerberos_SpInitLsaModeContext( LSA_SEC_HANDLE credential,
{
static
const
ULONG
supported
=
ISC_REQ_CONFIDENTIALITY
|
ISC_REQ_INTEGRITY
|
ISC_REQ_SEQUENCE_DETECT
|
ISC_REQ_REPLAY_DETECT
|
ISC_REQ_MUTUAL_AUTH
|
ISC_REQ_USE_DCE_STYLE
|
ISC_REQ_IDENTIFY
|
ISC_REQ_CONNECTION
|
ISC_REQ_DELEGATE
;
ISC_REQ_IDENTIFY
|
ISC_REQ_CONNECTION
|
ISC_REQ_DELEGATE
|
ISC_REQ_ALLOCATE_MEMORY
;
char
*
target
=
NULL
;
NTSTATUS
status
;
ULONG
exptime
;
...
...
@@ -512,19 +512,43 @@ static NTSTATUS NTAPI kerberos_SpInitLsaModeContext( LSA_SEC_HANDLE credential,
params
.
input_token_length
=
input
->
pBuffers
[
idx
].
cbBuffer
;
}
if
((
idx
=
get_buffer_index
(
output
,
SECBUFFER_TOKEN
))
==
-
1
)
return
SEC_E_INVALID_TOKEN
;
if
((
idx
=
get_buffer_index
(
output
,
SECBUFFER_TOKEN
))
==
-
1
)
{
free
(
target
);
return
SEC_E_INVALID_TOKEN
;
}
if
(
context_req
&
ISC_REQ_ALLOCATE_MEMORY
)
{
output
->
pBuffers
[
idx
].
pvBuffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
KERBEROS_MAX_BUF
);
if
(
!
output
->
pBuffers
[
idx
].
pvBuffer
)
{
free
(
target
);
return
STATUS_NO_MEMORY
;
}
output
->
pBuffers
[
idx
].
cbBuffer
=
KERBEROS_MAX_BUF
;
}
params
.
output_token
=
output
->
pBuffers
[
idx
].
pvBuffer
;
params
.
output_token_length
=
&
output
->
pBuffers
[
idx
].
cbBuffer
;
status
=
KRB5_CALL
(
initialize_context
,
&
params
);
if
(
status
==
SEC_E_OK
||
status
==
SEC_I_CONTINUE_NEEDED
)
{
*
new_context
=
create_context_handle
(
context_handle
,
new_context_handle
);
if
(
!
status
)
if
(
context_attr
&&
(
context_req
&
ISC_REQ_ALLOCATE_MEMORY
))
*
context_attr
|=
ISC_RET_ALLOCATED_MEMORY
;
if
(
status
==
SEC_E_OK
)
{
*
mapped_context
=
TRUE
;
expiry_to_timestamp
(
exptime
,
expiry
);
}
}
else
{
if
(
context_req
&
ISC_REQ_ALLOCATE_MEMORY
)
RtlFreeHeap
(
GetProcessHeap
(),
0
,
output
->
pBuffers
[
idx
].
pvBuffer
);
}
}
/* FIXME: initialize context_data */
free
(
target
);
return
status
;
...
...
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