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
085ed64d
Commit
085ed64d
authored
Jan 06, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Implement BCryptFinishHash.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1e08b39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
bcrypt.spec
dlls/bcrypt/bcrypt.spec
+1
-1
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+45
-0
No files found.
dlls/bcrypt/bcrypt.spec
View file @
085ed64d
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
@ stub BCryptEnumRegisteredProviders
@ stub BCryptEnumRegisteredProviders
@ stub BCryptExportKey
@ stub BCryptExportKey
@ stub BCryptFinalizeKeyPair
@ stub BCryptFinalizeKeyPair
@ st
ub BCryptFinishHash
@ st
dcall BCryptFinishHash(ptr ptr long long)
@ stub BCryptFreeBuffer
@ stub BCryptFreeBuffer
@ stdcall BCryptGenRandom(ptr ptr long long)
@ stdcall BCryptGenRandom(ptr ptr long long)
@ stub BCryptGenerateKeyPair
@ stub BCryptGenerateKeyPair
...
...
dlls/bcrypt/bcrypt_main.c
View file @
085ed64d
...
@@ -228,6 +228,33 @@ static void hash_update( struct hash *hash, UCHAR *input, ULONG size )
...
@@ -228,6 +228,33 @@ static void hash_update( struct hash *hash, UCHAR *input, ULONG size )
break
;
break
;
}
}
}
}
static
NTSTATUS
hash_finish
(
struct
hash
*
hash
,
UCHAR
*
output
,
ULONG
size
)
{
switch
(
hash
->
alg_id
)
{
case
ALG_ID_SHA1
:
CC_SHA1_Final
(
output
,
&
hash
->
u
.
sha1_ctx
);
break
;
case
ALG_ID_SHA256
:
CC_SHA256_Final
(
output
,
&
hash
->
u
.
sha256_ctx
);
break
;
case
ALG_ID_SHA384
:
CC_SHA384_Final
(
output
,
&
hash
->
u
.
sha512_ctx
);
break
;
case
ALG_ID_SHA512
:
CC_SHA512_Final
(
output
,
&
hash
->
u
.
sha512_ctx
);
break
;
default:
ERR
(
"unhandled id %u
\n
"
,
hash
->
alg_id
);
break
;
}
return
STATUS_SUCCESS
;
}
#else
#else
struct
hash
struct
hash
{
{
...
@@ -245,6 +272,12 @@ static void hash_update( struct hash *hash, UCHAR *input, ULONG size )
...
@@ -245,6 +272,12 @@ static void hash_update( struct hash *hash, UCHAR *input, ULONG size )
{
{
ERR
(
"support for hashes not available at build time
\n
"
);
ERR
(
"support for hashes not available at build time
\n
"
);
}
}
static
NTSTATUS
hash_finish
(
struct
hash
*
hash
,
UCHAR
*
output
,
ULONG
size
)
{
ERR
(
"support for hashes not available at build time
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
}
#endif
#endif
#define OBJECT_LENGTH_SHA1 278
#define OBJECT_LENGTH_SHA1 278
...
@@ -454,3 +487,15 @@ NTSTATUS WINAPI BCryptHashData( BCRYPT_HASH_HANDLE handle, UCHAR *input, ULONG s
...
@@ -454,3 +487,15 @@ NTSTATUS WINAPI BCryptHashData( BCRYPT_HASH_HANDLE handle, UCHAR *input, ULONG s
hash_update
(
hash
,
input
,
size
);
hash_update
(
hash
,
input
,
size
);
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
NTSTATUS
WINAPI
BCryptFinishHash
(
BCRYPT_HASH_HANDLE
handle
,
UCHAR
*
output
,
ULONG
size
,
ULONG
flags
)
{
struct
hash
*
hash
=
handle
;
TRACE
(
"%p, %p, %u, %08x
\n
"
,
handle
,
output
,
size
,
flags
);
if
(
!
hash
||
hash
->
hdr
.
magic
!=
MAGIC_HASH
)
return
STATUS_INVALID_HANDLE
;
if
(
!
output
)
return
STATUS_INVALID_PARAMETER
;
return
hash_finish
(
hash
,
output
,
size
);
}
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