Close #327: "Dump database" dumps everything to everywhere

Select the items to be dumped to the currently selected
directory.
This commit is contained in:
Christian Hohnstaedt 2022-07-31 11:18:19 +02:00
parent 3432c164dd
commit ed475c8d9f
2 changed files with 5 additions and 3 deletions

View File

@ -377,8 +377,10 @@ void db_base::dump(const QString &dir) const
}
try {
foreach(pki_base *pki, Store.getAll<pki_base>())
pki->writeDefault(dirname);
foreach(pki_base *pki, Store.getAll<pki_base>()) {
if (pkitype.contains(pki->getType()))
pki->writeDefault(dirname);
}
}
catch (errorEx &err) {
XCA_ERROR(err);

View File

@ -764,7 +764,7 @@ void pki_evp::writeDefault(const QString &dirname) const
{
XFile file(get_dump_filename(dirname, ".pem"));
file.open_key();
writeKey(file, pki_evp::passwd[0] ? EVP_des_ede3_cbc() : NULL,
writeKey(file, pki_evp::passwd.isEmpty() ? NULL : EVP_des_ede3_cbc(),
mycb, true);
}