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
554e315b
Commit
554e315b
authored
Oct 19, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dssenh: Access the hash value directly in CPSignHash and CPVerifySignature.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
248d27ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
main.c
dlls/dssenh/main.c
+3
-9
No files found.
dlls/dssenh/main.c
View file @
554e315b
...
@@ -860,8 +860,7 @@ BOOL WINAPI CPSignHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD keyspec, const
...
@@ -860,8 +860,7 @@ BOOL WINAPI CPSignHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD keyspec, const
{
{
struct
container
*
container
=
(
struct
container
*
)
hprov
;
struct
container
*
container
=
(
struct
container
*
)
hprov
;
struct
hash
*
hash
=
(
struct
hash
*
)
hhash
;
struct
hash
*
hash
=
(
struct
hash
*
)
hhash
;
UCHAR
hashval
[
MAX_HASH_LEN
];
ULONG
len
;
ULONG
len
,
hashlen
=
sizeof
(
hashval
);
TRACE
(
"%p, %p, %u, %s, %08x, %p, %p
\n
"
,
(
void
*
)
hprov
,
(
void
*
)
hhash
,
keyspec
,
debugstr_w
(
desc
),
flags
,
sig
,
TRACE
(
"%p, %p, %u, %s, %08x, %p, %p
\n
"
,
(
void
*
)
hprov
,
(
void
*
)
hhash
,
keyspec
,
debugstr_w
(
desc
),
flags
,
sig
,
siglen
);
siglen
);
...
@@ -870,14 +869,13 @@ BOOL WINAPI CPSignHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD keyspec, const
...
@@ -870,14 +869,13 @@ BOOL WINAPI CPSignHash( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD keyspec, const
if
(
hash
->
magic
!=
MAGIC_HASH
)
return
FALSE
;
if
(
hash
->
magic
!=
MAGIC_HASH
)
return
FALSE
;
if
(
!
(
len
=
get_signature_length
(
container
->
sign_key
->
algid
)))
return
FALSE
;
if
(
!
(
len
=
get_signature_length
(
container
->
sign_key
->
algid
)))
return
FALSE
;
if
(
!
CPGetHashParam
(
hprov
,
hhash
,
HP_HASHVAL
,
hashval
,
&
hashlen
,
0
))
return
FALSE
;
if
(
*
siglen
<
len
)
if
(
*
siglen
<
len
)
{
{
*
siglen
=
len
;
*
siglen
=
len
;
return
TRUE
;
return
TRUE
;
}
}
return
!
BCryptSignHash
(
container
->
sign_key
->
handle
,
NULL
,
hash
val
,
hash
len
,
sig
,
*
siglen
,
siglen
,
0
);
return
!
BCryptSignHash
(
container
->
sign_key
->
handle
,
NULL
,
hash
->
value
,
hash
->
len
,
sig
,
*
siglen
,
siglen
,
0
);
}
}
BOOL
WINAPI
CPVerifySignature
(
HCRYPTPROV
hprov
,
HCRYPTHASH
hhash
,
const
BYTE
*
sig
,
DWORD
siglen
,
HCRYPTKEY
hpubkey
,
BOOL
WINAPI
CPVerifySignature
(
HCRYPTPROV
hprov
,
HCRYPTHASH
hhash
,
const
BYTE
*
sig
,
DWORD
siglen
,
HCRYPTKEY
hpubkey
,
...
@@ -885,8 +883,6 @@ BOOL WINAPI CPVerifySignature( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *s
...
@@ -885,8 +883,6 @@ BOOL WINAPI CPVerifySignature( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *s
{
{
struct
hash
*
hash
=
(
struct
hash
*
)
hhash
;
struct
hash
*
hash
=
(
struct
hash
*
)
hhash
;
struct
key
*
key
=
(
struct
key
*
)
hpubkey
;
struct
key
*
key
=
(
struct
key
*
)
hpubkey
;
UCHAR
hashval
[
MAX_HASH_LEN
];
ULONG
hashlen
=
sizeof
(
hashval
);
TRACE
(
"%p, %p, %p, %u %p, %s, %08x
\n
"
,
(
void
*
)
hprov
,
(
void
*
)
hhash
,
sig
,
siglen
,
(
void
*
)
hpubkey
,
TRACE
(
"%p, %p, %p, %u %p, %s, %08x
\n
"
,
(
void
*
)
hprov
,
(
void
*
)
hhash
,
sig
,
siglen
,
(
void
*
)
hpubkey
,
debugstr_w
(
desc
),
flags
);
debugstr_w
(
desc
),
flags
);
...
@@ -898,9 +894,7 @@ BOOL WINAPI CPVerifySignature( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *s
...
@@ -898,9 +894,7 @@ BOOL WINAPI CPVerifySignature( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *s
return
FALSE
;
return
FALSE
;
}
}
if
(
!
CPGetHashParam
(
hprov
,
hhash
,
HP_HASHVAL
,
hashval
,
&
hashlen
,
0
))
return
FALSE
;
return
!
BCryptVerifySignature
(
key
->
handle
,
NULL
,
hash
->
value
,
hash
->
len
,
(
UCHAR
*
)
sig
,
siglen
,
0
);
return
!
BCryptVerifySignature
(
key
->
handle
,
NULL
,
hashval
,
hashlen
,
(
UCHAR
*
)
sig
,
siglen
,
0
);
}
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
...
...
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