Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabriel Ivăncescu
wine
Commits
8436f038
Commit
8436f038
authored
1 year ago
by
Paul Gofman
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
crypt32: Factor out cng_prepare_signature().
parent
6b8cf4dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/crypt32/cert.c
+15
-10
15 additions, 10 deletions
dlls/crypt32/cert.c
with
15 additions
and
10 deletions
dlls/crypt32/cert.c
+
15
−
10
View file @
8436f038
...
...
@@ -2810,7 +2810,18 @@ static BOOL CNG_PrepareSignatureECC(BYTE *encoded_sig, DWORD encoded_size, BYTE
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
*
encoded_sig
;
...
...
@@ -2832,14 +2843,8 @@ static BOOL CNG_PrepareSignature(CERT_PUBLIC_KEY_INFO *pubKeyInfo, const CERT_SI
for
(
i
=
0
;
i
<
signedCert
->
Signature
.
cbData
;
i
++
)
encoded_sig
[
i
]
=
signedCert
->
Signature
.
pbData
[
signedCert
->
Signature
.
cbData
-
i
-
1
];
if
(
!
strcmp
(
pubKeyInfo
->
Algorithm
.
pszObjId
,
szOID_ECC_PUBLIC_KEY
))
ret
=
CNG_PrepareSignatureECC
(
encoded_sig
,
signedCert
->
Signature
.
cbData
,
sig_value
,
sig_len
);
else
{
FIXME
(
"Unsupported public key type: %s
\n
"
,
debugstr_a
(
pubKeyInfo
->
Algorithm
.
pszObjId
));
SetLastError
(
NTE_BAD_ALGID
);
}
ret
=
cng_prepare_signature
(
pubKeyInfo
->
Algorithm
.
pszObjId
,
encoded_sig
,
signedCert
->
Signature
.
cbData
,
sig_value
,
sig_len
);
CryptMemFree
(
encoded_sig
);
return
ret
;
}
...
...
@@ -2859,7 +2864,7 @@ static BOOL CNG_VerifySignature(HCRYPTPROV_LEGACY hCryptProv, DWORD dwCertEncodi
ret
=
CNG_CalcHash
(
info
->
pwszCNGAlgid
,
signedCert
,
&
hash_value
,
&
hash_len
);
if
(
ret
)
{
ret
=
CNG_PrepareSignature
(
pubKeyInfo
,
signedCert
,
&
sig_value
,
&
sig_len
);
ret
=
CNG_Prepare
Cert
Signature
(
pubKeyInfo
,
signedCert
,
&
sig_value
,
&
sig_len
);
if
(
ret
)
{
status
=
BCryptVerifySignature
(
key
,
NULL
,
hash_value
,
hash_len
,
sig_value
,
sig_len
,
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment