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
430b9db0
Commit
430b9db0
authored
Sep 12, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appwiz.cpl: Use BCryptHash().
parent
c7b5778d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
addons.c
dlls/appwiz.cpl/addons.c
+7
-15
No files found.
dlls/appwiz.cpl/addons.c
View file @
430b9db0
...
...
@@ -119,7 +119,6 @@ static BOOL sha_check(const WCHAR *file_name)
const
unsigned
char
*
file_map
;
HANDLE
file
,
map
;
DWORD
size
,
i
;
BCRYPT_HASH_HANDLE
hash
=
NULL
;
UCHAR
sha
[
32
];
char
buf
[
1024
];
BOOL
ret
=
FALSE
;
...
...
@@ -142,23 +141,16 @@ static BOOL sha_check(const WCHAR *file_name)
if
(
!
file_map
)
return
FALSE
;
if
(
BCryptCreateHash
(
BCRYPT_SHA256_ALG_HANDLE
,
&
hash
,
NULL
,
0
,
NULL
,
0
,
0
))
goto
end
;
if
(
BCryptHashData
(
hash
,
(
UCHAR
*
)
file_map
,
size
,
0
))
goto
end
;
if
(
BCryptFinishHash
(
hash
,
sha
,
sizeof
(
sha
),
0
))
goto
end
;
if
(
!
BCryptHash
(
BCRYPT_SHA256_ALG_HANDLE
,
NULL
,
0
,
(
UCHAR
*
)
file_map
,
size
,
sha
,
sizeof
(
sha
)))
{
for
(
i
=
0
;
i
<
sizeof
(
sha
);
i
++
)
sprintf
(
buf
+
i
*
2
,
"%02x"
,
sha
[
i
]);
for
(
i
=
0
;
i
<
sizeof
(
sha
);
i
++
)
sprintf
(
buf
+
i
*
2
,
"%02x"
,
sha
[
i
]);
ret
=
!
strcmp
(
buf
,
addon
->
sha
);
if
(
!
ret
)
WARN
(
"Got %s, expected %s
\n
"
,
buf
,
addon
->
sha
);
ret
=
!
strcmp
(
buf
,
addon
->
sha
);
if
(
!
ret
)
WARN
(
"Got %s, expected %s
\n
"
,
buf
,
addon
->
sha
);
}
end:
UnmapViewOfFile
(
file_map
);
if
(
hash
)
BCryptDestroyHash
(
hash
);
return
ret
;
}
...
...
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