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
a203640b
Commit
a203640b
authored
Aug 20, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Reduce excessive indenting.
parent
a36d8ce6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
46 deletions
+41
-46
message.c
dlls/crypt32/message.c
+41
-46
No files found.
dlls/crypt32/message.c
View file @
a203640b
...
...
@@ -131,6 +131,7 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
BOOL
ret
=
FALSE
;
DWORD
size
;
CRYPT_CONTENT_INFO
*
contentInfo
;
HCRYPTMSG
msg
;
TRACE
(
"(%p, %d, %p, %d, %p, %p, %p)
\n
"
,
pVerifyPara
,
dwSignerIndex
,
pbSignedBlob
,
cbSignedBlob
,
...
...
@@ -149,66 +150,60 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
return
FALSE
;
}
ret
=
CryptDecodeObjectEx
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
if
(
!
CryptDecodeObjectEx
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
PKCS_CONTENT_INFO
,
pbSignedBlob
,
cbSignedBlob
,
CRYPT_DECODE_ALLOC_FLAG
|
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
(
LPBYTE
)
&
contentInfo
,
&
size
);
if
(
ret
)
(
LPBYTE
)
&
contentInfo
,
&
size
))
return
FALSE
;
if
(
strcmp
(
contentInfo
->
pszObjId
,
szOID_RSA_signedData
))
{
if
(
strcmp
(
contentInfo
->
pszObjId
,
szOID_RSA_signedData
))
{
SetLastError
(
CRYPT_E_UNEXPECTED_MSG_TYPE
);
ret
=
FALSE
;
}
else
LocalFree
(
contentInfo
);
SetLastError
(
CRYPT_E_UNEXPECTED_MSG_TYPE
);
return
FALSE
;
}
msg
=
CryptMsgOpenToDecode
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
0
,
CMSG_SIGNED
,
pVerifyPara
->
hCryptProv
,
NULL
,
NULL
);
if
(
msg
)
{
ret
=
CryptMsgUpdate
(
msg
,
contentInfo
->
Content
.
pbData
,
contentInfo
->
Content
.
cbData
,
TRUE
);
if
(
ret
&&
pcbDecoded
)
ret
=
CRYPT_CopyParam
(
pbDecoded
,
pcbDecoded
,
contentInfo
->
Content
.
pbData
,
contentInfo
->
Content
.
cbData
);
if
(
ret
)
{
HCRYPTMSG
msg
=
CryptMsgOpenToDecode
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
0
,
CMSG_SIGNED
,
pVerifyPara
->
hCryptProv
,
NULL
,
NULL
);
CERT_INFO
*
certInfo
=
CRYPT_GetSignerCertInfoFromMsg
(
msg
,
dwSignerIndex
);
if
(
msg
)
ret
=
FALSE
;
if
(
certInfo
)
{
ret
=
CryptMsgUpdate
(
msg
,
contentInfo
->
Content
.
pbData
,
contentInfo
->
Content
.
cbData
,
TRUE
);
if
(
ret
&&
pcbDecoded
)
ret
=
CRYPT_CopyParam
(
pbDecoded
,
pcbDecoded
,
contentInfo
->
Content
.
pbData
,
contentInfo
->
Content
.
cbData
);
if
(
ret
)
HCERTSTORE
store
=
CertOpenStore
(
CERT_STORE_PROV_MSG
,
pVerifyPara
->
dwMsgAndCertEncodingType
,
pVerifyPara
->
hCryptProv
,
0
,
msg
);
if
(
store
)
{
CERT_INFO
*
certInfo
=
CRYPT_GetSignerCertInfoFromMsg
(
msg
,
dwSignerIndex
);
PCCERT_CONTEXT
cert
=
CRYPT_GetSignerCertificate
(
msg
,
pVerifyPara
,
certInfo
,
store
);
ret
=
FALSE
;
if
(
certInfo
)
if
(
cert
)
{
HCERTSTORE
store
=
CertOpenStore
(
CERT_STORE_PROV_MSG
,
pVerifyPara
->
dwMsgAndCertEncodingType
,
pVerifyPara
->
hCryptProv
,
0
,
msg
);
if
(
store
)
{
PCCERT_CONTEXT
cert
=
CRYPT_GetSignerCertificate
(
msg
,
pVerifyPara
,
certInfo
,
store
);
if
(
cert
)
{
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_SIGNATURE
,
cert
->
pCertInfo
);
if
(
ret
&&
ppSignerCert
)
*
ppSignerCert
=
cert
;
else
CertFreeCertificateContext
(
cert
);
}
CertCloseStore
(
store
,
0
);
}
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_SIGNATURE
,
cert
->
pCertInfo
);
if
(
ret
&&
ppSignerCert
)
*
ppSignerCert
=
cert
;
else
CertFreeCertificateContext
(
cert
);
}
C
ryptMemFree
(
certInfo
);
C
ertCloseStore
(
store
,
0
);
}
CryptMsgClose
(
msg
);
}
CryptMemFree
(
certInfo
);
}
LocalFree
(
contentInfo
);
CryptMsgClose
(
msg
);
}
LocalFree
(
contentInfo
);
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
}
...
...
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