Commit a7096f96 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

cryptui: Add support for exporting a serialized store from CryptUIWizExport.

parent 072b6065
...@@ -153,6 +153,7 @@ STRINGTABLE DISCARDABLE ...@@ -153,6 +153,7 @@ STRINGTABLE DISCARDABLE
IDS_EXPORT_FILTER_CTL "Certificate Trust List (*.stl)" IDS_EXPORT_FILTER_CTL "Certificate Trust List (*.stl)"
IDS_EXPORT_FILTER_CMS "CMS/PKCS #7 Messages (*.p7b)" IDS_EXPORT_FILTER_CMS "CMS/PKCS #7 Messages (*.p7b)"
IDS_EXPORT_FILTER_PFX "Personal Information Exchange (*.pfx)" IDS_EXPORT_FILTER_PFX "Personal Information Exchange (*.pfx)"
IDS_EXPORT_FILTER_SERIALIZED_CERT_STORE "Serialized Certificate Store (*.sst)"
IDS_EXPORT_FORMAT "File Format" IDS_EXPORT_FORMAT "File Format"
IDS_EXPORT_INCLUDE_CHAIN "Include all certificates in certificate path" IDS_EXPORT_INCLUDE_CHAIN "Include all certificates in certificate path"
IDS_EXPORT_KEYS "Export keys" IDS_EXPORT_KEYS "Export keys"
......
...@@ -152,13 +152,14 @@ ...@@ -152,13 +152,14 @@
#define IDS_EXPORT_FILTER_CTL 1209 #define IDS_EXPORT_FILTER_CTL 1209
#define IDS_EXPORT_FILTER_CMS 1210 #define IDS_EXPORT_FILTER_CMS 1210
#define IDS_EXPORT_FILTER_PFX 1211 #define IDS_EXPORT_FILTER_PFX 1211
#define IDS_EXPORT_FORMAT 1212 #define IDS_EXPORT_FILTER_SERIALIZED_CERT_STORE 1212
#define IDS_EXPORT_INCLUDE_CHAIN 1213 #define IDS_EXPORT_FORMAT 1213
#define IDS_EXPORT_KEYS 1214 #define IDS_EXPORT_INCLUDE_CHAIN 1214
#define IDS_YES 1215 #define IDS_EXPORT_KEYS 1215
#define IDS_NO 1216 #define IDS_YES 1216
#define IDS_EXPORT_SUCCEEDED 1217 #define IDS_NO 1217
#define IDS_EXPORT_FAILED 1218 #define IDS_EXPORT_SUCCEEDED 1218
#define IDS_EXPORT_FAILED 1219
#define IDD_GENERAL 100 #define IDD_GENERAL 100
#define IDD_DETAIL 101 #define IDD_DETAIL 101
......
...@@ -5633,6 +5633,7 @@ static LPWSTR export_append_extension(struct ExportWizData *data, ...@@ -5633,6 +5633,7 @@ static LPWSTR export_append_extension(struct ExportWizData *data,
static const WCHAR ctl[] = { '.','c','t','l',0 }; static const WCHAR ctl[] = { '.','c','t','l',0 };
static const WCHAR p7b[] = { '.','p','7','b',0 }; static const WCHAR p7b[] = { '.','p','7','b',0 };
static const WCHAR pfx[] = { '.','p','f','x',0 }; static const WCHAR pfx[] = { '.','p','f','x',0 };
static const WCHAR sst[] = { '.','s','s','t',0 };
LPCWSTR extension; LPCWSTR extension;
LPWSTR dot; LPWSTR dot;
BOOL appendExtension; BOOL appendExtension;
...@@ -5654,6 +5655,9 @@ static LPWSTR export_append_extension(struct ExportWizData *data, ...@@ -5654,6 +5655,9 @@ static LPWSTR export_append_extension(struct ExportWizData *data,
case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT: case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT:
extension = ctl; extension = ctl;
break; break;
case CRYPTUI_WIZ_EXPORT_CERT_STORE:
extension = sst;
break;
default: default:
extension = cer; extension = cer;
} }
...@@ -5760,6 +5764,7 @@ static const WCHAR export_filter_crl[] = { '*','.','c','r','l',0 }; ...@@ -5760,6 +5764,7 @@ static const WCHAR export_filter_crl[] = { '*','.','c','r','l',0 };
static const WCHAR export_filter_ctl[] = { '*','.','s','t','l',0 }; static const WCHAR export_filter_ctl[] = { '*','.','s','t','l',0 };
static const WCHAR export_filter_cms[] = { '*','.','p','7','b',0 }; static const WCHAR export_filter_cms[] = { '*','.','p','7','b',0 };
static const WCHAR export_filter_pfx[] = { '*','.','p','f','x',0 }; static const WCHAR export_filter_pfx[] = { '*','.','p','f','x',0 };
static const WCHAR export_filter_sst[] = { '*','.','s','s','t',0 };
static WCHAR *make_export_file_filter(DWORD exportFormat, DWORD subjectChoice) static WCHAR *make_export_file_filter(DWORD exportFormat, DWORD subjectChoice)
{ {
...@@ -5792,6 +5797,10 @@ static WCHAR *make_export_file_filter(DWORD exportFormat, DWORD subjectChoice) ...@@ -5792,6 +5797,10 @@ static WCHAR *make_export_file_filter(DWORD exportFormat, DWORD subjectChoice)
baseID = IDS_EXPORT_FILTER_CTL; baseID = IDS_EXPORT_FILTER_CTL;
filterStr = export_filter_ctl; filterStr = export_filter_ctl;
break; break;
case CRYPTUI_WIZ_EXPORT_CERT_STORE:
baseID = IDS_EXPORT_FILTER_SERIALIZED_CERT_STORE;
filterStr = export_filter_sst;
break;
default: default:
baseID = IDS_EXPORT_FILTER_CERT; baseID = IDS_EXPORT_FILTER_CERT;
filterStr = export_filter_cert; filterStr = export_filter_cert;
...@@ -5968,6 +5977,7 @@ static void show_export_details(HWND lv, struct ExportWizData *data) ...@@ -5968,6 +5977,7 @@ static void show_export_details(HWND lv, struct ExportWizData *data)
{ {
case CRYPTUI_WIZ_EXPORT_CRL_CONTEXT: case CRYPTUI_WIZ_EXPORT_CRL_CONTEXT:
case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT: case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT:
case CRYPTUI_WIZ_EXPORT_CERT_STORE:
/* do nothing */ /* do nothing */
break; break;
default: default:
...@@ -6011,6 +6021,9 @@ static void show_export_details(HWND lv, struct ExportWizData *data) ...@@ -6011,6 +6021,9 @@ static void show_export_details(HWND lv, struct ExportWizData *data)
case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT: case CRYPTUI_WIZ_EXPORT_CTL_CONTEXT:
contentID = IDS_EXPORT_FILTER_CTL; contentID = IDS_EXPORT_FILTER_CTL;
break; break;
case CRYPTUI_WIZ_EXPORT_CERT_STORE:
contentID = IDS_EXPORT_FILTER_SERIALIZED_CERT_STORE;
break;
default: default:
switch (data->contextInfo.dwExportFormat) switch (data->contextInfo.dwExportFormat)
{ {
...@@ -6132,6 +6145,12 @@ static BOOL save_cms(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, ...@@ -6132,6 +6145,12 @@ static BOOL save_cms(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
return ret; return ret;
} }
static BOOL save_serialized_store(HANDLE file, HCERTSTORE store)
{
return CertSaveStore(store, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
CERT_STORE_SAVE_AS_STORE, CERT_STORE_SAVE_TO_FILE, file, 0);
}
static BOOL do_export(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, static BOOL do_export(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO pContextInfo) PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO pContextInfo)
{ {
...@@ -6154,6 +6173,9 @@ static BOOL do_export(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, ...@@ -6154,6 +6173,9 @@ static BOOL do_export(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
pExportInfo->u.pCTLContext->pbCtlEncoded, pExportInfo->u.pCTLContext->pbCtlEncoded,
pExportInfo->u.pCTLContext->cbCtlEncoded); pExportInfo->u.pCTLContext->cbCtlEncoded);
break; break;
case CRYPTUI_WIZ_EXPORT_CERT_STORE:
ret = save_serialized_store(file, pExportInfo->u.hCertStore);
break;
default: default:
switch (pContextInfo->dwExportFormat) switch (pContextInfo->dwExportFormat)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment