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
b0329620
Commit
b0329620
authored
Dec 07, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Use bcrypt for SHA1 hashes.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8009091f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
25 deletions
+2
-25
implglue.c
dlls/rsaenh/implglue.c
+2
-15
implglue.h
dlls/rsaenh/implglue.h
+0
-10
No files found.
dlls/rsaenh/implglue.c
View file @
b0329620
...
...
@@ -41,10 +41,6 @@ VOID WINAPI MD4Final( MD4_CTX *ctx );
VOID
WINAPI
MD5Init
(
MD5_CTX
*
ctx
);
VOID
WINAPI
MD5Update
(
MD5_CTX
*
ctx
,
const
unsigned
char
*
buf
,
unsigned
int
len
);
VOID
WINAPI
MD5Final
(
MD5_CTX
*
ctx
);
/* Function prototypes copied from dlls/advapi32/crypt_sha.c */
VOID
WINAPI
A_SHAInit
(
PSHA_CTX
Context
);
VOID
WINAPI
A_SHAUpdate
(
PSHA_CTX
Context
,
const
unsigned
char
*
Buffer
,
UINT
BufferSize
);
VOID
WINAPI
A_SHAFinal
(
PSHA_CTX
Context
,
PULONG
Result
);
/* Function prototype copied from dlls/advapi32/crypt.c */
BOOL
WINAPI
SystemFunction036
(
PVOID
pbBuffer
,
ULONG
dwLen
);
...
...
@@ -68,8 +64,8 @@ BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext)
return
TRUE
;
case
CALG_SHA
:
A_SHAInit
(
&
pHashContext
->
sha
);
return
TRUE
;
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_SHA1_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
break
;
case
CALG_SHA_256
:
status
=
BCryptOpenAlgorithmProvider
(
&
provider
,
BCRYPT_SHA256_ALGORITHM
,
MS_PRIMITIVE_PROVIDER
,
0
);
...
...
@@ -107,10 +103,6 @@ BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, const BYTE *pb
MD5Update
(
&
pHashContext
->
md5
,
pbData
,
dwDataLen
);
break
;
case
CALG_SHA
:
A_SHAUpdate
(
&
pHashContext
->
sha
,
pbData
,
dwDataLen
);
break
;
default:
BCryptHashData
(
pHashContext
->
bcrypt_hash
,
(
UCHAR
*
)
pbData
,
dwDataLen
,
0
);
}
...
...
@@ -132,10 +124,6 @@ BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHash
memcpy
(
pbHashValue
,
pHashContext
->
md5
.
digest
,
16
);
break
;
case
CALG_SHA
:
A_SHAFinal
(
&
pHashContext
->
sha
,
(
PULONG
)
pbHashValue
);
break
;
default:
BCryptFinishHash
(
pHashContext
->
bcrypt_hash
,
pbHashValue
,
RSAENH_MAX_HASH_SIZE
,
0
);
BCryptDestroyHash
(
pHashContext
->
bcrypt_hash
);
...
...
@@ -152,7 +140,6 @@ BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext,
{
case
CALG_MD4
:
case
CALG_MD5
:
case
CALG_SHA
:
*
pDestHashContext
=
*
pSrcHashContext
;
return
TRUE
;
default:
...
...
dlls/rsaenh/implglue.h
View file @
b0329620
...
...
@@ -46,19 +46,9 @@ typedef struct tagMD5_CTX
unsigned
char
digest
[
16
];
}
MD5_CTX
;
/* Next typedef copied form dlls/advapi32/crypt_sha.c */
typedef
struct
tagSHA_CTX
{
ULONG
Unknown
[
6
];
ULONG
State
[
5
];
ULONG
Count
[
2
];
UCHAR
Buffer
[
64
];
}
SHA_CTX
,
*
PSHA_CTX
;
typedef
union
tagHASH_CONTEXT
{
MD4_CTX
md4
;
MD5_CTX
md5
;
SHA_CTX
sha
;
BCRYPT_HASH_HANDLE
bcrypt_hash
;
}
HASH_CONTEXT
;
...
...
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