Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c7d65aa7
Commit
c7d65aa7
authored
Feb 06, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Feb 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Delete the private keys if requested when they're successfully exported.
parent
ccc2be74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
main.c
dlls/cryptui/main.c
+21
-7
No files found.
dlls/cryptui/main.c
View file @
c7d65aa7
...
...
@@ -5519,6 +5519,7 @@ struct ExportWizData
CRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
contextInfo
;
BOOL
freePassword
;
PCRYPT_KEY_PROV_INFO
keyProvInfo
;
BOOL
deleteKeys
;
LPWSTR
fileName
;
HANDLE
file
;
BOOL
success
;
...
...
@@ -5814,7 +5815,7 @@ static LRESULT CALLBACK export_format_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
if
(
IsDlgButtonChecked
(
hwnd
,
IDC_EXPORT_PFX_STRONG_ENCRYPTION
))
data
->
contextInfo
.
fStrongEncryption
=
TRUE
;
if
(
IsDlgButtonChecked
(
hwnd
,
IDC_EXPORT_PFX_DELETE_PRIVATE_KEY
))
data
->
contextInfo
.
fExportPriva
teKeys
=
TRUE
;
data
->
dele
teKeys
=
TRUE
;
skipPasswordPage
=
FALSE
;
}
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
...
...
@@ -6500,7 +6501,7 @@ static BOOL save_serialized_store(HANDLE file, HCERTSTORE store)
static
BOOL
save_pfx
(
HANDLE
file
,
PCCRYPTUI_WIZ_EXPORT_INFO
pExportInfo
,
PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
pContextInfo
,
PCRYPT_KEY_PROV_INFO
keyProvInfo
)
PCRYPT_KEY_PROV_INFO
keyProvInfo
,
BOOL
deleteKeys
)
{
HCERTSTORE
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
X509_ASN_ENCODING
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
...
...
@@ -6510,6 +6511,7 @@ static BOOL save_pfx(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
{
CRYPT_DATA_BLOB
pfxBlob
=
{
0
,
NULL
};
PCCERT_CONTEXT
cert
=
NULL
;
BOOL
freeKeyProvInfo
=
FALSE
;
if
(
pContextInfo
->
fExportChain
)
{
...
...
@@ -6579,7 +6581,7 @@ static BOOL save_pfx(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
{
ret
=
CertSetCertificateContextProperty
(
cert
,
CERT_KEY_PROV_INFO_PROP_ID
,
0
,
keyProvInfo
);
HeapFree
(
GetProcessHeap
(),
0
,
keyProvInfo
)
;
freeKeyProvInfo
=
TRUE
;
}
}
}
...
...
@@ -6612,6 +6614,16 @@ static BOOL save_pfx(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
}
}
}
if
(
ret
&&
deleteKeys
)
{
HCRYPTPROV
prov
;
CryptAcquireContextW
(
&
prov
,
keyProvInfo
->
pwszContainerName
,
keyProvInfo
->
pwszProvName
,
keyProvInfo
->
dwProvType
,
CRYPT_DELETEKEYSET
);
}
if
(
freeKeyProvInfo
)
HeapFree
(
GetProcessHeap
(),
0
,
keyProvInfo
);
CertFreeCertificateContext
(
cert
);
CertCloseStore
(
store
,
0
);
}
...
...
@@ -6620,7 +6632,7 @@ static BOOL save_pfx(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
static
BOOL
do_export
(
HANDLE
file
,
PCCRYPTUI_WIZ_EXPORT_INFO
pExportInfo
,
PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
pContextInfo
,
PCRYPT_KEY_PROV_INFO
keyProvInfo
)
PCRYPT_KEY_PROV_INFO
keyProvInfo
,
BOOL
deleteKeys
)
{
BOOL
ret
;
...
...
@@ -6664,7 +6676,8 @@ static BOOL do_export(HANDLE file, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,
pContextInfo
->
fExportChain
);
break
;
case
CRYPTUI_WIZ_EXPORT_FORMAT_PFX
:
ret
=
save_pfx
(
file
,
pExportInfo
,
pContextInfo
,
keyProvInfo
);
ret
=
save_pfx
(
file
,
pExportInfo
,
pContextInfo
,
keyProvInfo
,
deleteKeys
);
break
;
default:
SetLastError
(
E_FAIL
);
...
...
@@ -6728,7 +6741,7 @@ static LRESULT CALLBACK export_finish_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
data
=
(
struct
ExportWizData
*
)
GetWindowLongPtrW
(
hwnd
,
DWLP_USER
);
if
((
data
->
success
=
do_export
(
data
->
file
,
&
data
->
exportInfo
,
&
data
->
contextInfo
,
data
->
keyProvInfo
)))
&
data
->
contextInfo
,
data
->
keyProvInfo
,
data
->
deleteKeys
)))
{
messageID
=
IDS_EXPORT_SUCCEEDED
;
mbFlags
=
MB_OK
;
...
...
@@ -6788,6 +6801,7 @@ static BOOL show_export_ui(DWORD dwFlags, HWND hwndParent,
min
(((
PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
)
pvoid
)
->
dwSize
,
sizeof
(
data
.
contextInfo
)));
data
.
keyProvInfo
=
NULL
;
data
.
deleteKeys
=
FALSE
;
data
.
fileName
=
NULL
;
data
.
file
=
INVALID_HANDLE_VALUE
;
data
.
success
=
FALSE
;
...
...
@@ -6933,7 +6947,7 @@ BOOL WINAPI CryptUIWizExport(DWORD dwFlags, HWND hwndParent,
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
ret
=
do_export
(
file
,
pExportInfo
,
pvoid
,
NULL
);
ret
=
do_export
(
file
,
pExportInfo
,
pvoid
,
NULL
,
FALSE
);
CloseHandle
(
file
);
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment