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
1f9d9be7
Commit
1f9d9be7
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: Don't keep an unneeded copy of the crypto provider for each signer.
parent
bfbc159d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
msg.c
dlls/crypt32/msg.c
+6
-11
No files found.
dlls/crypt32/msg.c
View file @
1f9d9be7
...
@@ -772,7 +772,6 @@ static void CSignerInfo_Free(CMSG_SIGNER_INFO *info)
...
@@ -772,7 +772,6 @@ static void CSignerInfo_Free(CMSG_SIGNER_INFO *info)
typedef
struct
_CSignerHandles
typedef
struct
_CSignerHandles
{
{
HCRYPTPROV
prov
;
HCRYPTHASH
contentHash
;
HCRYPTHASH
contentHash
;
HCRYPTHASH
authAttrHash
;
HCRYPTHASH
authAttrHash
;
HCRYPTKEY
key
;
HCRYPTKEY
key
;
...
@@ -791,8 +790,7 @@ typedef struct _CSignedEncodeMsg
...
@@ -791,8 +790,7 @@ typedef struct _CSignedEncodeMsg
CSignedMsgData
msg_data
;
CSignedMsgData
msg_data
;
}
CSignedEncodeMsg
;
}
CSignedEncodeMsg
;
/* Constructs a CSignerHandles with a copy of crypt_prov (not add-ref'ed - the
/* Constructs a CSignerHandles with a hash handle based on HashAlgorithm, and
* caller must do this if necessary), a hash handle based on HashAlgorithm, and
* an authenticated attributes hash handle if hasAuthAttrs is TRUE.
* an authenticated attributes hash handle if hasAuthAttrs is TRUE.
*/
*/
static
BOOL
CSignerHandles_Construct
(
CSignerHandles
*
handles
,
static
BOOL
CSignerHandles_Construct
(
CSignerHandles
*
handles
,
...
@@ -802,12 +800,10 @@ static BOOL CSignerHandles_Construct(CSignerHandles *handles,
...
@@ -802,12 +800,10 @@ static BOOL CSignerHandles_Construct(CSignerHandles *handles,
ALG_ID
algID
;
ALG_ID
algID
;
BOOL
ret
;
BOOL
ret
;
handles
->
prov
=
crypt_prov
;
algID
=
CertOIDToAlgId
(
HashAlgorithm
->
pszObjId
);
algID
=
CertOIDToAlgId
(
HashAlgorithm
->
pszObjId
);
ret
=
CryptCreateHash
(
handles
->
prov
,
algID
,
0
,
0
,
&
handles
->
contentHash
);
ret
=
CryptCreateHash
(
crypt_
prov
,
algID
,
0
,
0
,
&
handles
->
contentHash
);
if
(
ret
&&
hasAuthAttrs
)
if
(
ret
&&
hasAuthAttrs
)
ret
=
CryptCreateHash
(
handles
->
prov
,
algID
,
0
,
0
,
ret
=
CryptCreateHash
(
crypt_prov
,
algID
,
0
,
0
,
&
handles
->
authAttrHash
);
&
handles
->
authAttrHash
);
return
ret
;
return
ret
;
}
}
...
@@ -820,7 +816,6 @@ static void CSignedMsgData_CloseHandles(CSignedMsgData *msg_data)
...
@@ -820,7 +816,6 @@ static void CSignedMsgData_CloseHandles(CSignedMsgData *msg_data)
CryptDestroyKey
(
msg_data
->
signerHandles
[
i
].
key
);
CryptDestroyKey
(
msg_data
->
signerHandles
[
i
].
key
);
CryptDestroyHash
(
msg_data
->
signerHandles
[
i
].
contentHash
);
CryptDestroyHash
(
msg_data
->
signerHandles
[
i
].
contentHash
);
CryptDestroyHash
(
msg_data
->
signerHandles
[
i
].
authAttrHash
);
CryptDestroyHash
(
msg_data
->
signerHandles
[
i
].
authAttrHash
);
CryptReleaseContext
(
msg_data
->
signerHandles
[
i
].
prov
,
0
);
}
}
CryptMemFree
(
msg_data
->
signerHandles
);
CryptMemFree
(
msg_data
->
signerHandles
);
}
}
...
@@ -1214,14 +1209,14 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
...
@@ -1214,14 +1209,14 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
&
info
->
rgSigners
[
i
]);
&
info
->
rgSigners
[
i
]);
if
(
ret
)
if
(
ret
)
{
{
if
(
!
(
dwFlags
&
CMSG_CRYPT_RELEASE_CONTEXT_FLAG
))
CryptContextAddRef
(
info
->
rgSigners
[
i
].
hCryptProv
,
NULL
,
0
);
ret
=
CSignerHandles_Construct
(
ret
=
CSignerHandles_Construct
(
&
msg
->
msg_data
.
signerHandles
[
i
],
&
msg
->
msg_data
.
signerHandles
[
i
],
info
->
rgSigners
[
i
].
hCryptProv
,
info
->
rgSigners
[
i
].
hCryptProv
,
&
info
->
rgSigners
[
i
].
HashAlgorithm
,
&
info
->
rgSigners
[
i
].
HashAlgorithm
,
info
->
rgSigners
[
i
].
cAuthAttr
>
0
);
info
->
rgSigners
[
i
].
cAuthAttr
>
0
);
if
(
dwFlags
&
CMSG_CRYPT_RELEASE_CONTEXT_FLAG
)
CryptReleaseContext
(
info
->
rgSigners
[
i
].
hCryptProv
,
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