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
ba1631ad
Commit
ba1631ad
authored
Sep 12, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Use BCrypt algorithm pseudo-handles.
parent
c7e0f923
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
19 deletions
+4
-19
assembly.c
dlls/fusion/assembly.c
+4
-19
No files found.
dlls/fusion/assembly.c
View file @
ba1631ad
...
...
@@ -809,10 +809,8 @@ HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
ULONG
i
,
size
;
LONG
offset
;
BYTE
hashdata
[
20
],
*
pubkey
,
*
ptr
;
BCRYPT_ALG_HANDLE
alg
;
BYTE
tokbytes
[
BYTES_PER_TOKEN
];
HRESULT
hr
=
E_FAIL
;
LPWSTR
tok
;
WCHAR
*
tok
;
DWORD
idx
;
*
token
=
NULL
;
...
...
@@ -833,33 +831,20 @@ HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
pubkey
=
assembly_get_blob
(
assembly
,
idx
,
&
size
);
if
(
BCrypt
OpenAlgorithmProvider
(
&
alg
,
BCRYPT_SHA1_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
)
!=
STATUS_SUCCESS
)
if
(
BCrypt
Hash
(
BCRYPT_SHA1_ALG_HANDLE
,
NULL
,
0
,
pubkey
,
size
,
hashdata
,
sizeof
(
hashdata
)
)
!=
STATUS_SUCCESS
)
return
E_FAIL
;
if
(
BCryptHash
(
alg
,
NULL
,
0
,
pubkey
,
size
,
hashdata
,
sizeof
(
hashdata
))
!=
STATUS_SUCCESS
)
{
hr
=
E_FAIL
;
goto
done
;
}
size
=
sizeof
(
hashdata
);
for
(
i
=
size
-
1
;
i
>=
size
-
8
;
i
--
)
tokbytes
[
size
-
i
-
1
]
=
hashdata
[
i
];
if
(
!
(
tok
=
malloc
((
TOKEN_LENGTH
+
1
)
*
sizeof
(
WCHAR
))))
{
hr
=
E_OUTOFMEMORY
;
goto
done
;
}
return
E_OUTOFMEMORY
;
token_to_str
(
tokbytes
,
tok
);
*
token
=
tok
;
hr
=
S_OK
;
done:
BCryptCloseAlgorithmProvider
(
alg
,
0
);
return
hr
;
return
S_OK
;
}
HRESULT
assembly_get_runtime_version
(
ASSEMBLY
*
assembly
,
LPSTR
*
version
)
...
...
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