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
6db0fc5c
Commit
6db0fc5c
authored
Sep 12, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Use BCrypt algorithm pseudo-handles.
parent
4918be2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
35 deletions
+19
-35
implglue.c
dlls/rsaenh/implglue.c
+19
-35
No files found.
dlls/rsaenh/implglue.c
View file @
6db0fc5c
...
...
@@ -36,48 +36,32 @@ BOOL WINAPI SystemFunction036(PVOID pbBuffer, ULONG dwLen);
BOOL
init_hash_impl
(
ALG_ID
aiAlgid
,
BCRYPT_HASH_HANDLE
*
hash_handle
)
{
BCRYPT_ALG_HANDLE
provider
;
NTSTATUS
status
;
switch
(
aiAlgid
)
switch
(
aiAlgid
)
{
case
CALG_MD2
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_MD2_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_MD4
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_MD4_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_MD5
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_MD5_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_SHA
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_SHA1_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_MD2
:
return
!
BCryptCreateHash
(
BCRYPT_MD2_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
case
CALG_SHA_256
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_SHA256_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_MD4
:
return
!
BCryptCreateHash
(
BCRYPT_MD4_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
case
CALG_SHA_384
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_SHA384_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_MD5
:
return
!
BCryptCreateHash
(
BCRYPT_MD5_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
case
CALG_SHA_512
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_SHA512_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_SHA
:
return
!
BCryptCreateHash
(
BCRYPT_SHA1_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
default:
return
TRUE
;
}
case
CALG_SHA_256
:
return
!
BCryptCreateHash
(
BCRYPT_SHA256_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
if
(
status
)
return
FALSE
;
case
CALG_SHA_384
:
return
!
BCryptCreateHash
(
BCRYPT_SHA384_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
status
=
BCryptCreateHash
(
provider
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
BCryptCloseAlgorithmProvider
(
provider
,
0
);
return
!
status
;
case
CALG_SHA_512
:
return
!
BCryptCreateHash
(
BCRYPT_SHA512_ALG_HANDLE
,
hash_handle
,
NULL
,
0
,
NULL
,
0
,
0
);
default:
return
TRUE
;
}
}
BOOL
update_hash_impl
(
BCRYPT_HASH_HANDLE
hash_handle
,
const
BYTE
*
pbData
,
DWORD
dwDataLen
)
...
...
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