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
8436f038
Commit
8436f038
authored
Jun 29, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Factor out cng_prepare_signature().
parent
6b8cf4dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
cert.c
dlls/crypt32/cert.c
+15
-10
No files found.
dlls/crypt32/cert.c
View file @
8436f038
...
@@ -2810,7 +2810,18 @@ static BOOL CNG_PrepareSignatureECC(BYTE *encoded_sig, DWORD encoded_size, BYTE
...
@@ -2810,7 +2810,18 @@ static BOOL CNG_PrepareSignatureECC(BYTE *encoded_sig, DWORD encoded_size, BYTE
return
TRUE
;
return
TRUE
;
}
}
static
BOOL
CNG_PrepareSignature
(
CERT_PUBLIC_KEY_INFO
*
pubKeyInfo
,
const
CERT_SIGNED_CONTENT_INFO
*
signedCert
,
static
BOOL
cng_prepare_signature
(
const
char
*
alg_oid
,
BYTE
*
encoded_sig
,
DWORD
encoded_sig_len
,
BYTE
**
sig_value
,
DWORD
*
sig_len
)
{
if
(
!
strcmp
(
alg_oid
,
szOID_ECC_PUBLIC_KEY
))
return
CNG_PrepareSignatureECC
(
encoded_sig
,
encoded_sig_len
,
sig_value
,
sig_len
);
FIXME
(
"Unsupported public key type: %s
\n
"
,
debugstr_a
(
alg_oid
));
SetLastError
(
NTE_BAD_ALGID
);
return
FALSE
;
}
static
BOOL
CNG_PrepareCertSignature
(
CERT_PUBLIC_KEY_INFO
*
pubKeyInfo
,
const
CERT_SIGNED_CONTENT_INFO
*
signedCert
,
BYTE
**
sig_value
,
DWORD
*
sig_len
)
BYTE
**
sig_value
,
DWORD
*
sig_len
)
{
{
BYTE
*
encoded_sig
;
BYTE
*
encoded_sig
;
...
@@ -2832,14 +2843,8 @@ static BOOL CNG_PrepareSignature(CERT_PUBLIC_KEY_INFO *pubKeyInfo, const CERT_SI
...
@@ -2832,14 +2843,8 @@ static BOOL CNG_PrepareSignature(CERT_PUBLIC_KEY_INFO *pubKeyInfo, const CERT_SI
for
(
i
=
0
;
i
<
signedCert
->
Signature
.
cbData
;
i
++
)
for
(
i
=
0
;
i
<
signedCert
->
Signature
.
cbData
;
i
++
)
encoded_sig
[
i
]
=
signedCert
->
Signature
.
pbData
[
signedCert
->
Signature
.
cbData
-
i
-
1
];
encoded_sig
[
i
]
=
signedCert
->
Signature
.
pbData
[
signedCert
->
Signature
.
cbData
-
i
-
1
];
if
(
!
strcmp
(
pubKeyInfo
->
Algorithm
.
pszObjId
,
szOID_ECC_PUBLIC_KEY
))
ret
=
cng_prepare_signature
(
pubKeyInfo
->
Algorithm
.
pszObjId
,
encoded_sig
,
signedCert
->
Signature
.
cbData
,
ret
=
CNG_PrepareSignatureECC
(
encoded_sig
,
signedCert
->
Signature
.
cbData
,
sig_value
,
sig_len
);
sig_value
,
sig_len
);
else
{
FIXME
(
"Unsupported public key type: %s
\n
"
,
debugstr_a
(
pubKeyInfo
->
Algorithm
.
pszObjId
));
SetLastError
(
NTE_BAD_ALGID
);
}
CryptMemFree
(
encoded_sig
);
CryptMemFree
(
encoded_sig
);
return
ret
;
return
ret
;
}
}
...
@@ -2859,7 +2864,7 @@ static BOOL CNG_VerifySignature(HCRYPTPROV_LEGACY hCryptProv, DWORD dwCertEncodi
...
@@ -2859,7 +2864,7 @@ static BOOL CNG_VerifySignature(HCRYPTPROV_LEGACY hCryptProv, DWORD dwCertEncodi
ret
=
CNG_CalcHash
(
info
->
pwszCNGAlgid
,
signedCert
,
&
hash_value
,
&
hash_len
);
ret
=
CNG_CalcHash
(
info
->
pwszCNGAlgid
,
signedCert
,
&
hash_value
,
&
hash_len
);
if
(
ret
)
if
(
ret
)
{
{
ret
=
CNG_PrepareSignature
(
pubKeyInfo
,
signedCert
,
&
sig_value
,
&
sig_len
);
ret
=
CNG_Prepare
Cert
Signature
(
pubKeyInfo
,
signedCert
,
&
sig_value
,
&
sig_len
);
if
(
ret
)
if
(
ret
)
{
{
status
=
BCryptVerifySignature
(
key
,
NULL
,
hash_value
,
hash_len
,
sig_value
,
sig_len
,
0
);
status
=
BCryptVerifySignature
(
key
,
NULL
,
hash_value
,
hash_len
,
sig_value
,
sig_len
,
0
);
...
...
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