winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1085 discussions
Start a n
N
ew thread
Juan Lang : crypt32: Make more functions members of signed message data, rather than message.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 1522282673e19f6cb31b775bafd8cb564e05d138 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1522282673e19f6cb31b775ba…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:44:53 2007 -0700 crypt32: Make more functions members of signed message data, rather than message. --- dlls/crypt32/msg.c | 64 ++++++++++++++++++++++++++------------------------- 1 files changed, 33 insertions(+), 31 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 0afb662..6c33941 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -956,8 +956,8 @@ static BOOL CRYPT_AppendAttribute(CRYPT_ATTRIBUTES *out, return ret; } -static BOOL CSignedEncodeMsg_AppendMessageDigestAttribute(CSignedEncodeMsg *msg, - DWORD signerIndex) +static BOOL CSignedMsgData_AppendMessageDigestAttribute( + CSignedMsgData *msg_data, DWORD signerIndex) { BOOL ret; DWORD size; @@ -967,13 +967,13 @@ static BOOL CSignedEncodeMsg_AppendMessageDigestAttribute(CSignedEncodeMsg *msg, size = sizeof(DWORD); ret = CryptGetHashParam( - msg->msg_data.signerHandles[signerIndex].contentHash, HP_HASHSIZE, + msg_data->signerHandles[signerIndex].contentHash, HP_HASHSIZE, (LPBYTE)&hash.cbData, &size, 0); if (ret) { hash.pbData = CryptMemAlloc(hash.cbData); ret = CryptGetHashParam( - msg->msg_data.signerHandles[signerIndex].contentHash, HP_HASHVAL, + msg_data->signerHandles[signerIndex].contentHash, HP_HASHVAL, hash.pbData, &hash.cbData, 0); if (ret) { @@ -982,7 +982,7 @@ static BOOL CSignedEncodeMsg_AppendMessageDigestAttribute(CSignedEncodeMsg *msg, if (ret) { ret = CRYPT_AppendAttribute( - &msg->msg_data.info->rgSignerInfo[signerIndex].AuthAttrs, + &msg_data->info->rgSignerInfo[signerIndex].AuthAttrs, &messageDigestAttr); LocalFree(encodedHash.pbData); } @@ -992,17 +992,17 @@ static BOOL CSignedEncodeMsg_AppendMessageDigestAttribute(CSignedEncodeMsg *msg, return ret; } -static BOOL CSignedEncodeMsg_UpdateAuthenticatedAttributes( - CSignedEncodeMsg *msg) +static BOOL CSignedMsgData_UpdateAuthenticatedAttributes( + CSignedMsgData *msg_data) { DWORD i; BOOL ret = TRUE; - TRACE("(%p)\n", msg); + TRACE("(%p)\n", msg_data); - for (i = 0; ret && i < msg->msg_data.info->cSignerInfo; i++) + for (i = 0; ret && i < msg_data->info->cSignerInfo; i++) { - if (msg->msg_data.info->rgSignerInfo[i].AuthAttrs.cAttr) + if (msg_data->info->rgSignerInfo[i].AuthAttrs.cAttr) { BYTE oid_rsa_data_encoded[] = { 0x06,0x09,0x2a,0x86,0x48,0x86,0xf7, 0x0d,0x01,0x07,0x01 }; @@ -1013,21 +1013,21 @@ static BOOL CSignedEncodeMsg_UpdateAuthenticatedAttributes( /* FIXME: does this depend on inner OID? */ ret = CRYPT_AppendAttribute( - &msg->msg_data.info->rgSignerInfo[i].AuthAttrs, &contentTypeAttr); + &msg_data->info->rgSignerInfo[i].AuthAttrs, &contentTypeAttr); if (ret) - ret = CSignedEncodeMsg_AppendMessageDigestAttribute(msg, i); + ret = CSignedMsgData_AppendMessageDigestAttribute(msg_data, i); if (ret) { LPBYTE encodedAttrs; DWORD size; ret = CryptEncodeObjectEx(X509_ASN_ENCODING, PKCS_ATTRIBUTES, - &msg->msg_data.info->rgSignerInfo[i].AuthAttrs, + &msg_data->info->rgSignerInfo[i].AuthAttrs, CRYPT_ENCODE_ALLOC_FLAG, NULL, (LPBYTE)&encodedAttrs, &size); if (ret) { ret = CryptHashData( - msg->msg_data.signerHandles[i].authAttrHash, encodedAttrs, + msg_data->signerHandles[i].authAttrHash, encodedAttrs, size, 0); LocalFree(encodedAttrs); } @@ -1051,36 +1051,36 @@ static void CRYPT_ReverseBytes(CRYPT_HASH_BLOB *hash) } } -static BOOL CSignedEncodeMsg_Sign(CSignedEncodeMsg *msg) +static BOOL CSignedMsgData_Sign(CSignedMsgData *msg_data) { DWORD i; BOOL ret = TRUE; - TRACE("(%p)\n", msg); + TRACE("(%p)\n", msg_data); - for (i = 0; ret && i < msg->msg_data.info->cSignerInfo; i++) + for (i = 0; ret && i < msg_data->info->cSignerInfo; i++) { HCRYPTHASH hash; - if (msg->msg_data.info->rgSignerInfo[i].AuthAttrs.cAttr) - hash = msg->msg_data.signerHandles[i].authAttrHash; + if (msg_data->info->rgSignerInfo[i].AuthAttrs.cAttr) + hash = msg_data->signerHandles[i].authAttrHash; else - hash = msg->msg_data.signerHandles[i].contentHash; + hash = msg_data->signerHandles[i].contentHash; ret = CryptSignHashW(hash, AT_SIGNATURE, NULL, 0, NULL, - &msg->msg_data.info->rgSignerInfo[i].EncryptedHash.cbData); + &msg_data->info->rgSignerInfo[i].EncryptedHash.cbData); if (ret) { - msg->msg_data.info->rgSignerInfo[i].EncryptedHash.pbData = + msg_data->info->rgSignerInfo[i].EncryptedHash.pbData = CryptMemAlloc( - msg->msg_data.info->rgSignerInfo[i].EncryptedHash.cbData); - if (msg->msg_data.info->rgSignerInfo[i].EncryptedHash.pbData) + msg_data->info->rgSignerInfo[i].EncryptedHash.cbData); + if (msg_data->info->rgSignerInfo[i].EncryptedHash.pbData) { ret = CryptSignHashW(hash, AT_SIGNATURE, NULL, 0, - msg->msg_data.info->rgSignerInfo[i].EncryptedHash.pbData, - &msg->msg_data.info->rgSignerInfo[i].EncryptedHash.cbData); + msg_data->info->rgSignerInfo[i].EncryptedHash.pbData, + &msg_data->info->rgSignerInfo[i].EncryptedHash.cbData); if (ret) CRYPT_ReverseBytes( - &msg->msg_data.info->rgSignerInfo[i].EncryptedHash); + &msg_data->info->rgSignerInfo[i].EncryptedHash); } else ret = FALSE; @@ -1100,9 +1100,10 @@ static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, ret = CSignedMsgData_UpdateHash(&msg->msg_data, pbData, cbData); if (ret && fFinal) { - ret = CSignedEncodeMsg_UpdateAuthenticatedAttributes(msg); + ret = CSignedMsgData_UpdateAuthenticatedAttributes( + &msg->msg_data); if (ret) - ret = CSignedEncodeMsg_Sign(msg); + ret = CSignedMsgData_Sign(&msg->msg_data); } if (msg->base.streamed) FIXME("streamed partial stub\n"); @@ -1128,9 +1129,10 @@ static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, if (ret) ret = CSignedMsgData_UpdateHash(&msg->msg_data, pbData, cbData); if (ret) - ret = CSignedEncodeMsg_UpdateAuthenticatedAttributes(msg); + ret = CSignedMsgData_UpdateAuthenticatedAttributes( + &msg->msg_data); if (ret) - ret = CSignedEncodeMsg_Sign(msg); + ret = CSignedMsgData_Sign(&msg->msg_data); } } return ret;
1
0
0
0
Juan Lang : crypt32: Make updating a hash a member of signed message data, not signed message.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: bfde05d8b69f12b00f5cc286110f2388fa33ed1f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bfde05d8b69f12b00f5cc2861…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:44:12 2007 -0700 crypt32: Make updating a hash a member of signed message data, not signed message. --- dlls/crypt32/msg.c | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index b67dbbd..0afb662 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -819,6 +819,18 @@ static void CSignedMsgData_CloseHandles(CSignedMsgData *msg_data) CryptMemFree(msg_data->signerHandles); } +static BOOL CSignedMsgData_UpdateHash(CSignedMsgData *msg_data, + const BYTE *pbData, DWORD cbData) +{ + DWORD i; + BOOL ret = TRUE; + + for (i = 0; ret && i < msg_data->info->cSignerInfo; i++) + ret = CryptHashData(msg_data->signerHandles[i].contentHash, pbData, + cbData, 0); + return ret; +} + static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg) { CSignedEncodeMsg *msg = (CSignedEncodeMsg *)hCryptMsg; @@ -928,20 +940,6 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, return ret; } -static BOOL CSignedEncodeMsg_UpdateHash(CSignedEncodeMsg *msg, - const BYTE *pbData, DWORD cbData) -{ - DWORD i; - BOOL ret = TRUE; - - TRACE("(%p, %p, %d)\n", msg, pbData, cbData); - - for (i = 0; ret && i < msg->msg_data.info->cSignerInfo; i++) - ret = CryptHashData(msg->msg_data.signerHandles[i].contentHash, pbData, - cbData, 0); - return ret; -} - static BOOL CRYPT_AppendAttribute(CRYPT_ATTRIBUTES *out, const CRYPT_ATTRIBUTE *in) { @@ -1099,7 +1097,7 @@ static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, if (msg->base.streamed || (msg->base.open_flags & CMSG_DETACHED_FLAG)) { - ret = CSignedEncodeMsg_UpdateHash(msg, pbData, cbData); + ret = CSignedMsgData_UpdateHash(&msg->msg_data, pbData, cbData); if (ret && fFinal) { ret = CSignedEncodeMsg_UpdateAuthenticatedAttributes(msg); @@ -1128,7 +1126,7 @@ static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, else ret = TRUE; if (ret) - ret = CSignedEncodeMsg_UpdateHash(msg, pbData, cbData); + ret = CSignedMsgData_UpdateHash(&msg->msg_data, pbData, cbData); if (ret) ret = CSignedEncodeMsg_UpdateAuthenticatedAttributes(msg); if (ret)
1
0
0
0
Juan Lang : crypt32: Make a helper function to a free a signed message' s handles.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 0080d3d691913577538801696a4b70edc930b4a3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0080d3d691913577538801696…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:43:12 2007 -0700 crypt32: Make a helper function to a free a signed message's handles. --- dlls/crypt32/msg.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 9b9b843..b67dbbd 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -805,6 +805,20 @@ typedef struct _CSignedEncodeMsg CSignedMsgData msg_data; } CSignedEncodeMsg; +static void CSignedMsgData_CloseHandles(CSignedMsgData *msg_data) +{ + DWORD i; + + for (i = 0; i < msg_data->info->cSignerInfo; i++) + { + CryptDestroyKey(msg_data->signerHandles[i].key); + CryptDestroyHash(msg_data->signerHandles[i].contentHash); + CryptDestroyHash(msg_data->signerHandles[i].authAttrHash); + CryptReleaseContext(msg_data->signerHandles[i].prov, 0); + } + CryptMemFree(msg_data->signerHandles); +} + static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg) { CSignedEncodeMsg *msg = (CSignedEncodeMsg *)hCryptMsg; @@ -814,14 +828,8 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg) CRYPT_FreeBlobArray((BlobArray *)&msg->msg_data.info->cCertEncoded); CRYPT_FreeBlobArray((BlobArray *)&msg->msg_data.info->cCrlEncoded); for (i = 0; i < msg->msg_data.info->cSignerInfo; i++) - { CSignerInfo_Free(&msg->msg_data.info->rgSignerInfo[i]); - CryptDestroyKey(msg->msg_data.signerHandles[i].key); - CryptDestroyHash(msg->msg_data.signerHandles[i].contentHash); - CryptDestroyHash(msg->msg_data.signerHandles[i].authAttrHash); - CryptReleaseContext(msg->msg_data.signerHandles[i].prov, 0); - } - CryptMemFree(msg->msg_data.signerHandles); + CSignedMsgData_CloseHandles(&msg->msg_data); CryptMemFree(msg->msg_data.info->rgSignerInfo); CryptMemFree(msg->msg_data.info); }
1
0
0
0
Juan Lang : crypt32: Use signed message data type for decoded signed messages.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 5e9299d980fc240a2781bcfc4de0c9ac6282aa3a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e9299d980fc240a2781bcfc4…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:42:31 2007 -0700 crypt32: Use signed message data type for decoded signed messages. --- dlls/crypt32/msg.c | 72 ++++++++++++++++++++++++++------------------------- 1 files changed, 37 insertions(+), 35 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index a7e43e4..9b9b843 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1278,8 +1278,8 @@ typedef struct _CDecodeMsg DWORD type; HCRYPTPROV crypt_prov; union { - HCRYPTHASH hash; - CRYPT_SIGNED_INFO *signedInfo; + HCRYPTHASH hash; + CSignedMsgData signed_data; } u; CRYPT_DATA_BLOB msg_data; PCONTEXT_PROPERTY_LIST properties; @@ -1298,7 +1298,8 @@ static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg) CryptDestroyHash(msg->u.hash); break; case CMSG_SIGNED: - LocalFree(msg->u.signedInfo); + if (msg->u.signed_data.info) + LocalFree(msg->u.signed_data.info); break; } CryptMemFree(msg->msg_data.pbData); @@ -1433,7 +1434,7 @@ static BOOL CDecodeMsg_DecodeSignedContent(CDecodeMsg *msg, CRYPT_DECODE_ALLOC_FLAG, NULL, (CRYPT_SIGNED_INFO *)&signedInfo, &size); if (ret) - msg->u.signedInfo = signedInfo; + msg->u.signed_data.info = signedInfo; return ret; } /* Decodes the content in blob as the type given, and updates the value @@ -1778,16 +1779,17 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, ret = CRYPT_CopyParam(pvData, pcbData, &msg->type, sizeof(msg->type)); break; case CMSG_CONTENT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) { - if (!strcmp(msg->u.signedInfo->content.pszObjId, szOID_RSA_data)) + if (!strcmp(msg->u.signed_data.info->content.pszObjId, + szOID_RSA_data)) { CRYPT_DATA_BLOB *blob; DWORD size; ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING, - msg->u.signedInfo->content.Content.pbData, - msg->u.signedInfo->content.Content.cbData, + msg->u.signed_data.info->content.Content.pbData, + msg->u.signed_data.info->content.Content.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, (LPBYTE)&blob, &size); if (ret) { @@ -1798,93 +1800,93 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, } else ret = CRYPT_CopyParam(pvData, pcbData, - msg->u.signedInfo->content.Content.pbData, - msg->u.signedInfo->content.Content.cbData); + msg->u.signed_data.info->content.Content.pbData, + msg->u.signed_data.info->content.Content.cbData); } else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_INNER_CONTENT_TYPE_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) ret = CRYPT_CopyParam(pvData, pcbData, - msg->u.signedInfo->content.pszObjId, - strlen(msg->u.signedInfo->content.pszObjId) + 1); + msg->u.signed_data.info->content.pszObjId, + strlen(msg->u.signed_data.info->content.pszObjId) + 1); else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_SIGNER_COUNT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) ret = CRYPT_CopyParam(pvData, pcbData, - &msg->u.signedInfo->cSignerInfo, sizeof(DWORD)); + &msg->u.signed_data.info->cSignerInfo, sizeof(DWORD)); else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_SIGNER_INFO_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) { - if (dwIndex >= msg->u.signedInfo->cSignerInfo) + if (dwIndex >= msg->u.signed_data.info->cSignerInfo) SetLastError(CRYPT_E_INVALID_INDEX); else ret = CRYPT_CopySignerInfo(pvData, pcbData, - &msg->u.signedInfo->rgSignerInfo[dwIndex]); + &msg->u.signed_data.info->rgSignerInfo[dwIndex]); } else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_SIGNER_CERT_INFO_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) { - if (dwIndex >= msg->u.signedInfo->cSignerInfo) + if (dwIndex >= msg->u.signed_data.info->cSignerInfo) SetLastError(CRYPT_E_INVALID_INDEX); else ret = CRYPT_CopySignerCertInfo(pvData, pcbData, - &msg->u.signedInfo->rgSignerInfo[dwIndex]); + &msg->u.signed_data.info->rgSignerInfo[dwIndex]); } else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_CERT_COUNT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) ret = CRYPT_CopyParam(pvData, pcbData, - &msg->u.signedInfo->cCertEncoded, sizeof(DWORD)); + &msg->u.signed_data.info->cCertEncoded, sizeof(DWORD)); else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_CERT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) { - if (dwIndex >= msg->u.signedInfo->cCertEncoded) + if (dwIndex >= msg->u.signed_data.info->cCertEncoded) SetLastError(CRYPT_E_INVALID_INDEX); else ret = CRYPT_CopyParam(pvData, pcbData, - msg->u.signedInfo->rgCertEncoded[dwIndex].pbData, - msg->u.signedInfo->rgCertEncoded[dwIndex].cbData); + msg->u.signed_data.info->rgCertEncoded[dwIndex].pbData, + msg->u.signed_data.info->rgCertEncoded[dwIndex].cbData); } else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_CRL_COUNT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) ret = CRYPT_CopyParam(pvData, pcbData, - &msg->u.signedInfo->cCrlEncoded, sizeof(DWORD)); + &msg->u.signed_data.info->cCrlEncoded, sizeof(DWORD)); else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_CRL_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) { - if (dwIndex >= msg->u.signedInfo->cCrlEncoded) + if (dwIndex >= msg->u.signed_data.info->cCrlEncoded) SetLastError(CRYPT_E_INVALID_INDEX); else ret = CRYPT_CopyParam(pvData, pcbData, - msg->u.signedInfo->rgCrlEncoded[dwIndex].pbData, - msg->u.signedInfo->rgCrlEncoded[dwIndex].cbData); + msg->u.signed_data.info->rgCrlEncoded[dwIndex].pbData, + msg->u.signed_data.info->rgCrlEncoded[dwIndex].cbData); } else SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_ATTR_CERT_COUNT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) { DWORD attrCertCount = 0; @@ -1895,7 +1897,7 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, SetLastError(CRYPT_E_INVALID_MSG_TYPE); break; case CMSG_ATTR_CERT_PARAM: - if (msg->u.signedInfo) + if (msg->u.signed_data.info) SetLastError(CRYPT_E_INVALID_INDEX); else SetLastError(CRYPT_E_INVALID_MSG_TYPE);
1
0
0
0
Juan Lang : crypt32: Make a signed message data type.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 7748905743a497ac5215f9289b555061406675d2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7748905743a497ac5215f9289…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:41:23 2007 -0700 crypt32: Make a signed message data type. --- dlls/crypt32/msg.c | 161 +++++++++++++++++++++++++++++---------------------- 1 files changed, 91 insertions(+), 70 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7748905743a497ac5215f…
1
0
0
0
Juan Lang : crypt32: Implement verifying the hash of a decoded hash message .
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 3e88838b606a93c67e92ee1a50e5b1d53a8df730 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3e88838b606a93c67e92ee1a5…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:40:25 2007 -0700 crypt32: Implement verifying the hash of a decoded hash message. --- dlls/crypt32/msg.c | 34 +++++++++++++++++++++++++++++++++- dlls/crypt32/tests/msg.c | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 036f2f7..516bc1b 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1926,6 +1926,38 @@ static BOOL CDecodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, return ret; } +static BOOL CDecodeHashMsg_VerifyHash(CDecodeMsg *msg) +{ + BOOL ret; + CRYPT_DATA_BLOB hashBlob; + + ret = ContextPropertyList_FindProperty(msg->properties, + CMSG_HASH_DATA_PARAM, &hashBlob); + if (ret) + { + DWORD computedHashSize = 0; + + ret = CDecodeHashMsg_GetParam(msg, CMSG_COMPUTED_HASH_PARAM, 0, NULL, + &computedHashSize); + if (hashBlob.cbData == computedHashSize) + { + LPBYTE computedHash = CryptMemAlloc(computedHashSize); + + if (computedHash) + { + ret = CDecodeHashMsg_GetParam(msg, CMSG_COMPUTED_HASH_PARAM, 0, + computedHash, &computedHashSize); + if (ret) + ret = !memcmp(hashBlob.pbData, computedHash, + hashBlob.cbData); + } + else + ret = FALSE; + } + } + return ret; +} + static BOOL CDecodeMsg_Control(HCRYPTMSG hCryptMsg, DWORD dwFlags, DWORD dwCtrlType, const void *pvCtrlPara) { @@ -1955,7 +1987,7 @@ static BOOL CDecodeMsg_Control(HCRYPTMSG hCryptMsg, DWORD dwFlags, switch (msg->type) { case CMSG_HASHED: - FIXME("CMSG_CTRL_VERIFY_HASH: stub\n"); + ret = CDecodeHashMsg_VerifyHash(msg); break; default: SetLastError(CRYPT_E_INVALID_MSG_TYPE); diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index b373470..72932fe 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2246,13 +2246,13 @@ static void test_msg_control(void) TRUE); /* Oddly enough, this fails */ ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_HASH, NULL); + todo_wine ok(!ret, "Expected failure\n"); CryptMsgClose(msg); msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_HASHED, 0, NULL, NULL); CryptMsgUpdate(msg, hashBareContent, sizeof(hashBareContent), TRUE); ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_HASH, NULL); - todo_wine ok(ret, "CryptMsgControl failed: %08x\n", GetLastError()); /* Can't decrypt an indeterminate-type message */ SetLastError(0xdeadbeef);
1
0
0
0
Juan Lang : crypt32: Add a couple tests that show you can' t get the hash from an encoded hash message, and fix encoded hash messages to match.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: e7ce5ae2bcca233dede16ccaa675036dcfd9b9e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7ce5ae2bcca233dede16ccaa…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:33:44 2007 -0700 crypt32: Add a couple tests that show you can't get the hash from an encoded hash message, and fix encoded hash messages to match. --- dlls/crypt32/msg.c | 2 +- dlls/crypt32/tests/msg.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 79c8f9b..036f2f7 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -464,7 +464,7 @@ static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, } break; default: - ret = FALSE; + SetLastError(CRYPT_E_INVALID_MSG_TYPE); } return ret; } diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index e705824..b373470 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -788,6 +788,11 @@ static void test_hash_msg_get_param(void) size = 0; ret = CryptMsgGetParam(msg, CMSG_BARE_CONTENT_PARAM, 0, NULL, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); + /* For an encoded hash message, the hash data aren't available */ + SetLastError(0xdeadbeef); + ret = CryptMsgGetParam(msg, CMSG_HASH_DATA_PARAM, 0, NULL, &size); + ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, + "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); /* The hash is also available. */ size = 0; ret = CryptMsgGetParam(msg, CMSG_COMPUTED_HASH_PARAM, 0, NULL, &size); @@ -801,6 +806,11 @@ static void test_hash_msg_get_param(void) ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ok(!ret && GetLastError() == NTE_BAD_HASH_STATE, "Expected NTE_BAD_HASH_STATE, got %x\n", GetLastError()); + /* Even after a final update, the hash data aren't available */ + SetLastError(0xdeadbeef); + ret = CryptMsgGetParam(msg, CMSG_HASH_DATA_PARAM, 0, NULL, &size); + ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, + "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); /* The version is also available, and should be zero for this message. */ size = 0; ret = CryptMsgGetParam(msg, CMSG_VERSION_PARAM, 0, NULL, &size);
1
0
0
0
Juan Lang : crypt32: Add a mostly stub control function for decode messages .
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 163e8d6256224fa4e6bc65a3f7ddc434b97bfdf8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=163e8d6256224fa4e6bc65a3f…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:33:04 2007 -0700 crypt32: Add a mostly stub control function for decode messages. --- dlls/crypt32/msg.c | 43 ++++++++++++++++++++++++++++++++++++++++++- dlls/crypt32/tests/msg.c | 8 -------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 02377b6..79c8f9b 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1926,6 +1926,47 @@ static BOOL CDecodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, return ret; } +static BOOL CDecodeMsg_Control(HCRYPTMSG hCryptMsg, DWORD dwFlags, + DWORD dwCtrlType, const void *pvCtrlPara) +{ + CDecodeMsg *msg = (CDecodeMsg *)hCryptMsg; + BOOL ret = FALSE; + + switch (dwCtrlType) + { + case CMSG_CTRL_VERIFY_SIGNATURE: + switch (msg->type) + { + case CMSG_SIGNED: + FIXME("CMSG_CTRL_VERIFY_SIGNATURE: stub\n"); + break; + default: + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + } + break; + case CMSG_CTRL_DECRYPT: + switch (msg->type) + { + default: + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + } + break; + case CMSG_CTRL_VERIFY_HASH: + switch (msg->type) + { + case CMSG_HASHED: + FIXME("CMSG_CTRL_VERIFY_HASH: stub\n"); + break; + default: + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + } + break; + default: + SetLastError(CRYPT_E_CONTROL_TYPE); + } + return ret; +} + HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo) @@ -1945,7 +1986,7 @@ HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, { CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo, CDecodeMsg_Close, CDecodeMsg_GetParam, CDecodeMsg_Update, - CRYPT_DefaultMsgControl); + CDecodeMsg_Control); msg->type = dwMsgType; if (hCryptProv) msg->crypt_prov = hCryptProv; diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 729aee6..e705824 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2197,18 +2197,15 @@ static void test_msg_control(void) /* Bad control type */ SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, 0, NULL); - todo_wine ok(!ret && GetLastError() == CRYPT_E_CONTROL_TYPE, "Expected CRYPT_E_CONTROL_TYPE, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 1, 0, NULL); - todo_wine ok(!ret && GetLastError() == CRYPT_E_CONTROL_TYPE, "Expected CRYPT_E_CONTROL_TYPE, got %08x\n", GetLastError()); /* Can't verify the hash of an indeterminate-type message */ SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_HASH, NULL); - todo_wine ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); /* Crashes @@ -2216,7 +2213,6 @@ static void test_msg_control(void) */ /* Can't decrypt an indeterminate-type message */ ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); - todo_wine ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); CryptMsgClose(msg); @@ -2234,7 +2230,6 @@ static void test_msg_control(void) */ /* Can't verify the signature of a hash message */ ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_SIGNATURE, &certInfo); - todo_wine ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); CryptMsgUpdate(msg, hashEmptyBareContent, sizeof(hashEmptyBareContent), @@ -2252,7 +2247,6 @@ static void test_msg_control(void) /* Can't decrypt an indeterminate-type message */ SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); - todo_wine ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); CryptMsgClose(msg); @@ -2262,13 +2256,11 @@ static void test_msg_control(void) /* Can't verify the hash of a signed message */ SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_HASH, NULL); - todo_wine ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); /* Can't decrypt a signed message */ SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); - todo_wine ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); /* Crash
1
0
0
0
Juan Lang : crypt32: Add a default message control function pointer.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: 31c414f4b483c424dbf7244ad3dca08651b2a667 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31c414f4b483c424dbf7244ad…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:27:06 2007 -0700 crypt32: Add a default message control function pointer. --- dlls/crypt32/msg.c | 33 ++++++++++++++++++++++++++------- dlls/crypt32/tests/msg.c | 8 +------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index a68bf52..02377b6 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -38,6 +38,17 @@ typedef BOOL (*CryptMsgGetParamFunc)(HCRYPTMSG hCryptMsg, DWORD dwParamType, typedef BOOL (*CryptMsgUpdateFunc)(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal); +typedef BOOL (*CryptMsgControlFunc)(HCRYPTMSG hCryptMsg, DWORD dwFlags, + DWORD dwCtrlType, const void *pvCtrlPara); + +BOOL CRYPT_DefaultMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags, + DWORD dwCtrlType, const void *pvCtrlPara) +{ + TRACE("(%p, %08x, %d, %p)\n", hCryptMsg, dwFlags, dwCtrlType, pvCtrlPara); + SetLastError(E_INVALIDARG); + return FALSE; +} + typedef enum _CryptMsgState { MsgStateInit, MsgStateUpdated, @@ -54,11 +65,13 @@ typedef struct _CryptMsgBase CryptMsgCloseFunc close; CryptMsgUpdateFunc update; CryptMsgGetParamFunc get_param; + CryptMsgControlFunc control; } CryptMsgBase; static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, PCMSG_STREAM_INFO pStreamInfo, CryptMsgCloseFunc close, - CryptMsgGetParamFunc get_param, CryptMsgUpdateFunc update) + CryptMsgGetParamFunc get_param, CryptMsgUpdateFunc update, + CryptMsgControlFunc control) { msg->ref = 1; msg->open_flags = dwFlags; @@ -75,6 +88,7 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, msg->close = close; msg->get_param = get_param; msg->update = update; + msg->control = control; msg->state = MsgStateInit; } @@ -313,7 +327,8 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, if (msg) { CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo, - CDataEncodeMsg_Close, CDataEncodeMsg_GetParam, CDataEncodeMsg_Update); + CDataEncodeMsg_Close, CDataEncodeMsg_GetParam, CDataEncodeMsg_Update, + CRYPT_DefaultMsgControl); msg->bare_content_len = sizeof(empty_data_content); msg->bare_content = (LPBYTE)empty_data_content; } @@ -522,7 +537,8 @@ static HCRYPTMSG CHashEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, if (msg) { CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo, - CHashEncodeMsg_Close, CHashEncodeMsg_GetParam, CHashEncodeMsg_Update); + CHashEncodeMsg_Close, CHashEncodeMsg_GetParam, CHashEncodeMsg_Update, + CRYPT_DefaultMsgControl); msg->prov = prov; msg->data.cbData = 0; msg->data.pbData = NULL; @@ -1132,7 +1148,7 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags, CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo, CSignedEncodeMsg_Close, CSignedEncodeMsg_GetParam, - CSignedEncodeMsg_Update); + CSignedEncodeMsg_Update, CRYPT_DefaultMsgControl); msg->data.cbData = 0; msg->data.pbData = NULL; memset(&msg->info, 0, sizeof(msg->info)); @@ -1928,7 +1944,8 @@ HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, if (msg) { CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo, - CDecodeMsg_Close, CDecodeMsg_GetParam, CDecodeMsg_Update); + CDecodeMsg_Close, CDecodeMsg_GetParam, CDecodeMsg_Update, + CRYPT_DefaultMsgControl); msg->type = dwMsgType; if (hCryptProv) msg->crypt_prov = hCryptProv; @@ -2010,7 +2027,9 @@ BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, BOOL WINAPI CryptMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags, DWORD dwCtrlType, const void *pvCtrlPara) { - FIXME("(%p, %08x, %d, %p): stub\n", hCryptMsg, dwFlags, dwCtrlType, + CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg; + + TRACE("(%p, %08x, %d, %p)\n", hCryptMsg, dwFlags, dwCtrlType, pvCtrlPara); - return TRUE; + return msg->control(hCryptMsg, dwFlags, dwCtrlType, pvCtrlPara); } diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 66b4eca..729aee6 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2132,7 +2132,6 @@ static void test_msg_control(void) { SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, i, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } @@ -2141,7 +2140,6 @@ static void test_msg_control(void) { SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, i, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } @@ -2157,7 +2155,6 @@ static void test_msg_control(void) { SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, i, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } @@ -2167,7 +2164,6 @@ static void test_msg_control(void) { SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, i, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } @@ -2182,7 +2178,6 @@ static void test_msg_control(void) { SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, i, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } @@ -2192,7 +2187,6 @@ static void test_msg_control(void) { SetLastError(0xdeadbeef); ret = CryptMsgControl(msg, 0, i, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } @@ -2247,13 +2241,13 @@ static void test_msg_control(void) TRUE); /* Oddly enough, this fails */ ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_HASH, NULL); - todo_wine ok(!ret, "Expected failure\n"); CryptMsgClose(msg); msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_HASHED, 0, NULL, NULL); CryptMsgUpdate(msg, hashBareContent, sizeof(hashBareContent), TRUE); ret = CryptMsgControl(msg, 0, CMSG_CTRL_VERIFY_HASH, NULL); + todo_wine ok(ret, "CryptMsgControl failed: %08x\n", GetLastError()); /* Can't decrypt an indeterminate-type message */ SetLastError(0xdeadbeef);
1
0
0
0
Juan Lang : crypt32: Add tests for CryptMsgControl.
by Alexandre Julliard
21 Aug '07
21 Aug '07
Module: wine Branch: master Commit: cc8948fefab090237fb83eabbe324d9f74b2a734 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cc8948fefab090237fb83eabb…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Aug 20 17:26:39 2007 -0700 crypt32: Add tests for CryptMsgControl. --- dlls/crypt32/tests/msg.c | 248 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 248 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=cc8948fefab090237fb83…
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
109
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200