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
c4dd74d8
Commit
c4dd74d8
authored
Aug 20, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Aug 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Add a helper function to construct a signer handles structure.
parent
de88fedc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
msg.c
dlls/crypt32/msg.c
+23
-8
No files found.
dlls/crypt32/msg.c
View file @
c4dd74d8
...
...
@@ -722,23 +722,38 @@ static BOOL CRYPT_ConstructAttributes(CRYPT_ATTRIBUTES *out,
return
ret
;
}
/* Constructs a CSignerHandles with a copy of crypt_prov (not add-ref'ed - the
* caller must do this if necessary), a hash handle based on HashAlgorithm, and
* an authenticated attributes hash handle if hasAuthAttrs is TRUE.
*/
static
BOOL
CSignerHandles_Construct
(
CSignerHandles
*
handles
,
HCRYPTPROV
crypt_prov
,
CRYPT_ALGORITHM_IDENTIFIER
*
HashAlgorithm
,
BOOL
hasAuthAttrs
)
{
ALG_ID
algID
;
BOOL
ret
;
handles
->
prov
=
crypt_prov
;
algID
=
CertOIDToAlgId
(
HashAlgorithm
->
pszObjId
);
ret
=
CryptCreateHash
(
handles
->
prov
,
algID
,
0
,
0
,
&
handles
->
contentHash
);
if
(
ret
&&
hasAuthAttrs
)
ret
=
CryptCreateHash
(
handles
->
prov
,
algID
,
0
,
0
,
&
handles
->
authAttrHash
);
return
ret
;
}
/* Constructs both a CSignerHandles and a CMSG_SIGNER_INFO from a
* CMSG_SIGNER_ENCODE_INFO_WITH_CMS.
*/
static
BOOL
CSignerInfo_Construct
(
CSignerHandles
*
handles
,
CMSG_SIGNER_INFO
*
info
,
CMSG_SIGNER_ENCODE_INFO_WITH_CMS
*
in
,
DWORD
open_flags
)
{
ALG_ID
algID
;
BOOL
ret
;
handles
->
prov
=
in
->
hCryptProv
;
if
(
!
(
open_flags
&
CMSG_CRYPT_RELEASE_CONTEXT_FLAG
))
CryptContextAddRef
(
handles
->
prov
,
NULL
,
0
);
algID
=
CertOIDToAlgId
(
in
->
HashAlgorithm
.
pszObjId
);
ret
=
CryptCreateHash
(
handles
->
prov
,
algID
,
0
,
0
,
&
handles
->
contentHash
);
if
(
ret
&&
in
->
cAuthAttr
)
ret
=
CryptCreateHash
(
handles
->
prov
,
algID
,
0
,
0
,
&
handles
->
authAttrHash
);
CryptContextAddRef
(
in
->
hCryptProv
,
NULL
,
0
);
ret
=
CSignerHandles_Construct
(
handles
,
in
->
hCryptProv
,
&
in
->
HashAlgorithm
,
in
->
cAuthAttr
>
0
);
if
(
ret
)
{
/* Note: needs to change if CMS fields are supported */
...
...
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