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
July 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
957 discussions
Start a n
N
ew thread
Juan Lang : crypt32: Test and implement encoding signed messages with authenticated attributes.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: d5a478edfa98164665d83ba6989aca499910752f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5a478edfa98164665d83ba69…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:15:16 2007 -0700 crypt32: Test and implement encoding signed messages with authenticated attributes. --- dlls/crypt32/msg.c | 155 ++++++++++++++++++++++++++++++++++++++++----- dlls/crypt32/tests/msg.c | 37 +++++++++++ 2 files changed, 174 insertions(+), 18 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=d5a478edfa98164665d83…
1
0
0
0
Evan Stade : gdiplus/tests: Added GdipAddPathEllipse test.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: e11f7b7bbd5a134bb4077078bbca1ae00c53a9b9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e11f7b7bbd5a134bb4077078b…
Author: Evan Stade <estade(a)gmail.com> Date: Wed Jul 25 19:15:28 2007 -0700 gdiplus/tests: Added GdipAddPathEllipse test. --- dlls/gdiplus/tests/graphicspath.c | 72 +++++++++++++++++++++++++++++++++++++ 1 files changed, 72 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 729971e..3078980 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -433,6 +433,77 @@ static void test_pathpath(void) GdipDeletePath(path2); } +static path_test_t ellipse_path[] = { + {30.00, 125.25, PathPointTypeStart, 0, 0}, /*0*/ + {30.00, 139.20, PathPointTypeBezier, 0, 0}, /*1*/ + {25.52, 150.50, PathPointTypeBezier, 0, 0}, /*2*/ + {20.00, 150.50, PathPointTypeBezier, 0, 0}, /*3*/ + {14.48, 150.50, PathPointTypeBezier, 0, 0}, /*4*/ + {10.00, 139.20, PathPointTypeBezier, 0, 0}, /*5*/ + {10.00, 125.25, PathPointTypeBezier, 0, 0}, /*6*/ + {10.00, 111.30, PathPointTypeBezier, 0, 0}, /*7*/ + {14.48, 100.00, PathPointTypeBezier, 0, 0}, /*8*/ + {20.00, 100.00, PathPointTypeBezier, 0, 0}, /*9*/ + {25.52, 100.00, PathPointTypeBezier, 0, 0}, /*10*/ + {30.00, 111.30, PathPointTypeBezier, 0, 0}, /*11*/ + {30.00, 125.25, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 0}, /*12*/ + {7.00, 11.00, PathPointTypeStart, 0, 0}, /*13*/ + {13.00, 17.00, PathPointTypeLine, 0, 1}, /*14*/ + {5.00, 195.00, PathPointTypeStart, 0, 1}, /*15*/ + {5.00, 192.24, PathPointTypeBezier, 0, 1}, /*16*/ + {6.12, 190.00, PathPointTypeBezier, 0, 1}, /*17*/ + {7.50, 190.00, PathPointTypeBezier, 0, 1}, /*18*/ + {8.88, 190.00, PathPointTypeBezier, 0, 1}, /*19*/ + {10.00, 192.24, PathPointTypeBezier, 0, 1}, /*20*/ + {10.00, 195.00, PathPointTypeBezier, 0, 1}, /*21*/ + {10.00, 197.76, PathPointTypeBezier, 0, 1}, /*22*/ + {8.88, 200.00, PathPointTypeBezier, 0, 1}, /*23*/ + {7.50, 200.00, PathPointTypeBezier, 0, 1}, /*24*/ + {6.12, 200.00, PathPointTypeBezier, 0, 1}, /*25*/ + {5.00, 197.76, PathPointTypeBezier, 0, 1}, /*26*/ + {5.00, 195.00, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 1}, /*27*/ + {10.00, 300.50, PathPointTypeStart, 0, 0}, /*28*/ + {10.00, 300.78, PathPointTypeBezier, 0, 0}, /*29*/ + {10.00, 301.00, PathPointTypeBezier, 0, 0}, /*30*/ + {10.00, 301.00, PathPointTypeBezier, 0, 0}, /*31*/ + {10.00, 301.00, PathPointTypeBezier, 0, 0}, /*32*/ + {10.00, 300.78, PathPointTypeBezier, 0, 0}, /*33*/ + {10.00, 300.50, PathPointTypeBezier, 0, 0}, /*34*/ + {10.00, 300.22, PathPointTypeBezier, 0, 0}, /*35*/ + {10.00, 300.00, PathPointTypeBezier, 0, 0}, /*36*/ + {10.00, 300.00, PathPointTypeBezier, 0, 0}, /*37*/ + {10.00, 300.00, PathPointTypeBezier, 0, 0}, /*38*/ + {10.00, 300.22, PathPointTypeBezier, 0, 0}, /*39*/ + {10.00, 300.50, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 0} /*40*/ + }; + +static void test_ellipse(void) +{ + GpStatus status; + GpPath *path; + GpPointF points[2]; + + points[0].X = 7.0; + points[0].Y = 11.0; + points[1].X = 13.0; + points[1].Y = 17.0; + + GdipCreatePath(FillModeAlternate, &path); + status = GdipAddPathEllipse(path, 10.0, 100.0, 20.0, 50.5); + expect(Ok, status); + GdipAddPathLine2(path, points, 2); + status = GdipAddPathEllipse(path, 10.0, 200.0, -5.0, -10.0); + todo_wine + expect(Ok, status); + GdipClosePathFigure(path); + status = GdipAddPathEllipse(path, 10.0, 300.0, 0.0, 1.0); + expect(Ok, status); + + ok_path(path, ellipse_path, sizeof(ellipse_path)/sizeof(path_test_t), TRUE); + + GdipDeletePath(path); +} + START_TEST(graphicspath) { struct GdiplusStartupInput gdiplusStartupInput; @@ -450,6 +521,7 @@ START_TEST(graphicspath) test_arc(); test_worldbounds(); test_pathpath(); + test_ellipse(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Juan Lang : crypt32: Trace a few more items when decoding.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: b8ab462100222dfeece36d123a4478469926f332 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8ab462100222dfeece36d123…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:14:25 2007 -0700 crypt32: Trace a few more items when decoding. --- dlls/crypt32/decode.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 52e207e..de4de4a 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -366,6 +366,8 @@ static BOOL CRYPT_AsnDecodeSequenceItems(DWORD dwCertEncodingType, items[i].size % sizeof(DWORD); ptr += 1 + nextItemLenBytes + nextItemLen; decoded += 1 + nextItemLenBytes + nextItemLen; + TRACE("item %d: decoded %d bytes\n", i, + 1 + nextItemLenBytes + nextItemLen); } else if (items[i].optional && GetLastError() == CRYPT_E_ASN1_BADTAG) @@ -381,6 +383,8 @@ static BOOL CRYPT_AsnDecodeSequenceItems(DWORD dwCertEncodingType, } else { + TRACE("item %d: decoded %d bytes\n", i, + 1 + nextItemLenBytes + nextItemLen); ptr += 1 + nextItemLenBytes + nextItemLen; decoded += 1 + nextItemLenBytes + nextItemLen; items[i].size = items[i].minSize; @@ -393,8 +397,8 @@ static BOOL CRYPT_AsnDecodeSequenceItems(DWORD dwCertEncodingType, } else { - TRACE("tag %02x doesn't match expected %02x\n", - ptr[0], items[i].tag); + TRACE("item %d: tag %02x doesn't match expected %02x\n", + i, ptr[0], items[i].tag); SetLastError(CRYPT_E_ASN1_BADTAG); ret = FALSE; }
1
0
0
0
Juan Lang : crypt32: Partially implement decoding of signed messages.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: 3a85fa6b15abe69c6a4a974689a571df41763ea5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a85fa6b15abe69c6a4a97468…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:12:16 2007 -0700 crypt32: Partially implement decoding of signed messages. --- dlls/crypt32/crypt32_private.h | 4 +++ dlls/crypt32/decode.c | 56 ++++++++++++++++++++++++++++++++++++++++ dlls/crypt32/msg.c | 22 +++++++++++++++- 3 files changed, 81 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 9b1fc27..14f081f 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -99,6 +99,10 @@ typedef struct _CRYPT_SIGNED_INFO BOOL CRYPT_AsnEncodePKCSSignedInfo(CRYPT_SIGNED_INFO *, void *pvData, DWORD *pcbData); +BOOL CRYPT_AsnDecodePKCSSignedInfo(const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, + CRYPT_SIGNED_INFO *signedInfo, DWORD *pcbSignedInfo); + /* Helper function to check *pcbEncoded, set it to the required size, and * optionally to allocate memory. Assumes pbEncoded is not NULL. * If CRYPT_ENCODE_ALLOC_FLAG is set in dwFlags, *pbEncoded will be set to a diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index f66ae85..29e1a2d 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -3841,6 +3841,62 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSSignerInfo(DWORD dwCertEncodingType, return ret; } +static BOOL WINAPI CRYPT_DecodeSignerArray(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + struct AsnArrayDescriptor arrayDesc = { ASN_CONSTRUCTOR | ASN_SETOF, + CRYPT_AsnDecodePKCSSignerInfo, sizeof(CMSG_SIGNER_INFO), TRUE, + offsetof(CMSG_SIGNER_INFO, Issuer.pbData) }; + struct GenericArray *array = (struct GenericArray *)pvStructInfo; + + TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo, array ? array->rgItems : NULL); + return ret; +} + +BOOL CRYPT_AsnDecodePKCSSignedInfo(const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, + CRYPT_SIGNED_INFO *signedInfo, DWORD *pcbSignedInfo) +{ + BOOL ret = FALSE; + struct AsnDecodeSequenceItem items[] = { + { ASN_INTEGER, offsetof(CRYPT_SIGNED_INFO, version), CRYPT_AsnDecodeInt, + sizeof(DWORD), FALSE, FALSE, 0, 0 }, + /* Placeholder for the hash algorithms - redundant with those in the + * signers, so just ignore them. + */ + { ASN_CONSTRUCTOR | ASN_SETOF, 0, NULL, 0, TRUE, FALSE, 0, 0 }, + { ASN_SEQUENCE, offsetof(CRYPT_SIGNED_INFO, content), + CRYPT_AsnDecodePKCSContentInfoInternal, sizeof(CRYPT_CONTENT_INFO), + FALSE, TRUE, offsetof(CRYPT_SIGNED_INFO, content.pszObjId), 0 }, + { ASN_CONSTRUCTOR | ASN_CONTEXT | 0, + offsetof(CRYPT_SIGNED_INFO, cCertEncoded), + CRYPT_DecodeDERArray, sizeof(struct GenericArray), TRUE, TRUE, + offsetof(CRYPT_SIGNED_INFO, rgCertEncoded), 0 }, + { ASN_CONSTRUCTOR | ASN_CONTEXT | 1, + offsetof(CRYPT_SIGNED_INFO, cCrlEncoded), CRYPT_DecodeDERArray, + sizeof(struct GenericArray), TRUE, TRUE, + offsetof(CRYPT_SIGNED_INFO, rgCrlEncoded), 0 }, + { ASN_CONSTRUCTOR | ASN_SETOF, offsetof(CRYPT_SIGNED_INFO, cSignerInfo), + CRYPT_DecodeSignerArray, sizeof(struct GenericArray), TRUE, TRUE, + offsetof(CRYPT_SIGNED_INFO, rgSignerInfo), 0 }, + }; + + TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, signedInfo, *pcbSignedInfo); + + ret = CRYPT_AsnDecodeSequence(X509_ASN_ENCODING, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + pDecodePara, signedInfo, pcbSignedInfo, NULL); + TRACE("returning %d\n", ret); + return ret; +} + BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index a842286..7ccfb53 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1253,6 +1253,23 @@ static BOOL CDecodeMsg_DecodeHashedContent(CDecodeMsg *msg, return ret; } +static BOOL CDecodeMsg_DecodeSignedContent(CDecodeMsg *msg, + CRYPT_DER_BLOB *blob) +{ + BOOL ret; + CRYPT_SIGNED_INFO *signedInfo; + DWORD size; + + ret = CRYPT_AsnDecodePKCSSignedInfo(blob->pbData, blob->cbData, + CRYPT_DECODE_ALLOC_FLAG, NULL, (CRYPT_SIGNED_INFO *)&signedInfo, + &size); + if (ret) + { + FIXME("store properties in message\n"); + LocalFree(signedInfo); + } + return ret; +} /* Decodes the content in blob as the type given, and updates the value * (type, parameters, etc.) of msg based on what blob contains. * It doesn't just use msg's type, to allow a recursive call from an implicitly @@ -1274,10 +1291,13 @@ static BOOL CDecodeMsg_DecodeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob, msg->type = CMSG_HASHED; break; case CMSG_ENVELOPED: - case CMSG_SIGNED: FIXME("unimplemented for type %s\n", MSG_TYPE_STR(type)); ret = TRUE; break; + case CMSG_SIGNED: + if ((ret = CDecodeMsg_DecodeSignedContent(msg, blob))) + msg->type = CMSG_HASHED; + break; default: { CRYPT_CONTENT_INFO *info;
1
0
0
0
Juan Lang : crypt32: Don't check tag in CRYPT_DecodeDERArray, caller already does.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: 5674ca2e4e80f30930170fd614c8441088b63ed8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5674ca2e4e80f30930170fd61…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:11:31 2007 -0700 crypt32: Don't check tag in CRYPT_DecodeDERArray, caller already does. --- dlls/crypt32/decode.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 7281b15..f66ae85 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -1847,9 +1847,8 @@ static BOOL WINAPI CRYPT_DecodeDERArray(DWORD dwCertEncodingType, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { BOOL ret; - struct AsnArrayDescriptor arrayDesc = { ASN_CONSTRUCTOR | ASN_SETOF, - CRYPT_AsnDecodeCopyBytes, sizeof(CRYPT_DER_BLOB), TRUE, - offsetof(CRYPT_DER_BLOB, pbData) }; + struct AsnArrayDescriptor arrayDesc = { 0, CRYPT_AsnDecodeCopyBytes, + sizeof(CRYPT_DER_BLOB), TRUE, offsetof(CRYPT_DER_BLOB, pbData) }; struct GenericArray *array = (struct GenericArray *)pvStructInfo; TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags,
1
0
0
0
Juan Lang : crypt32: Actually skip content when skipping an item in a sequence.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: 30346ee2969125a61460c0ef941311c466343df3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=30346ee2969125a61460c0ef9…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:10:40 2007 -0700 crypt32: Actually skip content when skipping an item in a sequence. --- dlls/crypt32/decode.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 8a062ce..7281b15 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -381,6 +381,7 @@ static BOOL CRYPT_AsnDecodeSequenceItems(DWORD dwCertEncodingType, } else { + ptr += 1 + nextItemLenBytes + nextItemLen; decoded += 1 + nextItemLenBytes + nextItemLen; items[i].size = items[i].minSize; }
1
0
0
0
Juan Lang : crypt32: Test and fix encoding and decoding of attributes in PKCS signers.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: c58cb379ebf5875ca241b609765554a9099e0e85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c58cb379ebf5875ca241b6097…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:13:45 2007 -0700 crypt32: Test and fix encoding and decoding of attributes in PKCS signers. --- dlls/crypt32/decode.c | 27 ++++++++++++-------- dlls/crypt32/encode.c | 30 +++++++++++++++-------- dlls/crypt32/tests/encode.c | 55 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 21 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 29e1a2d..52e207e 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -1896,9 +1896,8 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSAttributesInternal( DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - struct AsnArrayDescriptor arrayDesc = { ASN_CONSTRUCTOR | ASN_SETOF, - CRYPT_AsnDecodePKCSAttribute, sizeof(CRYPT_ATTRIBUTE), TRUE, - offsetof(CRYPT_ATTRIBUTE, pszObjId) }; + struct AsnArrayDescriptor arrayDesc = { 0, CRYPT_AsnDecodePKCSAttribute, + sizeof(CRYPT_ATTRIBUTE), TRUE, offsetof(CRYPT_ATTRIBUTE, pszObjId) }; PCRYPT_ATTRIBUTES attrs = (PCRYPT_ATTRIBUTES)pvStructInfo; BOOL ret; @@ -1921,8 +1920,12 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSAttributes(DWORD dwCertEncodingType, { DWORD bytesNeeded; - if ((ret = CRYPT_AsnDecodePKCSAttributesInternal(dwCertEncodingType, - lpszStructType, pbEncoded, cbEncoded, + if (!cbEncoded) + SetLastError(CRYPT_E_ASN1_EOD); + else if (pbEncoded[0] != (ASN_CONSTRUCTOR | ASN_SETOF)) + SetLastError(CRYPT_E_ASN1_CORRUPT); + else if ((ret = CRYPT_AsnDecodePKCSAttributesInternal( + dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, NULL, &bytesNeeded))) { if (!pvStructInfo) @@ -3813,19 +3816,21 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSSignerInfo(DWORD dwCertEncodingType, { ASN_SEQUENCEOF, offsetof(CMSG_SIGNER_INFO, HashAlgorithm), CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), FALSE, TRUE, offsetof(CMSG_SIGNER_INFO, HashAlgorithm.pszObjId), 0 }, + { ASN_CONSTRUCTOR | ASN_CONTEXT | 0, + offsetof(CMSG_SIGNER_INFO, AuthAttrs), + CRYPT_AsnDecodePKCSAttributesInternal, sizeof(CRYPT_ATTRIBUTES), + TRUE, TRUE, offsetof(CMSG_SIGNER_INFO, AuthAttrs.rgAttr), 0 }, { ASN_SEQUENCEOF, offsetof(CMSG_SIGNER_INFO, HashEncryptionAlgorithm), CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), FALSE, TRUE, offsetof(CMSG_SIGNER_INFO, HashEncryptionAlgorithm.pszObjId), 0 }, - { ASN_CONSTRUCTOR | ASN_SETOF, offsetof(CMSG_SIGNER_INFO, AuthAttrs), - CRYPT_AsnDecodePKCSAttributesInternal, sizeof(CRYPT_ATTRIBUTES), - TRUE, TRUE, offsetof(CMSG_SIGNER_INFO, AuthAttrs.rgAttr), 0 }, - { ASN_CONSTRUCTOR | ASN_SETOF, offsetof(CMSG_SIGNER_INFO, UnauthAttrs), - CRYPT_AsnDecodePKCSAttributesInternal, sizeof(CRYPT_ATTRIBUTES), - TRUE, TRUE, offsetof(CMSG_SIGNER_INFO, UnauthAttrs.rgAttr), 0 }, { ASN_OCTETSTRING, offsetof(CMSG_SIGNER_INFO, EncryptedHash), CRYPT_AsnDecodeOctetsInternal, sizeof(CRYPT_DER_BLOB), FALSE, TRUE, offsetof(CMSG_SIGNER_INFO, EncryptedHash.pbData), 0 }, + { ASN_CONSTRUCTOR | ASN_CONTEXT | 1, + offsetof(CMSG_SIGNER_INFO, UnauthAttrs), + CRYPT_AsnDecodePKCSAttributesInternal, sizeof(CRYPT_ATTRIBUTES), + TRUE, TRUE, offsetof(CMSG_SIGNER_INFO, UnauthAttrs.rgAttr), 0 }, }; ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index e6695cf..b653a0d 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -3201,26 +3201,36 @@ static BOOL WINAPI CRYPT_AsnEncodePKCSSignerInfo(DWORD dwCertEncodingType, { &info->Issuer, CRYPT_AsnEncodeIssuerSerialNumber, 0 }, { &info->HashAlgorithm, CRYPT_AsnEncodeAlgorithmIdWithNullParams, 0 }, - { &info->HashEncryptionAlgorithm, - CRYPT_AsnEncodeAlgorithmIdWithNullParams, 0 }, }; - DWORD cItem = 4; + struct AsnEncodeTagSwappedItem swapped[2] = { { 0 } }; + DWORD cItem = 3, cSwapped = 0; if (info->AuthAttrs.cAttr) { - items[cItem].pvStructInfo = &info->AuthAttrs; - items[cItem].encodeFunc = CRYPT_AsnEncodePKCSAttributes; + swapped[cSwapped].tag = ASN_CONTEXT | ASN_CONSTRUCTOR | 0; + swapped[cSwapped].pvStructInfo = &info->AuthAttrs; + swapped[cSwapped].encodeFunc = CRYPT_AsnEncodePKCSAttributes; + items[cItem].pvStructInfo = &swapped[cSwapped]; + items[cItem].encodeFunc = CRYPT_AsnEncodeSwapTag; + cSwapped++; cItem++; } + items[cItem].pvStructInfo = &info->HashEncryptionAlgorithm; + items[cItem].encodeFunc = CRYPT_AsnEncodeAlgorithmIdWithNullParams; + cItem++; + items[cItem].pvStructInfo = &info->EncryptedHash; + items[cItem].encodeFunc = CRYPT_AsnEncodeOctets; + cItem++; if (info->UnauthAttrs.cAttr) { - items[cItem].pvStructInfo = &info->UnauthAttrs; - items[cItem].encodeFunc = CRYPT_AsnEncodePKCSAttributes; + swapped[cSwapped].tag = ASN_CONTEXT | ASN_CONSTRUCTOR | 1; + swapped[cSwapped].pvStructInfo = &info->UnauthAttrs; + swapped[cSwapped].encodeFunc = CRYPT_AsnEncodePKCSAttributes; + items[cItem].pvStructInfo = &swapped[cSwapped]; + items[cItem].encodeFunc = CRYPT_AsnEncodeSwapTag; + cSwapped++; cItem++; } - items[cItem].pvStructInfo = &info->EncryptedHash; - items[cItem].encodeFunc = CRYPT_AsnEncodeOctets; - cItem++; ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem, dwFlags, pEncodePara, pbEncoded, pcbEncoded); } diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 8173a12..467619a 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -4924,6 +4924,14 @@ static const BYTE PKCSSignerWithHash[] = { 0x01,0x01,0x30,0x06,0x06,0x02,0x2a,0x03,0x05,0x00,0x30,0x06,0x06,0x02,0x2d, 0x06,0x05,0x00,0x04,0x10,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09, 0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }; +static const BYTE PKCSSignerWithAuthAttr[] = { +0x30,0x62,0x02,0x01,0x00,0x30,0x19,0x30,0x14,0x31,0x12,0x30,0x10,0x06,0x03, +0x55,0x04,0x03,0x13,0x09,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x02, +0x01,0x01,0x30,0x06,0x06,0x02,0x2a,0x03,0x05,0x00,0xa0,0x20,0x30,0x1e,0x06, +0x03,0x55,0x04,0x03,0x31,0x17,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55, +0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x30, +0x06,0x06,0x02,0x2d,0x06,0x05,0x00,0x04,0x10,0x00,0x01,0x02,0x03,0x04,0x05, +0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }; static void test_encodePKCSSignerInfo(DWORD dwEncoding) { @@ -4932,6 +4940,10 @@ static void test_encodePKCSSignerInfo(DWORD dwEncoding) LPBYTE buf = NULL; DWORD size = 0; CMSG_SIGNER_INFO info = { 0 }; + char oid_common_name[] = szOID_COMMON_NAME; + CRYPT_ATTR_BLOB commonName = { sizeof(encodedCommonName), + (LPBYTE)encodedCommonName }; + CRYPT_ATTRIBUTE attr = { oid_common_name, 1, &commonName }; SetLastError(0xdeadbeef); ret = CryptEncodeObjectEx(dwEncoding, PKCS7_SIGNER_INFO, &info, @@ -5053,6 +5065,29 @@ static void test_encodePKCSSignerInfo(DWORD dwEncoding) LocalFree(buf); } } + info.AuthAttrs.cAttr = 1; + info.AuthAttrs.rgAttr = &attr; + SetLastError(0xdeadbeef); + ret = CryptEncodeObjectEx(dwEncoding, PKCS7_SIGNER_INFO, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (!(dwEncoding & PKCS_7_ASN_ENCODING)) + ok(!ret && GetLastError() == E_INVALIDARG, + "Expected E_INVALIDARG, got %08x\n", GetLastError()); + else + { + ok(ret, "CryptEncodeObjectEx failed: %x\n", GetLastError()); + if (buf) + { + ok(size == sizeof(PKCSSignerWithAuthAttr), "Unexpected size %d\n", + size); + if (size == sizeof(PKCSSignerWithAuthAttr)) + ok(!memcmp(buf, PKCSSignerWithAuthAttr, size), + "Unexpected value\n"); + else + ok(0, "Unexpected value\n"); + LocalFree(buf); + } + } } static void test_decodePKCSSignerInfo(DWORD dwEncoding) @@ -5157,6 +5192,26 @@ static void test_decodePKCSSignerInfo(DWORD dwEncoding) "Unexpected value\n"); LocalFree(buf); } + ret = CryptDecodeObjectEx(dwEncoding, PKCS7_SIGNER_INFO, + PKCSSignerWithAuthAttr, sizeof(PKCSSignerWithAuthAttr), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + if (buf) + { + info = (CMSG_SIGNER_INFO *)buf; + ok(info->AuthAttrs.cAttr == 1, "Expected 1 attribute, got %d\n", + info->AuthAttrs.cAttr); + ok(!strcmp(info->AuthAttrs.rgAttr[0].pszObjId, szOID_COMMON_NAME), + "Expected %s, got %s\n", szOID_COMMON_NAME, + info->AuthAttrs.rgAttr[0].pszObjId); + ok(info->AuthAttrs.rgAttr[0].cValue == 1, "Expected 1 value, got %d\n", + info->AuthAttrs.rgAttr[0].cValue); + ok(info->AuthAttrs.rgAttr[0].rgValue[0].cbData == + sizeof(encodedCommonName), "Unexpected size %d\n", + info->AuthAttrs.rgAttr[0].rgValue[0].cbData); + ok(!memcmp(info->AuthAttrs.rgAttr[0].rgValue[0].pbData, + encodedCommonName, sizeof(encodedCommonName)), "Unexpected value\n"); + LocalFree(buf); + } } /* Free *pInfo with HeapFree */
1
0
0
0
Juan Lang : crypt32: Add initial tests for decoding signed messages.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: e0b13a20b5680e797072efd3033a7e10ed32c78d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e0b13a20b5680e797072efd30…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:09:37 2007 -0700 crypt32: Add initial tests for decoding signed messages. --- dlls/crypt32/tests/msg.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index f65c7f8..ad4113a 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -1843,6 +1843,24 @@ static void test_decode_msg_update(void) ret = CryptMsgUpdate(msg, bogusHashContent, sizeof(bogusHashContent), TRUE); ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); CryptMsgClose(msg); + + msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL); + ret = CryptMsgUpdate(msg, signedContent, sizeof(signedContent), TRUE); + ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); + CryptMsgClose(msg); + msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL); + SetLastError(0xdeadbeef); + ret = CryptMsgUpdate(msg, signedWithCertAndCrlBareContent, + sizeof(signedWithCertAndCrlBareContent), TRUE); + ok(!ret && GetLastError() == CRYPT_E_ASN1_BADTAG, + "Expected CRYPT_E_ASN1_BADTAG, got %08x\n", GetLastError()); + CryptMsgClose(msg); + msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_SIGNED, 0, NULL, + NULL); + ret = CryptMsgUpdate(msg, signedWithCertAndCrlBareContent, + sizeof(signedWithCertAndCrlBareContent), TRUE); + ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); + CryptMsgClose(msg); } static const BYTE hashParam[] = { 0x08,0xd6,0xc0,0x5a,0x21,0x51,0x2a,0x79,0xa1,
1
0
0
0
Juan Lang : crypt32: Remove redundant assignment.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: 429e5b300fe88b34f733fad758832ed253ee2e9d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=429e5b300fe88b34f733fad75…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jul 25 18:10:12 2007 -0700 crypt32: Remove redundant assignment. --- dlls/crypt32/msg.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index ba75cb6..a842286 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1231,7 +1231,6 @@ static BOOL CDecodeMsg_DecodeHashedContent(CDecodeMsg *msg, &size); if (ret) { - msg->type = CMSG_HASHED; ContextPropertyList_SetProperty(msg->properties, CMSG_VERSION_PARAM, (const BYTE *)&digestedData->version, sizeof(digestedData->version)); CDecodeMsg_SaveAlgorithmID(msg, CMSG_HASH_ALGORITHM_PARAM,
1
0
0
0
Misha Koshelev : urlmon/tests: Don't proceed with POST operation ( that will fail) if we run out of memory.
by Alexandre Julliard
26 Jul '07
26 Jul '07
Module: wine Branch: master Commit: c4f1adb7ccb8e6e4ba462712daee2bbacebae930 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4f1adb7ccb8e6e4ba462712d…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Thu Jul 26 00:03:25 2007 -0500 urlmon/tests: Don't proceed with POST operation (that will fail) if we run out of memory. --- dlls/urlmon/tests/protocol.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index a9d13d1..45ba841 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -159,6 +159,7 @@ static HRESULT WINAPI HttpNegotiate_BeginningTransaction(IHttpNegotiate2 *iface, addl_headers = CoTaskMemAlloc(sizeof(wszHeaders)); if (!addl_headers) { + http_post_test = FALSE; skip("Out of memory\n"); return E_OUTOFMEMORY; } @@ -504,18 +505,19 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB if (http_post_test) { - pbindinfo->dwBindVerb = BINDVERB_POST; - pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; /* Must be GMEM_FIXED, GMEM_MOVABLE does not work properly * with urlmon on native (Win98 and WinXP) */ pbindinfo->stgmedData.hGlobal = GlobalAlloc(GPTR, sizeof(szPostData)); if (!pbindinfo->stgmedData.hGlobal) { + http_post_test = FALSE; skip("Out of memory\n"); return E_OUTOFMEMORY; } lstrcpy((LPSTR)pbindinfo->stgmedData.hGlobal, szPostData); pbindinfo->cbstgmedData = sizeof(szPostData)-1; + pbindinfo->dwBindVerb = BINDVERB_POST; + pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; } return S_OK;
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
96
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
Results per page:
10
25
50
100
200