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
8c0e089d
Commit
8c0e089d
authored
Sep 08, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Sep 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Simplify CryptVerifyMessageSignature.
parent
cb5385e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
41 deletions
+7
-41
message.c
dlls/crypt32/message.c
+7
-41
No files found.
dlls/crypt32/message.c
View file @
8c0e089d
...
...
@@ -80,6 +80,8 @@ static CERT_INFO *CRYPT_GetSignerCertInfoFromMsg(HCRYPTMSG msg,
}
}
}
else
SetLastError
(
CRYPT_E_UNEXPECTED_MSG_TYPE
);
return
certInfo
;
}
...
...
@@ -179,34 +181,11 @@ BOOL WINAPI CryptVerifyDetachedMessageSignature(
return
ret
;
}
static
BOOL
CRYPT_CopyParam
(
void
*
pvData
,
DWORD
*
pcbData
,
const
void
*
src
,
DWORD
len
)
{
BOOL
ret
=
TRUE
;
if
(
!
pvData
)
*
pcbData
=
len
;
else
if
(
*
pcbData
<
len
)
{
*
pcbData
=
len
;
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
}
else
{
*
pcbData
=
len
;
memcpy
(
pvData
,
src
,
len
);
}
return
ret
;
}
BOOL
WINAPI
CryptVerifyMessageSignature
(
PCRYPT_VERIFY_MESSAGE_PARA
pVerifyPara
,
DWORD
dwSignerIndex
,
const
BYTE
*
pbSignedBlob
,
DWORD
cbSignedBlob
,
BYTE
*
pbDecoded
,
DWORD
*
pcbDecoded
,
PCCERT_CONTEXT
*
ppSignerCert
)
{
BOOL
ret
=
FALSE
;
DWORD
size
;
CRYPT_CONTENT_INFO
*
contentInfo
;
HCRYPTMSG
msg
;
TRACE
(
"(%p, %d, %p, %d, %p, %p, %p)
\n
"
,
...
...
@@ -226,26 +205,14 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
return
FALSE
;
}
if
(
!
CryptDecodeObjectEx
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
PKCS_CONTENT_INFO
,
pbSignedBlob
,
cbSignedBlob
,
CRYPT_DECODE_ALLOC_FLAG
|
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
(
LPBYTE
)
&
contentInfo
,
&
size
))
return
FALSE
;
if
(
strcmp
(
contentInfo
->
pszObjId
,
szOID_RSA_signedData
))
{
LocalFree
(
contentInfo
);
SetLastError
(
CRYPT_E_UNEXPECTED_MSG_TYPE
);
return
FALSE
;
}
msg
=
CryptMsgOpenToDecode
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
0
,
CMSG_SIGNED
,
pVerifyPara
->
hCryptProv
,
NULL
,
NULL
);
msg
=
CryptMsgOpenToDecode
(
pVerifyPara
->
dwMsgAndCertEncodingType
,
0
,
0
,
pVerifyPara
->
hCryptProv
,
NULL
,
NULL
);
if
(
msg
)
{
ret
=
CryptMsgUpdate
(
msg
,
contentInfo
->
Content
.
pbData
,
contentInfo
->
Content
.
cbData
,
TRUE
);
ret
=
CryptMsgUpdate
(
msg
,
pbSignedBlob
,
cbSignedBlob
,
TRUE
);
if
(
ret
&&
pcbDecoded
)
ret
=
C
RYPT_CopyParam
(
pbDecoded
,
pc
bDecoded
,
contentInfo
->
Content
.
pbData
,
contentInfo
->
Content
.
cbData
);
ret
=
C
ryptMsgGetParam
(
msg
,
CMSG_CONTENT_PARAM
,
0
,
p
bDecoded
,
pcbDecoded
);
if
(
ret
)
{
CERT_INFO
*
certInfo
=
CRYPT_GetSignerCertInfoFromMsg
(
msg
,
...
...
@@ -279,7 +246,6 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
}
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