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
b5e931d8
Commit
b5e931d8
authored
Oct 12, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dssenh: Don't store the algorithm handle for hashes.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43dddbae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
main.c
dlls/dssenh/main.c
+19
-13
No files found.
dlls/dssenh/main.c
View file @
b5e931d8
...
...
@@ -59,7 +59,6 @@ struct container
struct
hash
{
DWORD
magic
;
BCRYPT_ALG_HANDLE
alg_handle
;
BCRYPT_HASH_HANDLE
handle
;
DWORD
len
;
UCHAR
value
[
64
];
...
...
@@ -475,6 +474,7 @@ BOOL WINAPI CPExportKey( HCRYPTPROV hprov, HCRYPTKEY hkey, HCRYPTKEY hexpkey, DW
static
struct
hash
*
create_hash
(
ALG_ID
algid
)
{
struct
hash
*
ret
;
BCRYPT_ALG_HANDLE
alg_handle
;
const
WCHAR
*
alg
;
DWORD
len
;
...
...
@@ -492,24 +492,26 @@ static struct hash *create_hash( ALG_ID algid )
default:
FIXME
(
"unhandled algorithm %u
\n
"
,
algid
);
return
0
;
return
NULL
;
}
if
(
!
(
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
)
)))
return
0
;
if
(
!
(
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
)
)))
return
NULL
;
ret
->
magic
=
MAGIC_HASH
;
ret
->
len
=
len
;
if
(
BCryptOpenAlgorithmProvider
(
&
ret
->
alg_handle
,
alg
,
MS_PRIMITIVE_PROVIDER
,
0
))
if
(
BCryptOpenAlgorithmProvider
(
&
alg_handle
,
alg
,
MS_PRIMITIVE_PROVIDER
,
0
))
{
heap_free
(
ret
);
return
0
;
return
NULL
;
}
if
(
BCryptCreateHash
(
ret
->
alg_handle
,
&
ret
->
handle
,
NULL
,
0
,
NULL
,
0
,
0
))
if
(
BCryptCreateHash
(
alg_handle
,
&
ret
->
handle
,
NULL
,
0
,
NULL
,
0
,
0
))
{
BCryptCloseAlgorithmProvider
(
ret
->
alg_handle
,
0
);
BCryptCloseAlgorithmProvider
(
alg_handle
,
0
);
heap_free
(
ret
);
return
0
;
return
NULL
;
}
BCryptCloseAlgorithmProvider
(
alg_handle
,
0
);
return
ret
;
}
...
...
@@ -537,6 +539,14 @@ BOOL WINAPI CPCreateHash( HCRYPTPROV hprov, ALG_ID algid, HCRYPTKEY hkey, DWORD
return
TRUE
;
}
static
void
destroy_hash
(
struct
hash
*
hash
)
{
if
(
!
hash
)
return
;
BCryptDestroyHash
(
hash
->
handle
);
hash
->
magic
=
0
;
heap_free
(
hash
);
}
BOOL
WINAPI
CPDestroyHash
(
HCRYPTPROV
hprov
,
HCRYPTHASH
hhash
)
{
struct
hash
*
hash
=
(
struct
hash
*
)
hhash
;
...
...
@@ -549,11 +559,7 @@ BOOL WINAPI CPDestroyHash( HCRYPTPROV hprov, HCRYPTHASH hhash )
return
FALSE
;
}
BCryptDestroyHash
(
hash
->
handle
);
BCryptCloseAlgorithmProvider
(
hash
->
alg_handle
,
0
);
hash
->
magic
=
0
;
heap_free
(
hash
);
destroy_hash
(
hash
);
return
TRUE
;
}
...
...
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