Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
190c3518
Commit
190c3518
authored
Sep 16, 2010
by
Alexander Morozov
Committed by
Alexandre Julliard
Sep 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Initialize HashEncryptionAlgorithm.
parent
8cdf1463
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
msg.c
dlls/crypt32/msg.c
+15
-2
message.c
dlls/crypt32/tests/message.c
+0
-12
No files found.
dlls/crypt32/msg.c
View file @
190c3518
...
...
@@ -809,9 +809,16 @@ static BOOL CSignerInfo_Construct(CMSG_CMS_SIGNER_INFO *info,
&
info
->
SignerId
.
u
.
IssuerSerialNumber
.
SerialNumber
,
&
in
->
pCertInfo
->
SerialNumber
);
info
->
SignerId
.
dwIdChoice
=
CERT_ID_ISSUER_SERIAL_NUMBER
;
info
->
HashEncryptionAlgorithm
.
pszObjId
=
in
->
pCertInfo
->
SubjectPublicKeyInfo
.
Algorithm
.
pszObjId
;
if
(
ret
)
ret
=
CRYPT_ConstructBlob
(
&
info
->
HashEncryptionAlgorithm
.
Parameters
,
&
in
->
pCertInfo
->
SubjectPublicKeyInfo
.
Algorithm
.
Parameters
);
}
else
{
const
CRYPT_ALGORITHM_IDENTIFIER
*
pEncrAlg
;
/* Implicitly in->cbSize == sizeof(CMSG_SIGNER_ENCODE_INFO_WITH_CMS).
* See CRYPT_IsValidSigner.
*/
...
...
@@ -845,6 +852,13 @@ static BOOL CSignerInfo_Construct(CMSG_CMS_SIGNER_INFO *info,
ret
=
CRYPT_ConstructBlob
(
&
info
->
SignerId
.
u
.
KeyId
,
&
in
->
SignerId
.
u
.
KeyId
);
}
pEncrAlg
=
in
->
HashEncryptionAlgorithm
.
pszObjId
?
&
in
->
HashEncryptionAlgorithm
:
&
in
->
pCertInfo
->
SubjectPublicKeyInfo
.
Algorithm
;
info
->
HashEncryptionAlgorithm
.
pszObjId
=
pEncrAlg
->
pszObjId
;
if
(
ret
)
ret
=
CRYPT_ConstructBlob
(
&
info
->
HashEncryptionAlgorithm
.
Parameters
,
&
pEncrAlg
->
Parameters
);
}
/* Assumption: algorithm IDs will point to static strings, not
* stack-based ones, so copying the pointer values is safe.
...
...
@@ -853,8 +867,6 @@ static BOOL CSignerInfo_Construct(CMSG_CMS_SIGNER_INFO *info,
if
(
ret
)
ret
=
CRYPT_ConstructBlob
(
&
info
->
HashAlgorithm
.
Parameters
,
&
in
->
HashAlgorithm
.
Parameters
);
memset
(
&
info
->
HashEncryptionAlgorithm
,
0
,
sizeof
(
info
->
HashEncryptionAlgorithm
));
if
(
ret
)
ret
=
CRYPT_ConstructAttributes
(
&
info
->
AuthAttrs
,
(
CRYPT_ATTRIBUTES
*
)
&
in
->
cAuthAttr
);
...
...
@@ -876,6 +888,7 @@ static void CSignerInfo_Free(CMSG_CMS_SIGNER_INFO *info)
else
CryptMemFree
(
info
->
SignerId
.
u
.
KeyId
.
pbData
);
CryptMemFree
(
info
->
HashAlgorithm
.
Parameters
.
pbData
);
CryptMemFree
(
info
->
HashEncryptionAlgorithm
.
Parameters
.
pbData
);
CryptMemFree
(
info
->
EncryptedHash
.
pbData
);
for
(
i
=
0
;
i
<
info
->
AuthAttrs
.
cAttr
;
i
++
)
{
...
...
dlls/crypt32/tests/message.c
View file @
190c3518
...
...
@@ -1024,10 +1024,8 @@ static void test_sign_message(void)
ret
=
CryptSignMessage
(
&
para
,
TRUE
,
0
,
NULL
,
NULL
,
signedBlob
,
&
signedBlobSize
);
ok
(
ret
,
"CryptSignMessage failed: %08x
\n
"
,
GetLastError
());
todo_wine
ok
(
signedBlobSize
==
sizeof
(
signedHashForEmptyMessage
),
"unexpected size %d
\n
"
,
signedBlobSize
);
todo_wine
ok
(
!
memcmp
(
signedBlob
,
signedHashForEmptyMessage
,
signedBlobSize
),
"unexpected value
\n
"
);
CryptMemFree
(
signedBlob
);
...
...
@@ -1044,10 +1042,8 @@ static void test_sign_message(void)
ret
=
CryptSignMessage
(
&
para
,
FALSE
,
0
,
NULL
,
NULL
,
signedBlob
,
&
signedBlobSize
);
ok
(
ret
,
"CryptSignMessage failed: %08x
\n
"
,
GetLastError
());
todo_wine
ok
(
signedBlobSize
==
sizeof
(
signedEmptyMessage
),
"unexpected size %d
\n
"
,
signedBlobSize
);
todo_wine
ok
(
!
memcmp
(
signedBlob
,
signedEmptyMessage
,
signedBlobSize
),
"unexpected value
\n
"
);
CryptMemFree
(
signedBlob
);
...
...
@@ -1065,10 +1061,8 @@ static void test_sign_message(void)
ret
=
CryptSignMessage
(
&
para
,
TRUE
,
2
,
toSign
,
signSize
,
signedBlob
,
&
signedBlobSize
);
ok
(
ret
,
"CryptSignMessage failed: %08x
\n
"
,
GetLastError
());
todo_wine
ok
(
signedBlobSize
==
sizeof
(
signedHash
),
"unexpected size of signed blob %d
\n
"
,
signedBlobSize
);
todo_wine
ok
(
!
memcmp
(
signedBlob
,
signedHash
,
signedBlobSize
),
"unexpected value
\n
"
);
CryptMemFree
(
signedBlob
);
...
...
@@ -1089,10 +1083,8 @@ static void test_sign_message(void)
ret
=
CryptSignMessage
(
&
para
,
TRUE
,
2
,
toSign
,
signSize
,
signedBlob
,
&
signedBlobSize
);
ok
(
ret
,
"CryptSignMessage failed: %08x
\n
"
,
GetLastError
());
todo_wine
ok
(
signedBlobSize
==
sizeof
(
signedHashWithCert
),
"unexpected size of signed blob %d
\n
"
,
signedBlobSize
);
todo_wine
ok
(
!
memcmp
(
signedBlob
,
signedHashWithCert
,
signedBlobSize
),
"unexpected value
\n
"
);
CryptMemFree
(
signedBlob
);
...
...
@@ -1120,10 +1112,8 @@ static void test_sign_message(void)
ret
=
CryptSignMessage
(
&
para
,
TRUE
,
2
,
toSign
,
signSize
,
signedBlob
,
&
signedBlobSize
);
ok
(
ret
,
"CryptSignMessage failed: %08x
\n
"
,
GetLastError
());
todo_wine
ok
(
signedBlobSize
==
sizeof
(
signedHashWithCRL
),
"unexpected size of signed blob %d
\n
"
,
signedBlobSize
);
todo_wine
ok
(
!
memcmp
(
signedBlob
,
signedHashWithCRL
,
signedBlobSize
),
"unexpected value
\n
"
);
CryptMemFree
(
signedBlob
);
...
...
@@ -1145,10 +1135,8 @@ static void test_sign_message(void)
ret
=
CryptSignMessage
(
&
para
,
FALSE
,
1
,
toSign
,
signSize
,
signedBlob
,
&
signedBlobSize
);
ok
(
ret
,
"CryptSignMessage failed: %08x
\n
"
,
GetLastError
());
todo_wine
ok
(
signedBlobSize
==
sizeof
(
signedData
),
"unexpected size of signed blob %d
\n
"
,
signedBlobSize
);
todo_wine
ok
(
!
memcmp
(
signedBlob
,
signedData
,
signedBlobSize
),
"unexpected value
\n
"
);
CryptMemFree
(
signedBlob
);
...
...
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