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
December 2008
----- 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
2 participants
1225 discussions
Start a n
N
ew thread
Juan Lang : cryptui: Check for type mismatches in CryptUIWizImport.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: 23f789fb0816d26ea20dd3a110fe0d91e6ee5f16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23f789fb0816d26ea20dd3a11…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Dec 22 19:02:43 2008 -0800 cryptui: Check for type mismatches in CryptUIWizImport. --- dlls/cryptui/cryptui_En.rc | 2 + dlls/cryptui/cryptuires.h | 2 + dlls/cryptui/main.c | 70 +++++++++++++++++++++++++++++++++++++++++- dlls/cryptui/tests/cryptui.c | 1 - 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc index 7ad889e..858a8ed 100644 --- a/dlls/cryptui/cryptui_En.rc +++ b/dlls/cryptui/cryptui_En.rc @@ -63,6 +63,8 @@ STRINGTABLE DISCARDABLE IDS_CERTIFICATE_PURPOSE_EXISTS "The OID you entered already exists." IDS_SELECT_STORE_TITLE "Select Certificate Store" IDS_SELECT_STORE "Please select a certificate store." + IDS_IMPORT_WIZARD "Certificate Import Wizard" + IDS_IMPORT_TYPE_MISMATCH "The file contains objects that do not match the given criteria. Please select another file." IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer" IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer" IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication" diff --git a/dlls/cryptui/cryptuires.h b/dlls/cryptui/cryptuires.h index 25dcb8a..aaf65bc 100644 --- a/dlls/cryptui/cryptuires.h +++ b/dlls/cryptui/cryptuires.h @@ -60,6 +60,8 @@ #define IDS_CERTIFICATE_PURPOSE_EXISTS 1040 #define IDS_SELECT_STORE_TITLE 1041 #define IDS_SELECT_STORE 1042 +#define IDS_IMPORT_WIZARD 1043 +#define IDS_IMPORT_TYPE_MISMATCH 1044 #define IDS_PURPOSE_SERVER_AUTH 1100 #define IDS_PURPOSE_CLIENT_AUTH 1101 diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index a21f9c5..f97f691 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -3468,6 +3468,71 @@ static BOOL import_cert(PCCERT_CONTEXT cert, HCERTSTORE hDestCertStore) return ret; } +/* Checks type, a type such as CERT_QUERY_CONTENT_CERT returned by + * CryptQueryObject, against the allowed types. Returns TRUE if the + * type is allowed, FALSE otherwise. + */ +static BOOL check_context_type(DWORD dwFlags, DWORD type) +{ + BOOL ret; + + if (dwFlags & + (CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_ALLOW_CRL | + CRYPTUI_WIZ_IMPORT_ALLOW_CTL)) + { + switch (type) + { + case CERT_QUERY_CONTENT_CERT: + case CERT_QUERY_CONTENT_SERIALIZED_CERT: + ret = dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CERT; + break; + case CERT_QUERY_CONTENT_CRL: + case CERT_QUERY_CONTENT_SERIALIZED_CRL: + ret = dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CRL; + break; + case CERT_QUERY_CONTENT_CTL: + case CERT_QUERY_CONTENT_SERIALIZED_CTL: + ret = dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CTL; + break; + default: + /* The remaining types contain more than one type, so allow + * any combination. + */ + ret = TRUE; + } + } + else + { + /* No allowed types specified, so any type is allowed */ + ret = TRUE; + } + if (!ret) + SetLastError(E_INVALIDARG); + return ret; +} + + +static void import_warn_type_mismatch(DWORD dwFlags, HWND hwnd, LPCWSTR szTitle) +{ + if (!(dwFlags & CRYPTUI_WIZ_NO_UI)) + { + WCHAR title[MAX_STRING_LEN], error[MAX_STRING_LEN]; + LPCWSTR pTitle; + + if (szTitle) + pTitle = szTitle; + else + { + LoadStringW(hInstance, IDS_IMPORT_WIZARD, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, IDS_IMPORT_TYPE_MISMATCH, error, + sizeof(error) / sizeof(error[0])); + MessageBoxW(hwnd, error, pTitle, MB_ICONERROR | MB_OK); + } +} + BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore) { @@ -3501,7 +3566,10 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT } break; case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT: - ret = import_cert(pImportSrc->u.pCertContext, hDestCertStore); + if ((ret = check_context_type(dwFlags, CERT_QUERY_CONTENT_CERT))) + ret = import_cert(pImportSrc->u.pCertContext, hDestCertStore); + else + import_warn_type_mismatch(dwFlags, hwndParent, pwszWizardTitle); break; default: FIXME("source type not implemented: %u\n", pImportSrc->dwSubjectChoice); diff --git a/dlls/cryptui/tests/cryptui.c b/dlls/cryptui/tests/cryptui.c index a1437fb..643f327 100644 --- a/dlls/cryptui/tests/cryptui.c +++ b/dlls/cryptui/tests/cryptui.c @@ -377,7 +377,6 @@ static void test_crypt_ui_wiz_import(void) SetLastError(0xdeadbeef); ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, 0, NULL, &info, NULL); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); CertFreeCertificateContext(info.u.pCertContext);
1
0
0
0
Juan Lang : cryptui: Inherit existing properties when importing a cert.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: 1accec563b6c648299c1fd7ea5484afd6299c3b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1accec563b6c648299c1fd7ea…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Dec 22 19:01:58 2008 -0800 cryptui: Inherit existing properties when importing a cert. --- dlls/cryptui/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index 8a1b149..a21f9c5 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -3463,7 +3463,7 @@ static BOOL import_cert(PCCERT_CONTEXT cert, HCERTSTORE hDestCertStore) } } ret = CertAddCertificateContextToStore(store, cert, - CERT_STORE_ADD_REPLACE_EXISTING, NULL); + CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, NULL); if (!hDestCertStore) CertCloseStore(store, 0); return ret; }
1
0
0
0
Juan Lang : cryptui: Use helper function for importing certificates.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: 8216c07a967e589e71ecc3cc6029dd0cccd6ab9a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8216c07a967e589e71ecc3cc6…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Dec 22 10:56:35 2008 -0800 cryptui: Use helper function for importing certificates. --- dlls/cryptui/main.c | 53 ++++++++++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 23 deletions(-) diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index 442cd19..8a1b149 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -3443,13 +3443,36 @@ static HCERTSTORE choose_store_for_cert(PCCERT_CONTEXT cert) CERT_SYSTEM_STORE_CURRENT_USER, storeName); } +static BOOL import_cert(PCCERT_CONTEXT cert, HCERTSTORE hDestCertStore) +{ + HCERTSTORE store; + BOOL ret; + + if (!cert) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + if (hDestCertStore) store = hDestCertStore; + else + { + if (!(store = choose_store_for_cert(cert))) + { + WARN("unable to open certificate store\n"); + return FALSE; + } + } + ret = CertAddCertificateContextToStore(store, cert, + CERT_STORE_ADD_REPLACE_EXISTING, NULL); + if (!hDestCertStore) CertCloseStore(store, 0); + return ret; +} + BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore) { BOOL ret; - HCERTSTORE store; const CERT_CONTEXT *cert; - BOOL freeCert = FALSE; TRACE("(0x%08x, %p, %s, %p, %p)\n", dwFlags, hwndParent, debugstr_w(pwszWizardTitle), pImportSrc, hDestCertStore); @@ -3472,35 +3495,19 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT return FALSE; } else - freeCert = TRUE; - break; - case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT: - cert = pImportSrc->u.pCertContext; - if (!cert) { - SetLastError(E_INVALIDARG); - return FALSE; + ret = import_cert(cert, hDestCertStore); + CertFreeCertificateContext(cert); } break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT: + ret = import_cert(pImportSrc->u.pCertContext, hDestCertStore); + break; default: FIXME("source type not implemented: %u\n", pImportSrc->dwSubjectChoice); SetLastError(E_INVALIDARG); return FALSE; } - if (hDestCertStore) store = hDestCertStore; - else - { - if (!(store = choose_store_for_cert(cert))) - { - WARN("unable to open certificate store\n"); - CertFreeCertificateContext(cert); - return FALSE; - } - } - ret = CertAddCertificateContextToStore(store, cert, CERT_STORE_ADD_REPLACE_EXISTING, NULL); - if (!hDestCertStore) CertCloseStore(store, 0); - if (freeCert) - CertFreeCertificateContext(cert); return ret; }
1
0
0
0
Juan Lang : crypt32: Support add disposition CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: cefe88208df878bd0d237c1b433ea453e4404438 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cefe88208df878bd0d237c1b4…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Dec 22 10:55:43 2008 -0800 crypt32: Support add disposition CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES. --- dlls/crypt32/ctl.c | 21 +++++++++++++++++++++ dlls/crypt32/store.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/ctl.c b/dlls/crypt32/ctl.c index ffac667..65691bb 100644 --- a/dlls/crypt32/ctl.c +++ b/dlls/crypt32/ctl.c @@ -82,6 +82,27 @@ BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, else toAdd = CertDuplicateCTLContext(pCtlContext); break; + case CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: + if (existing) + { + LONG newer = CompareFileTime(&existing->pCtlInfo->ThisUpdate, + &pCtlContext->pCtlInfo->ThisUpdate); + + if (newer < 0) + { + toAdd = CertDuplicateCTLContext(pCtlContext); + CtlContext_CopyProperties(existing, pCtlContext); + } + else + { + TRACE("existing CTL is newer, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + ret = FALSE; + } + } + else + toAdd = CertDuplicateCTLContext(pCtlContext); + break; case CERT_STORE_ADD_REPLACE_EXISTING: toAdd = CertDuplicateCTLContext(pCtlContext); break; diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index 1519c96..3b42893 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -893,6 +893,25 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, else toAdd = CertDuplicateCertificateContext(pCertContext); break; + case CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: + if (existing) + { + if (CompareFileTime(&existing->pCertInfo->NotBefore, + &pCertContext->pCertInfo->NotBefore) >= 0) + { + TRACE("existing certificate is newer, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + ret = FALSE; + } + else + { + toAdd = CertDuplicateCertificateContext(pCertContext); + CertContext_CopyProperties(toAdd, existing); + } + } + else + toAdd = CertDuplicateCertificateContext(pCertContext); + break; default: FIXME("Unimplemented add disposition %d\n", dwAddDisposition); SetLastError(E_INVALIDARG); @@ -1016,6 +1035,27 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, else toAdd = CertDuplicateCRLContext(pCrlContext); break; + case CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: + if (existing) + { + LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate, + &pCrlContext->pCrlInfo->ThisUpdate); + + if (newer < 0) + { + toAdd = CertDuplicateCRLContext(pCrlContext); + CrlContext_CopyProperties(toAdd, existing); + } + else + { + TRACE("existing CRL is newer, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + ret = FALSE; + } + } + else + toAdd = CertDuplicateCRLContext(pCrlContext); + break; case CERT_STORE_ADD_REPLACE_EXISTING: toAdd = CertDuplicateCRLContext(pCrlContext); break;
1
0
0
0
Juan Lang : cryptui: Test importing from a store.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: f2b98325183802e6984a54652549f8756aa72392 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2b98325183802e6984a54652…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Dec 22 10:54:39 2008 -0800 cryptui: Test importing from a store. --- dlls/cryptui/tests/cryptui.c | 138 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 138 insertions(+), 0 deletions(-) diff --git a/dlls/cryptui/tests/cryptui.c b/dlls/cryptui/tests/cryptui.c index 870d553..a1437fb 100644 --- a/dlls/cryptui/tests/cryptui.c +++ b/dlls/cryptui/tests/cryptui.c @@ -327,6 +327,9 @@ static void test_crypt_ui_wiz_import(void) BOOL ret; CRYPTUI_WIZ_IMPORT_SRC_INFO info; HCERTSTORE store; + PCCERT_CONTEXT cert; + PCCRL_CONTEXT crl; + DWORD count; if (!pCryptUIWizImport) { @@ -507,6 +510,141 @@ static void test_crypt_ui_wiz_import(void) } CertFreeCertificateContext(info.u.pCertContext); + info.u.hCertStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCertificateToStore(info.u.hCertStore, X509_ASN_ENCODING, + v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey), + CERT_STORE_ADD_ALWAYS, NULL); + CertAddEncodedCRLToStore(info.u.hCertStore, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); + info.dwSubjectChoice = CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE; + /* The ALLOW flags aren't allowed with a store as the source if the source + * contains types other than those allowed. + */ + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | + CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE | + CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, 0, NULL, + &info, store); + todo_wine + ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError()); + if (ret) + { + count = 0; + cert = NULL; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 1, "expected 1 cert, got %d\n", count); + count = 0; + crl = NULL; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (cert); + ok(count == 1, "expected 1 CRL, got %d\n", count); + } + CertCloseStore(store, 0); + CertCloseStore(info.u.hCertStore, 0); + + /* If the ALLOW flags match the content of the store, the store can be + * imported. + */ + info.u.hCertStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCertificateToStore(info.u.hCertStore, X509_ASN_ENCODING, + v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey), + CERT_STORE_ADD_ALWAYS, NULL); + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, store); + todo_wine + ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError()); + if (ret) + { + count = 0; + cert = NULL; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 1, "expected 1 cert, got %d\n", count); + count = 0; + crl = NULL; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (cert); + ok(count == 0, "expected 0 CRLs, got %d\n", count); + } + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertCloseStore(store, 0); + CertCloseStore(info.u.hCertStore, 0); + + /* Again, if the ALLOW flags match the content of the store, the store can + * be imported. + */ + info.u.hCertStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCRLToStore(info.u.hCertStore, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, store); + todo_wine + ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError()); + if (ret) + { + count = 0; + cert = NULL; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 0, "expected 0 certs, got %d\n", count); + count = 0; + crl = NULL; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (cert); + ok(count == 1, "expected 1 CRL, got %d\n", count); + } + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertCloseStore(store, 0); + CertCloseStore(info.u.hCertStore, 0); + UnhookWindowsHookEx(hook); }
1
0
0
0
Juan Lang : cryptui: Test mismatches between allowed and given types in CryptUIWizImport.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: f1796209eb6c6286e27e19bb7b6f403e3d358546 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f1796209eb6c6286e27e19bb7…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Mon Dec 22 10:53:51 2008 -0800 cryptui: Test mismatches between allowed and given types in CryptUIWizImport. --- dlls/cryptui/tests/cryptui.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/dlls/cryptui/tests/cryptui.c b/dlls/cryptui/tests/cryptui.c index 6665c0c..870d553 100644 --- a/dlls/cryptui/tests/cryptui.c +++ b/dlls/cryptui/tests/cryptui.c @@ -283,6 +283,12 @@ static const BYTE iTunesCert3[] = { 0xd3,0x9c,0x6e,0xc1,0x9c,0xac,0x74,0x3d,0x77,0x06,0x5e,0x28,0x28,0x5c,0xf5, 0xe0,0x9c,0x19,0xd8,0xba,0x74,0x81,0x2d,0x67,0x77,0x93,0x8d,0xbf,0xd2,0x52, 0x00,0xe6,0xa5,0x38,0x4e,0x2e,0x73,0x66,0x7a }; +static const BYTE signedCRL[] = { 0x30, 0x45, 0x30, 0x2c, 0x30, 0x02, 0x06, + 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, + 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f, + 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x30, 0x02, 0x06, 0x00, 0x03, 0x11, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, + 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; /* CBT hook to ensure a window (e.g., MessageBox) cannot be created */ static HHOOK hook; @@ -362,9 +368,29 @@ static void test_crypt_ui_wiz_import(void) 0, NULL, &info, NULL); ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); + /* Check allowed vs. given type mismatches */ + info.u.pCertContext = CertCreateCertificateContext(X509_ASN_ENCODING, + v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey)); + SetLastError(0xdeadbeef); + ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, NULL); + todo_wine + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertFreeCertificateContext(info.u.pCertContext); + info.dwSubjectChoice = CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT; + info.u.pCRLContext = CertCreateCRLContext(X509_ASN_ENCODING, + signedCRL, sizeof(signedCRL)); + SetLastError(0xdeadbeef); + ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, NULL); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertFreeCRLContext(info.u.pCRLContext); /* Imports the following cert--self-signed, with no basic constraints set-- * to the CA store. Puts up a dialog at the end if it succeeds or fails. */ + info.dwSubjectChoice = CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT; info.u.pCertContext = CertCreateCertificateContext(X509_ASN_ENCODING, v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey)); ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI, 0, NULL, &info, NULL);
1
0
0
0
Hans Leidekker : wintrust: Fix message handle type.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: a04afe7b70f6b00ff0f84c7b20f14f950a78f526 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a04afe7b70f6b00ff0f84c7b2…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Dec 23 11:51:14 2008 +0100 wintrust: Fix message handle type. Spotted by Juan Lang. --- dlls/wintrust/crypt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 100a6be..99989fd 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintrust); struct cryptcat { DWORD magic; - HANDLE msg; + HCRYPTMSG msg; DWORD encoding; CTL_INFO *inner; DWORD inner_len;
1
0
0
0
Hans Leidekker : wintrust: Add some tests.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: 053b2295a5d47104eadb552d323c04c7418513e0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=053b2295a5d47104eadb552d3…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Dec 23 11:51:04 2008 +0100 wintrust: Add some tests. --- dlls/wintrust/tests/crypt.c | 79 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 78 insertions(+), 1 deletions(-) diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c index 6811fd4..f9a57af 100644 --- a/dlls/wintrust/tests/crypt.c +++ b/dlls/wintrust/tests/crypt.c @@ -48,7 +48,7 @@ CATATTR2=0x10010001:attr2:value2 hashme=.\winetest.cdf */ -const BYTE test_catalog[] = { +static const BYTE test_catalog[] = { 0x30, 0x82, 0x01, 0xbc, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x01, 0xad, 0x30, 0x82, 0x01, 0xa9, 0x02, 0x01, 0x01, 0x31, 0x00, 0x30, 0x82, 0x01, 0x9e, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x01, 0xa0, 0x82, 0x01, 0x8f, 0x30, @@ -85,6 +85,11 @@ static BOOL (WINAPI * pCryptCATAdminCalcHashFromFileHandle)(HANDLE hFile, DWORD* static HCATINFO (WINAPI * pCryptCATAdminAddCatalog)(HCATADMIN, PWSTR, PWSTR, DWORD); static BOOL (WINAPI * pCryptCATAdminRemoveCatalog)(HCATADMIN, LPCWSTR, DWORD); static BOOL (WINAPI * pCryptCATAdminReleaseCatalogContext)(HCATADMIN, HCATINFO, DWORD); +static HANDLE (WINAPI * pCryptCATOpen)(LPWSTR, DWORD, HCRYPTPROV, DWORD, DWORD); +static BOOL (WINAPI * pCryptCATCatalogInfoFromContext)(HCATINFO, CATALOG_INFO *, DWORD); +static CRYPTCATMEMBER * (WINAPI * pCryptCATEnumerateMember)(HANDLE, CRYPTCATMEMBER *); +static CRYPTCATATTRIBUTE * (WINAPI * pCryptCATEnumerateAttr)(HANDLE, CRYPTCATMEMBER *, CRYPTCATATTRIBUTE *); +static BOOL (WINAPI * pCryptCATClose)(HANDLE); static void InitFunctionPtrs(void) { @@ -102,6 +107,11 @@ static void InitFunctionPtrs(void) WINTRUST_GET_PROC(CryptCATAdminAddCatalog) WINTRUST_GET_PROC(CryptCATAdminRemoveCatalog) WINTRUST_GET_PROC(CryptCATAdminReleaseCatalogContext) + WINTRUST_GET_PROC(CryptCATOpen) + WINTRUST_GET_PROC(CryptCATCatalogInfoFromContext) + WINTRUST_GET_PROC(CryptCATEnumerateMember) + WINTRUST_GET_PROC(CryptCATEnumerateAttr) + WINTRUST_GET_PROC(CryptCATClose) #undef WINTRUST_GET_PROC } @@ -346,6 +356,7 @@ static void test_CryptCATAdminAddRemoveCatalog(void) static WCHAR basenameW[] = {'w','i','n','e','t','e','s','t','.','c','a','t',0}; HCATADMIN hcatadmin; HCATINFO hcatinfo; + CATALOG_INFO info; WCHAR tmpfileW[MAX_PATH]; char tmpfile[MAX_PATH]; HANDLE file; @@ -414,6 +425,11 @@ static void test_CryptCATAdminAddRemoveCatalog(void) hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0); ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError()); + info.cbStruct = sizeof(info); + info.wszCatalogFile[0] = 0; + ret = pCryptCATCatalogInfoFromContext(hcatinfo, &info, 0); + ok(ret, "CryptCATCatalogInfoFromContext failed %u\n", GetLastError()); + ret = pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0); ok(ret, "CryptCATAdminReleaseCatalogContext failed %u\n", GetLastError()); @@ -426,6 +442,66 @@ static void test_CryptCATAdminAddRemoveCatalog(void) DeleteFileA(tmpfile); } +static void test_catalog_properties(void) +{ + static const WCHAR hashmeW[] = {'h','a','s','h','m','e',0}; + static const GUID subject = {0xde351a42,0x8e59,0x11d0,{0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee}}; + + HANDLE hcat; + CRYPTCATMEMBER *m; + CRYPTCATATTRIBUTE *attr; + char catalog[MAX_PATH]; + WCHAR catalogW[MAX_PATH]; + DWORD written; + HANDLE file; + BOOL ret; + + if (!GetTempFileNameA(CURR_DIR, "cat", 0, catalog)) return; + file = CreateFileA(catalog, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError()); + WriteFile(file, test_catalog, sizeof(test_catalog), &written, NULL); + CloseHandle(file); + + hcat = pCryptCATOpen(NULL, 0, 0, 0, 0); + ok(hcat == INVALID_HANDLE_VALUE, "CryptCATOpen succeeded\n"); + + MultiByteToWideChar(CP_ACP, 0, catalog, -1, catalogW, MAX_PATH); + + hcat = pCryptCATOpen(catalogW, 0, 0, 0, 0); + ok(hcat != INVALID_HANDLE_VALUE, "CryptCATOpen failed %u\n", GetLastError()); + + m = pCryptCATEnumerateMember(NULL, NULL); + ok(m == NULL, "CryptCATEnumerateMember succeeded\n"); + + m = pCryptCATEnumerateMember(hcat, NULL); + ok(m != NULL, "CryptCATEnumerateMember failed %u\n", GetLastError()); + + ok(m->cbStruct == sizeof(CRYPTCATMEMBER), "unexpected size %u\n", m->cbStruct); + todo_wine ok(!lstrcmpW(m->pwszReferenceTag, hashmeW), "unexpected tag\n"); + ok(!memcmp(&m->gSubjectType, &subject, sizeof(subject)), "guid differs\n"); + ok(!m->fdwMemberFlags, "got %x expected 0\n", m->fdwMemberFlags); + ok(m->dwCertVersion == 0x200, "got %x expected 0x200\n", m->dwCertVersion); + ok(!m->dwReserved, "got %x expected 0\n", m->dwReserved); + ok(m->hReserved == NULL, "got %p expected NULL\n", m->hReserved); + + attr = pCryptCATEnumerateAttr(NULL, NULL, NULL); + ok(attr == NULL, "CryptCATEnumerateAttr succeeded\n"); + + attr = pCryptCATEnumerateAttr(hcat, NULL, NULL); + ok(attr == NULL, "CryptCATEnumerateAttr succeeded\n"); + + attr = pCryptCATEnumerateAttr(hcat, m, NULL); + ok(attr == NULL, "CryptCATEnumerateAttr succeeded\n"); + + m = pCryptCATEnumerateMember(hcat, m); + ok(m == NULL, "CryptCATEnumerateMember succeeded\n"); + + ret = pCryptCATClose(hcat); + ok(ret, "CryptCATClose failed\n"); + + DeleteFileA(catalog); +} + START_TEST(crypt) { int myARGC; @@ -447,4 +523,5 @@ START_TEST(crypt) test_context(); test_calchash(); test_CryptCATAdminAddRemoveCatalog(); + test_catalog_properties(); }
1
0
0
0
Hans Leidekker : wintrust: Add stub implementations of CryptCATEnumerateAttr, CryptCATEnumerateCatAttr, CryptCATGetAttrInfo, CryptCATGetCatAttrInfo and CryptCATGetMemberInfo.
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: 32766e3882d4408f506893932c633613311c01a0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32766e3882d4408f506893932…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Dec 23 11:50:58 2008 +0100 wintrust: Add stub implementations of CryptCATEnumerateAttr, CryptCATEnumerateCatAttr, CryptCATGetAttrInfo, CryptCATGetCatAttrInfo and CryptCATGetMemberInfo. --- dlls/wintrust/crypt.c | 87 +++++++++++++++++++++++++++++++++++++++++++ dlls/wintrust/wintrust.spec | 10 ++-- 2 files changed, 92 insertions(+), 5 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 44ab4bb..100a6be 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -521,6 +521,93 @@ BOOL WINAPI CryptCATClose(HANDLE hCatalog) } /*********************************************************************** + * CryptCATGetAttrInfo (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATGetAttrInfo(HANDLE hCatalog, CRYPTCATMEMBER *member, LPWSTR tag) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %p, %s\n", hCatalog, member, debugstr_w(tag)); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** + * CryptCATGetCatAttrInfo (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATGetCatAttrInfo(HANDLE hCatalog, LPWSTR tag) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %s\n", hCatalog, debugstr_w(tag)); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +CRYPTCATMEMBER * WINAPI CryptCATGetMemberInfo(HANDLE hCatalog, LPWSTR tag) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %s\n", hCatalog, debugstr_w(tag)); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** + * CryptCATEnumerateAttr (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateAttr(HANDLE hCatalog, CRYPTCATMEMBER *member, CRYPTCATATTRIBUTE *prev) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %p, %p\n", hCatalog, member, prev); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** + * CryptCATEnumerateCatAttr (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateCatAttr(HANDLE hCatalog, CRYPTCATATTRIBUTE *prev) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %p\n", hCatalog, prev); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** * CryptCATEnumerateMember (WINTRUST.@) */ CRYPTCATMEMBER * WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER *prev) diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec index bc5fd41..bf5ee1f 100644 --- a/dlls/wintrust/wintrust.spec +++ b/dlls/wintrust/wintrust.spec @@ -19,12 +19,12 @@ @ stub CryptCATCDFOpen @ stdcall CryptCATCatalogInfoFromContext(ptr ptr long) @ stdcall CryptCATClose(long) -@ stub CryptCATEnumerateAttr -@ stub CryptCATEnumerateCatAttr +@ stdcall CryptCATEnumerateAttr(ptr ptr ptr) +@ stdcall CryptCATEnumerateCatAttr(ptr ptr) @ stdcall CryptCATEnumerateMember(long ptr) -@ stub CryptCATGetAttrInfo -@ stub CryptCATGetCatAttrInfo -@ stub CryptCATGetMemberInfo +@ stdcall CryptCATGetAttrInfo(ptr ptr wstr) +@ stdcall CryptCATGetCatAttrInfo(ptr wstr ) +@ stdcall CryptCATGetMemberInfo(ptr wstr) @ stub CryptCATHandleFromStore @ stdcall CryptCATOpen(wstr long long long long) @ stub CryptCATPersistStore
1
0
0
0
Hans Leidekker : wintrust: Implement CryptCATAdminResolveCatalogPath and CryptCATCatalogInfoFromContext .
by Alexandre Julliard
23 Dec '08
23 Dec '08
Module: wine Branch: master Commit: 615d023bf1468c27444996f5e9d99991cd0e3779 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=615d023bf1468c27444996f5e…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Dec 23 11:50:46 2008 +0100 wintrust: Implement CryptCATAdminResolveCatalogPath and CryptCATCatalogInfoFromContext. --- dlls/wintrust/crypt.c | 42 ++++++++++++++++++++++++++++++++++++++++++ dlls/wintrust/wintrust.spec | 4 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 7b30ede..44ab4bb 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -475,6 +475,29 @@ BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogF } /*********************************************************************** + * CryptCATAdminResolveCatalogPath (WINTRUST.@) + */ +BOOL WINAPI CryptCATAdminResolveCatalogPath(HCATADMIN hcatadmin, WCHAR *catalog_file, + CATALOG_INFO *info, DWORD flags) +{ + static const WCHAR slashW[] = {'\\',0}; + struct catadmin *ca = hcatadmin; + + TRACE("%p %s %p %x\n", hcatadmin, debugstr_w(catalog_file), info, flags); + + if (!ca || ca->magic != CATADMIN_MAGIC || !info || info->cbStruct != sizeof(*info) || flags) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + strcpyW(info->wszCatalogFile, ca->path); + strcatW(info->wszCatalogFile, slashW); + strcatW(info->wszCatalogFile, catalog_file); + + return TRUE; +} + +/*********************************************************************** * CryptCATClose (WINTRUST.@) */ BOOL WINAPI CryptCATClose(HANDLE hCatalog) @@ -683,6 +706,25 @@ out: } /*********************************************************************** + * CryptCATCatalogInfoFromContext (WINTRUST.@) + */ +BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO hcatinfo, CATALOG_INFO *info, DWORD flags) +{ + struct catinfo *ci = hcatinfo; + + TRACE("%p, %p, %x\n", hcatinfo, info, flags); + + if (!hcatinfo || hcatinfo == INVALID_HANDLE_VALUE || ci->magic != CATINFO_MAGIC || + flags || !info || info->cbStruct != sizeof(*info)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + strcpyW(info->wszCatalogFile, ci->file); + return TRUE; +} + +/*********************************************************************** * CryptCATOpen (WINTRUST.@) */ HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv, diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec index 6f83282..bc5fd41 100644 --- a/dlls/wintrust/wintrust.spec +++ b/dlls/wintrust/wintrust.spec @@ -8,7 +8,7 @@ @ stdcall CryptCATAdminReleaseCatalogContext(long long long) @ stdcall CryptCATAdminReleaseContext(long long) @ stdcall CryptCATAdminRemoveCatalog(ptr wstr long) -@ stub CryptCATAdminResolveCatalogPath +@ stdcall CryptCATAdminResolveCatalogPath(ptr wstr ptr long) @ stub CryptCATCDFClose @ stub CryptCATCDFEnumAttributes @ stub CryptCATCDFEnumAttributesWithCDFTag @@ -17,7 +17,7 @@ @ stub CryptCATCDFEnumMembersByCDFTag @ stub CryptCATCDFEnumMembersByCDFTagEx @ stub CryptCATCDFOpen -@ stub CryptCATCatalogInfoFromContext +@ stdcall CryptCATCatalogInfoFromContext(ptr ptr long) @ stdcall CryptCATClose(long) @ stub CryptCATEnumerateAttr @ stub CryptCATEnumerateCatAttr
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
123
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Results per page:
10
25
50
100
200