mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
Replace certificate while renewing it
This commit also changes the default state of the "Revoke old certificate" checkbox to unchecked. The reasoning for this is that by renewing a certificate its lifetime and subsequently validity are prolonged, which therefore implies equal trustworthiness for both new and old certificates, which does not intend the revocation of the latter.
This commit is contained in:
parent
2635b91033
commit
8af3cabfa8
@ -837,6 +837,7 @@ void db_x509::certRenewal(QModelIndexList indexes)
|
||||
CertExtend *dlg = NULL;
|
||||
x509rev r;
|
||||
bool doRevoke = false;
|
||||
bool doReplace = false;
|
||||
|
||||
if (indexes.size() == 0)
|
||||
return;
|
||||
@ -862,6 +863,7 @@ void db_x509::certRenewal(QModelIndexList indexes)
|
||||
r = revoke->getRevocation();
|
||||
delete revoke;
|
||||
}
|
||||
doReplace = dlg->replace->isChecked();
|
||||
foreach(idx, indexes) {
|
||||
oldcert = fromIndex<pki_x509>(idx);
|
||||
if (!oldcert)
|
||||
@ -887,6 +889,10 @@ void db_x509::certRenewal(QModelIndexList indexes)
|
||||
newcert->sign(signkey, oldcert->getDigest());
|
||||
newcert = dynamic_cast<pki_x509 *>(insert(newcert));
|
||||
createSuccess(newcert);
|
||||
|
||||
// delete old certificate if requested
|
||||
if (doReplace)
|
||||
deletePKI(idx);
|
||||
}
|
||||
if (doRevoke)
|
||||
do_revoke(indexes, r);
|
||||
|
||||
@ -215,6 +215,16 @@
|
||||
<property name="text">
|
||||
<string>Revoke old certificate</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="replace">
|
||||
<property name="text">
|
||||
<string>Replace old certificate</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user