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
September 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
7 participants
787 discussions
Start a n
N
ew thread
Juan Lang : crypt32: Add policy flags definitions.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 8bc15e7b4a156316775744edbb79f7ea17e5381e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8bc15e7b4a156316775744edb…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Sep 10 16:09:56 2007 -0700 crypt32: Add policy flags definitions. --- include/wincrypt.h | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/include/wincrypt.h b/include/wincrypt.h index 890934c..e959384 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -813,6 +813,36 @@ typedef struct _CERT_CHAIN_POLICY_STATUS { #define CERT_CHAIN_POLICY_NT_AUTH ((LPCSTR)6) #define CERT_CHAIN_POLICY_MICROSOFT_ROOT ((LPCSTR)7) +#define CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG 0x00000001 +#define CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG 0x00000002 +#define CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG 0x00000004 +#define CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG 0x00000008 + +#define CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS ( \ + CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG \ + CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG \ + CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG ) + +#define CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG 0x00000010 +#define CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG 0x00000020 +#define CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG 0x00000040 +#define CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG 0x00000080 + +#define CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG 0x00000100 +#define CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG 0x00000200 +#define CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG 0x00000400 +#define CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG 0x00000800 + +#define CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS ( \ + CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG \ + CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG \ + CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG \ + CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG ) + +#define CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG 0x00004000 +#define CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG 0x00008000 +#define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000 + typedef struct _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA { DWORD cbSize; DWORD dwRegPolicySettings;
1
0
0
0
Juan Lang : crypt32: Support CRYPT_DECODE_TO_BE_SIGNED_FLAG.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: d7115ce33c7ffb393cd6853010dd8e63ba2db88a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7115ce33c7ffb393cd685301…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Sep 10 16:02:52 2007 -0700 crypt32: Support CRYPT_DECODE_TO_BE_SIGNED_FLAG. --- dlls/crypt32/decode.c | 62 ++++++++++++++++++++++++++---------------------- 1 files changed, 34 insertions(+), 28 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 723873a..7349f5e 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -893,28 +893,32 @@ static BOOL WINAPI CRYPT_AsnDecodeCert(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - BOOL ret = TRUE; + BOOL ret = FALSE; TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags, pDecodePara, pvStructInfo, *pcbStructInfo); __TRY { - PCERT_SIGNED_CONTENT_INFO signedCert = NULL; DWORD size = 0; - /* First try to decode it as a signed cert. */ - ret = CRYPT_AsnDecodeCertSignedContent(dwCertEncodingType, X509_CERT, - pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, - (BYTE *)&signedCert, &size); - if (ret) + /* Unless told not to, first try to decode it as a signed cert. */ + if (!(dwFlags & CRYPT_DECODE_TO_BE_SIGNED_FLAG)) { - size = 0; - ret = CRYPT_AsnDecodeCertInfo(dwCertEncodingType, - X509_CERT_TO_BE_SIGNED, signedCert->ToBeSigned.pbData, - signedCert->ToBeSigned.cbData, dwFlags, pDecodePara, pvStructInfo, - pcbStructInfo); - LocalFree(signedCert); + PCERT_SIGNED_CONTENT_INFO signedCert = NULL; + + ret = CRYPT_AsnDecodeCertSignedContent(dwCertEncodingType, + X509_CERT, pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, + (BYTE *)&signedCert, &size); + if (ret) + { + size = 0; + ret = CRYPT_AsnDecodeCertInfo(dwCertEncodingType, + X509_CERT_TO_BE_SIGNED, signedCert->ToBeSigned.pbData, + signedCert->ToBeSigned.cbData, dwFlags, pDecodePara, + pvStructInfo, pcbStructInfo); + LocalFree(signedCert); + } } /* Failing that, try it as an unsigned cert */ if (!ret) @@ -928,7 +932,6 @@ static BOOL WINAPI CRYPT_AsnDecodeCert(DWORD dwCertEncodingType, __EXCEPT_PAGE_FAULT { SetLastError(STATUS_ACCESS_VIOLATION); - ret = FALSE; } __ENDTRY @@ -1026,28 +1029,32 @@ static BOOL WINAPI CRYPT_AsnDecodeCRL(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) { - BOOL ret = TRUE; + BOOL ret = FALSE; TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags, pDecodePara, pvStructInfo, *pcbStructInfo); __TRY { - PCERT_SIGNED_CONTENT_INFO signedCrl = NULL; DWORD size = 0; - /* First try to decode it as a signed crl. */ - ret = CRYPT_AsnDecodeCertSignedContent(dwCertEncodingType, X509_CERT, - pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, - (BYTE *)&signedCrl, &size); - if (ret) + /* Unless told not to, first try to decode it as a signed crl. */ + if (!(dwFlags & CRYPT_DECODE_TO_BE_SIGNED_FLAG)) { - size = 0; - ret = CRYPT_AsnDecodeCRLInfo(dwCertEncodingType, - X509_CERT_CRL_TO_BE_SIGNED, signedCrl->ToBeSigned.pbData, - signedCrl->ToBeSigned.cbData, dwFlags, pDecodePara, - pvStructInfo, pcbStructInfo); - LocalFree(signedCrl); + PCERT_SIGNED_CONTENT_INFO signedCrl = NULL; + + ret = CRYPT_AsnDecodeCertSignedContent(dwCertEncodingType, + X509_CERT, pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, + (BYTE *)&signedCrl, &size); + if (ret) + { + size = 0; + ret = CRYPT_AsnDecodeCRLInfo(dwCertEncodingType, + X509_CERT_CRL_TO_BE_SIGNED, signedCrl->ToBeSigned.pbData, + signedCrl->ToBeSigned.cbData, dwFlags, pDecodePara, + pvStructInfo, pcbStructInfo); + LocalFree(signedCrl); + } } /* Failing that, try it as an unsigned crl */ if (!ret) @@ -1061,7 +1068,6 @@ static BOOL WINAPI CRYPT_AsnDecodeCRL(DWORD dwCertEncodingType, __EXCEPT_PAGE_FAULT { SetLastError(STATUS_ACCESS_VIOLATION); - ret = FALSE; } __ENDTRY
1
0
0
0
Juan Lang : rsaenh: Support setting the effective key length of RC2 keys.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 41d057837cd7c22ba2db55690add4761865e0e24 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41d057837cd7c22ba2db55690…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Sep 10 15:05:24 2007 -0700 rsaenh: Support setting the effective key length of RC2 keys. --- dlls/rsaenh/implglue.c | 7 ++-- dlls/rsaenh/implglue.h | 4 +- dlls/rsaenh/rsaenh.c | 37 ++++++++++++++++++++++++- dlls/rsaenh/tests/rsaenh.c | 66 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+), 6 deletions(-) diff --git a/dlls/rsaenh/implglue.c b/dlls/rsaenh/implglue.c index 6953161..d31f615 100644 --- a/dlls/rsaenh/implglue.c +++ b/dlls/rsaenh/implglue.c @@ -166,8 +166,8 @@ BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext) return TRUE; } -BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwSaltLen, - BYTE *abKeyValue) +BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, + DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue) { switch (aiAlgid) { @@ -178,7 +178,8 @@ BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DW break; case CALG_RC2: - rc2_setup(abKeyValue, dwKeyLen + dwSaltLen, dwKeyLen << 3, 0, &pKeyContext->rc2); + rc2_setup(abKeyValue, dwKeyLen + dwSaltLen, dwEffectiveKeyLen ? + dwEffectiveKeyLen : dwKeyLen << 3, 0, &pKeyContext->rc2); break; case CALG_3DES: diff --git a/dlls/rsaenh/implglue.h b/dlls/rsaenh/implglue.h index 597ca1e..d421c3d 100644 --- a/dlls/rsaenh/implglue.h +++ b/dlls/rsaenh/implglue.h @@ -76,8 +76,8 @@ BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext, BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen); BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext); -BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwSaltLen, - BYTE *abKeyValue); +BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, + DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue); BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext, KEY_CONTEXT *pDestKeyContext); diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index ce15b4e..4002f27 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -93,6 +93,7 @@ typedef struct tagCRYPTKEY DWORD dwModeBits; DWORD dwPermissions; DWORD dwKeyLen; + DWORD dwEffectiveKeyLen; DWORD dwSaltLen; DWORD dwBlockLen; DWORD dwState; @@ -718,7 +719,8 @@ static inline void setup_key(CRYPTKEY *pCryptKey) { pCryptKey->dwState = RSAENH_KEYSTATE_IDLE; memcpy(pCryptKey->abChainVector, pCryptKey->abInitVector, sizeof(pCryptKey->abChainVector)); setup_key_impl(pCryptKey->aiAlgid, &pCryptKey->context, pCryptKey->dwKeyLen, - pCryptKey->dwSaltLen, pCryptKey->abKeyValue); + pCryptKey->dwEffectiveKeyLen, pCryptKey->dwSaltLen, + pCryptKey->abKeyValue); } /****************************************************************************** @@ -813,6 +815,7 @@ static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTK pCryptKey->dwPermissions = CRYPT_ENCRYPT | CRYPT_DECRYPT | CRYPT_READ | CRYPT_WRITE | CRYPT_MAC; pCryptKey->dwKeyLen = dwKeyLen >> 3; + pCryptKey->dwEffectiveKeyLen = 0; if ((dwFlags & CRYPT_CREATE_SALT) || (dwKeyLen == 40 && !(dwFlags & CRYPT_NO_SALT))) pCryptKey->dwSaltLen = 16 /*FIXME*/ - pCryptKey->dwKeyLen; else @@ -2710,6 +2713,31 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam setup_key(pCryptKey); return TRUE; + case KP_EFFECTIVE_KEYLEN: + switch (pCryptKey->aiAlgid) { + case CALG_RC2: + if (!pbData) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + else if (!*(DWORD *)pbData || *(DWORD *)pbData > 1024) + { + SetLastError(NTE_BAD_DATA); + return FALSE; + } + else + { + pCryptKey->dwEffectiveKeyLen = *(DWORD *)pbData; + setup_key(pCryptKey); + } + break; + default: + SetLastError(NTE_BAD_TYPE); + return FALSE; + } + return TRUE; + case KP_SCHANNEL_ALG: switch (((PSCHANNEL_ALG)pbData)->dwUse) { case SCHANNEL_ENC_KEY: @@ -2807,6 +2835,13 @@ BOOL WINAPI RSAENH_CPGetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam dwBitLen = pCryptKey->dwKeyLen << 3; return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwBitLen, sizeof(DWORD)); + case KP_EFFECTIVE_KEYLEN: + if (pCryptKey->dwEffectiveKeyLen) + dwBitLen = pCryptKey->dwEffectiveKeyLen; + else + dwBitLen = pCryptKey->dwKeyLen << 3; + return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwBitLen, sizeof(DWORD)); + case KP_BLOCKLEN: dwBitLen = pCryptKey->dwBlockLen << 3; return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwBitLen, sizeof(DWORD)); diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 2a397e7..163aa5e 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -498,6 +498,9 @@ static void test_rc2(void) static const BYTE rc2encrypted[16] = { 0x02, 0x34, 0x7d, 0xf6, 0x1d, 0xc5, 0x9b, 0x8b, 0x2e, 0x0d, 0x63, 0x80, 0x72, 0xc1, 0xc2, 0xb1 }; + static const BYTE rc2_128_encrypted[] = { + 0x82,0x81,0xf7,0xff,0xdd,0xd7,0x88,0x8c,0x2a,0x2a,0xc0,0xce,0x4c,0x89, + 0xb6,0x66 }; HCRYPTHASH hHash; HCRYPTKEY hKey; BOOL result; @@ -579,6 +582,69 @@ static void test_rc2(void) result = CryptDestroyKey(hKey); ok(result, "%08x\n", GetLastError()); } + + /* Again, but test setting the effective key len */ + for (i=0; i<2000; i++) pbData[i] = (unsigned char)i; + + result = CryptCreateHash(hProv, CALG_MD2, 0, 0, &hHash); + if (!result) { + ok(GetLastError()==NTE_BAD_ALGID, "%08x\n", GetLastError()); + } else { + result = CryptHashData(hHash, (BYTE*)pbData, sizeof(pbData), 0); + ok(result, "%08x\n", GetLastError()); + + dwLen = 16; + result = CryptGetHashParam(hHash, HP_HASHVAL, pbHashValue, &dwLen, 0); + ok(result, "%08x\n", GetLastError()); + + result = CryptDeriveKey(hProv, CALG_RC2, hHash, 56 << 16, &hKey); + ok(result, "%08x\n", GetLastError()); + + SetLastError(0xdeadbeef); + result = CryptSetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, NULL, 0); + ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "%08x\n", GetLastError()); + dwKeyLen = 0; + SetLastError(0xdeadbeef); + result = CryptSetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, (LPBYTE)&dwKeyLen, 0); + ok(!result && GetLastError()==NTE_BAD_DATA, "%08x\n", GetLastError()); + dwKeyLen = 1025; + SetLastError(0xdeadbeef); + result = CryptSetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, (LPBYTE)&dwKeyLen, 0); + + dwLen = sizeof(dwKeyLen); + CryptGetKeyParam(hKey, KP_KEYLEN, (BYTE *)&dwKeyLen, &dwLen, 0); + ok(dwKeyLen == 56, "%d (%08x)\n", dwKeyLen, GetLastError()); + CryptGetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, (BYTE *)&dwKeyLen, &dwLen, 0); + ok(dwKeyLen == 56, "%d (%08x)\n", dwKeyLen, GetLastError()); + + dwKeyLen = 128; + result = CryptSetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, (LPBYTE)&dwKeyLen, 0); + ok(result, "%d\n", GetLastError()); + + dwLen = sizeof(dwKeyLen); + CryptGetKeyParam(hKey, KP_KEYLEN, (BYTE *)&dwKeyLen, &dwLen, 0); + ok(dwKeyLen == 56, "%d (%08x)\n", dwKeyLen, GetLastError()); + CryptGetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, (BYTE *)&dwKeyLen, &dwLen, 0); + ok(dwKeyLen == 128, "%d (%08x)\n", dwKeyLen, GetLastError()); + + result = CryptDestroyHash(hHash); + ok(result, "%08x\n", GetLastError()); + + dwDataLen = 13; + result = CryptEncrypt(hKey, (HCRYPTHASH)NULL, TRUE, 0, pbData, &dwDataLen, 24); + ok(result, "%08x\n", GetLastError()); + + ok(!memcmp(pbData, rc2_128_encrypted, sizeof(rc2_128_encrypted)), + "RC2 encryption failed!\n"); + + /* Oddly enough this succeeds, though it should have no effect */ + dwKeyLen = 40; + result = CryptSetKeyParam(hKey, KP_EFFECTIVE_KEYLEN, (LPBYTE)&dwKeyLen, 0); + ok(result, "%d\n", GetLastError()); + + result = CryptDestroyKey(hKey); + ok(result, "%08x\n", GetLastError()); + } } static void test_rc4(void)
1
0
0
0
Juan Lang : rsaenh: Call setup_key whenever the IV is reset.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 5666efb1374bb0a1e7f9d92614f9c6956ac9eca3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5666efb1374bb0a1e7f9d9261…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Sep 10 15:04:58 2007 -0700 rsaenh: Call setup_key whenever the IV is reset. --- dlls/rsaenh/rsaenh.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index 84cceea..ce15b4e 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -2707,6 +2707,7 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam case KP_IV: memcpy(pCryptKey->abInitVector, pbData, pCryptKey->dwBlockLen); + setup_key(pCryptKey); return TRUE; case KP_SCHANNEL_ALG:
1
0
0
0
Juan Lang : rsaenh: Reorder padding code to avoid unnecessary comparison.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 16c40d91124547499a289df8efffba2e9d1effb5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16c40d91124547499a289df8e…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Sep 10 15:04:39 2007 -0700 rsaenh: Reorder padding code to avoid unnecessary comparison. --- dlls/rsaenh/rsaenh.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index 8a27e2c..84cceea 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -1907,16 +1907,16 @@ BOOL WINAPI RSAENH_CPEncrypt(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash, *pdwDataLen = dwEncryptedLen; return TRUE; } - - for (i=*pdwDataLen; i<dwEncryptedLen && i<dwBufLen; i++) pbData[i] = dwEncryptedLen - *pdwDataLen; - *pdwDataLen = dwEncryptedLen; - - if (*pdwDataLen > dwBufLen) - { + else if (dwEncryptedLen > dwBufLen) { + *pdwDataLen = dwEncryptedLen; SetLastError(ERROR_MORE_DATA); return FALSE; } - + + /* Pad final block with length bytes */ + for (i=*pdwDataLen; i<dwEncryptedLen; i++) pbData[i] = dwEncryptedLen - *pdwDataLen; + *pdwDataLen = dwEncryptedLen; + for (i=0, in=pbData; i<*pdwDataLen; i+=pCryptKey->dwBlockLen, in+=pCryptKey->dwBlockLen) { switch (pCryptKey->dwMode) { case CRYPT_MODE_ECB:
1
0
0
0
Detlef Riekenberg : localspl/tests: Tests for OpenPort and ClosePort.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 57dee443f533ca95ad64d073abe5013a044b33dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=57dee443f533ca95ad64d073a…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Mon Sep 10 15:03:27 2007 +0200 localspl/tests: Tests for OpenPort and ClosePort. --- dlls/localspl/tests/localmon.c | 278 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 277 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=57dee443f533ca95ad64d…
1
0
0
0
Detlef Riekenberg : localspl: Implement OpenPort and ClosePort.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: eff9c9ef0c1ba3007853ed10fdf87383b3c55bb1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eff9c9ef0c1ba3007853ed10f…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Mon Sep 10 15:02:58 2007 +0200 localspl: Implement OpenPort and ClosePort. --- dlls/localspl/localmon.c | 130 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 128 insertions(+), 2 deletions(-) diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c index aaf78a5..9e31684 100644 --- a/dlls/localspl/localmon.c +++ b/dlls/localspl/localmon.c @@ -42,6 +42,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(localspl); /*****************************************************/ +static CRITICAL_SECTION port_handles_cs; +static CRITICAL_SECTION_DEBUG port_handles_cs_debug = +{ + 0, 0, &port_handles_cs, + { &port_handles_cs_debug.ProcessLocksList, &port_handles_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": port_handles_cs") } +}; +static CRITICAL_SECTION port_handles_cs = { &port_handles_cs_debug, -1, 0, 0, 0, 0 }; + + static CRITICAL_SECTION xcv_handles_cs; static CRITICAL_SECTION_DEBUG xcv_handles_cs_debug = { @@ -55,10 +65,17 @@ static CRITICAL_SECTION xcv_handles_cs = { &xcv_handles_cs_debug, -1, 0, 0, 0, 0 typedef struct { struct list entry; + DWORD type; + WCHAR nameW[1]; +} port_t; + +typedef struct { + struct list entry; ACCESS_MASK GrantedAccess; WCHAR nameW[1]; } xcv_t; +static struct list port_handles = LIST_INIT( port_handles ); static struct list xcv_handles = LIST_INIT( xcv_handles ); /* ############################### */ @@ -299,6 +316,45 @@ static DWORD get_type_from_name(LPCWSTR name) return PORT_IS_UNKNOWN; } +/***************************************************** + * get_type_from_local_name (internal) + * + */ + +static DWORD get_type_from_local_name(LPCWSTR nameW) +{ + LPPORT_INFO_1W pi; + LPWSTR myname = NULL; + DWORD needed = 0; + DWORD numentries = 0; + DWORD id = 0; + + TRACE("(%s)\n", debugstr_w(myname)); + + needed = get_ports_from_reg(1, NULL, 0, &numentries); + pi = spl_alloc(needed); + if (pi) + needed = get_ports_from_reg(1, (LPBYTE) pi, needed, &numentries); + + if (pi && needed && numentries > 0) { + /* we got a number of valid ports. */ + + while ((myname == NULL) && (id < numentries)) + { + if (lstrcmpiW(nameW, pi[id].pName) == 0) { + TRACE("(%u) found %s\n", id, debugstr_w(pi[id].pName)); + myname = pi[id].pName; + } + id++; + } + } + + id = (myname) ? get_type_from_name(myname) : PORT_IS_UNKNOWN; + + spl_free(pi); + return id; + +} /****************************************************************************** * localmon_AddPortExW [exported through MONITOREX] * @@ -357,6 +413,31 @@ static BOOL WINAPI localmon_AddPortExW(LPWSTR pName, DWORD level, LPBYTE pBuffer } /***************************************************** + * localmon_ClosePort [exported through MONITOREX] + * + * Close a + * + * PARAMS + * hPort [i] The Handle to close + * + * RETURNS + * Success: TRUE + * Failure: FALSE + * + */ +static BOOL WINAPI localmon_ClosePort(HANDLE hPort) +{ + port_t * port = (port_t *) hPort; + + TRACE("(%p)\n", port); + EnterCriticalSection(&port_handles_cs); + list_remove(&port->entry); + LeaveCriticalSection(&port_handles_cs); + spl_free(port); + return TRUE; +} + +/***************************************************** * localmon_EnumPortsW [exported through MONITOREX] * * Enumerate all local Ports @@ -416,6 +497,51 @@ cleanup: } /***************************************************** + * localmon_OpenPort [exported through MONITOREX] + * + * Open a Data-Channel for a Port + * + * PARAMS + * pName [i] Name of selected Object + * phPort [o] The resulting Handle is stored here + * + * RETURNS + * Success: TRUE + * Failure: FALSE + * + */ +static BOOL WINAPI localmon_OpenPortW(LPWSTR pName, PHANDLE phPort) +{ + port_t * port; + DWORD len; + DWORD type; + + TRACE("%s, %p)\n", debugstr_w(pName), phPort); + + /* an empty name is invalid */ + if (!pName[0]) return FALSE; + + /* does the port exist? */ + type = get_type_from_local_name(pName); + if (!type) return FALSE; + + len = (lstrlenW(pName) + 1) * sizeof(WCHAR); + port = spl_alloc(sizeof(port_t) + len); + if (!port) return FALSE; + + port->type = type; + memcpy(&port->nameW, pName, len); + *phPort = (HANDLE) port; + + EnterCriticalSection(&port_handles_cs); + list_add_tail(&port_handles, &port->entry); + LeaveCriticalSection(&port_handles_cs); + + TRACE("=> %p\n", port); + return TRUE; +} + +/***************************************************** * localmon_XcvClosePort [exported through MONITOREX] * * Close a Communication-Channel @@ -658,13 +784,13 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot) sizeof(MONITOREX) - sizeof(DWORD), { localmon_EnumPortsW, - NULL, /* localmon_OpenPortW */ + localmon_OpenPortW, NULL, /* localmon_OpenPortExW */ NULL, /* localmon_StartDocPortW */ NULL, /* localmon_WritePortW */ NULL, /* localmon_ReadPortW */ NULL, /* localmon_EndDocPortW */ - NULL, /* localmon_ClosePortW */ + localmon_ClosePort, NULL, /* Use AddPortUI in localui.dll */ localmon_AddPortExW, NULL, /* Use ConfigurePortUI in localui.dll */
1
0
0
0
Vitaliy Margolen : dinput: When setting hooks ignore devices without even handler.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 278cc8e28da4549e3c470e8094f31f67e88e6ee7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=278cc8e28da4549e3c470e809…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Sep 9 23:14:27 2007 -0600 dinput: When setting hooks ignore devices without even handler. --- dlls/dinput/dinput_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 9562d78..15f3cda 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -921,7 +921,7 @@ static DWORD WINAPI hook_thread_proc(void *param) EnterCriticalSection( &dinput->crit ); LIST_FOR_EACH_ENTRY( dev, &dinput->devices_list, IDirectInputDevice2AImpl, entry ) { - if (!dev->acquired) continue; + if (!dev->acquired || !dev->event_proc) continue; if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ) || IsEqualGUID( &dev->guid, &DInput_Wine_Keyboard_GUID ))
1
0
0
0
Vitaliy Margolen : dinput: Add helper function to dump mouse state.
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 64ef4c4edfa6dd770ae6e9d4055f45e23f8e7e93 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64ef4c4edfa6dd770ae6e9d40…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Sep 9 23:14:23 2007 -0600 dinput: Add helper function to dump mouse state. --- dlls/dinput/mouse.c | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 4564673..8edfe0e 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -74,6 +74,17 @@ const GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */ 0x9e573ed8, 0x7734, 0x11d2, {0x8d, 0x4a, 0x23, 0x90, 0x3f, 0xb6, 0xbd, 0xf7} }; +void _dump_mouse_state(DIMOUSESTATE2 *m_state) +{ + int i; + + if (!TRACE_ON(dinput)) return; + + TRACE("(X: %d Y: %d Z: %d", m_state->lX, m_state->lY, m_state->lZ); + for (i = 0; i < 5; i++) TRACE(" B%d: %02x", i, m_state->rgbButtons[i]); + TRACE(")\n"); +} + static void fill_mouse_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version) { DWORD dwSize; DIDEVICEINSTANCEA ddi; @@ -259,6 +270,8 @@ static void dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARA DWORD dwCoop; int wdata = 0, inst_id = -1; + TRACE("msg %lx @ (%d %d)\n", wparam, hook->pt.x, hook->pt.y); + EnterCriticalSection(&This->base.crit); dwCoop = This->base.dwCoopLevel; @@ -334,18 +347,13 @@ static void dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARA break; } - if (TRACE_ON(dinput)) - { - int i; - TRACE("msg %lx @ (%d %d): (X: %d Y: %d Z: %d", wparam, hook->pt.x, hook->pt.y, - This->m_state.lX, This->m_state.lY, This->m_state.lZ); - for (i = 0; i < 5; i++) TRACE(" B%d: %02x", i, This->m_state.rgbButtons[i]); - TRACE(")\n"); - } if (inst_id != -1) + { + _dump_mouse_state(&This->m_state); queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id), wdata, hook->time, This->base.dinput->evsequence++); + } LeaveCriticalSection(&This->base.crit); } @@ -464,9 +472,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState( if(This->base.acquired == 0) return DIERR_NOTACQUIRED; TRACE("(this=%p,0x%08x,%p):\n", This, len, ptr); - TRACE("(X: %d - Y: %d - Z: %d L: %02x M: %02x R: %02x)\n", - This->m_state.lX, This->m_state.lY, This->m_state.lZ, - This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]); + _dump_mouse_state(&This->m_state); EnterCriticalSection(&This->base.crit); /* Copy the current mouse state */
1
0
0
0
Mikolaj Zalewski : faultrep: Implement AddERExcludedApplication[AW].
by Alexandre Julliard
11 Sep '07
11 Sep '07
Module: wine Branch: master Commit: 6af419c14b25fa0b4bbd8b659b6656d0b39a6274 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6af419c14b25fa0b4bbd8b659…
Author: Mikolaj Zalewski <mikolajz(a)google.com> Date: Fri Aug 31 18:10:13 2007 -0700 faultrep: Implement AddERExcludedApplication[AW]. --- dlls/faultrep/Makefile.in | 2 +- dlls/faultrep/faultrep.c | 77 +++++++++++++++++++++++++++++++++++++++++++ dlls/faultrep/faultrep.spec | 4 +- 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/dlls/faultrep/Makefile.in b/dlls/faultrep/Makefile.in index e6e04a2..f521178 100644 --- a/dlls/faultrep/Makefile.in +++ b/dlls/faultrep/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = faultrep.dll -IMPORTS = kernel32 +IMPORTS = advapi32 kernel32 C_SRCS = faultrep.c diff --git a/dlls/faultrep/faultrep.c b/dlls/faultrep/faultrep.c index 7771191..3a04754 100644 --- a/dlls/faultrep/faultrep.c +++ b/dlls/faultrep/faultrep.c @@ -21,10 +21,87 @@ #include "windef.h" #include "winbase.h" +#include "winnls.h" +#include "winreg.h" #include "wine/debug.h" +#include "wine/unicode.h" + +#include "errorrep.h" WINE_DEFAULT_DEBUG_CHANNEL(faultrep); +static const WCHAR SZ_EXCLUSIONLIST_KEY[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'P','C','H','e','a','l','t','h','\\', + 'E','r','r','o','r','R','e','p','o','r','t','i','n','g','\\', + 'E','x','c','l','u','s','i','o','n','L','i','s','t', 0}; + +/************************************************************************* + * AddERExcludedApplicationW [FAULTREP.@] + * + * Adds an application to a list of applications for which fault reports + * shouldn't be genereated + * + * PARAMS + * lpAppFileName [I] The filename of the application executable + * + * RETURNS + * TRUE on success, FALSE of failure + * + * NOTES + * Wine doesn't use this data but stores it in the registry (in the same place + * as Windows would) in case it will be useful in a future version + * + * According to MSDN this function should succeed even if the user have no write + * access to HKLM. This probably means that there is no error checking. + */ +BOOL WINAPI AddERExcludedApplicationW(LPCWSTR lpAppFileName) +{ + WCHAR *bslash; + DWORD value = 1; + HKEY hkey; + + TRACE("(%s)\n", wine_dbgstr_w(lpAppFileName)); + bslash = strrchrW(lpAppFileName, '\\'); + if (bslash != NULL) + lpAppFileName = bslash + 1; + if (*lpAppFileName == '\0') + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!RegCreateKeyW(HKEY_LOCAL_MACHINE, SZ_EXCLUSIONLIST_KEY, &hkey)) + { + RegSetValueExW(hkey, lpAppFileName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value)); + RegCloseKey(hkey); + } + + return TRUE; +} + +/************************************************************************* + * AddERExcludedApplicationA [FAULTREP.@] + * + * See AddERExcludedApplicationW + */ +BOOL WINAPI AddERExcludedApplicationA(LPCSTR lpAppFileName) +{ + int len = MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, NULL, 0); + WCHAR *wstr; + BOOL ret; + + TRACE("(%s)\n", wine_dbgstr_a(lpAppFileName)); + if (len == 0) + return FALSE; + wstr = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); + MultiByteToWideChar(CP_ACP, 0, lpAppFileName, -1, wstr, len); + ret = AddERExcludedApplicationW(wstr); + HeapFree(GetProcessHeap(), 0, wstr); + return ret; +} + /*********************************************************************** * DllMain. */ diff --git a/dlls/faultrep/faultrep.spec b/dlls/faultrep/faultrep.spec index 3cc9934..77a2827 100644 --- a/dlls/faultrep/faultrep.spec +++ b/dlls/faultrep/faultrep.spec @@ -1,5 +1,5 @@ -@ stub AddERExcludedApplicationA -@ stub AddERExcludedApplicationW +@ stdcall AddERExcludedApplicationA(str) +@ stdcall AddERExcludedApplicationW(wstr) @ stub CreateMinidumpA @ stub CreateMinidumpW @ stub ReportEREvent
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
79
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
Results per page:
10
25
50
100
200