Close #364 Export ED25519 private key with password

Allow exporting encrypted ED25519 keys.
The crypt flag was disallowed to support SSH2 export.
But since the SSH2 key is written unencrypted,
this restriction makes no sense anymore.
This commit is contained in:
Christian Hohnstaedt 2024-08-22 13:59:21 +02:00
parent 4b6965d784
commit a4fc9aa110
3 changed files with 3 additions and 2 deletions

View File

@ -197,7 +197,7 @@ int db_key::exportFlags(const QModelIndex &index) const
disable_flags |= F_PVK;
#ifdef EVP_PKEY_ED25519
if (keytype == EVP_PKEY_ED25519)
disable_flags |= F_CRYPT;
disable_flags |= F_TRADITION;
#endif
if (!key->SSH2_compatible())
disable_flags |= F_SSH2;

View File

@ -81,7 +81,7 @@ new pki_export(39, x509, "key", tr("OpenVPN tls-auth key"), F_SINGLE | F_TAKEY,
new pki_export(19, asym_key, "pem", tr("PEM public"), F_PEM | F_CLIPBOARD, tr("Text format of the public key in one PEM file")),
new pki_export(20, asym_key, "pem", tr("PEM private"), F_PEM | F_PRIVATE | F_USUAL | F_CLIPBOARD, tr("Unencrypted private key in text format")),
new pki_export(21, asym_key, "pem", tr("PEM encrypted"), F_PEM | F_PRIVATE | F_CRYPT | F_SINGLE, tr("OpenSSL specific encrypted private key in text format")),
new pki_export(21, asym_key, "pem", tr("PEM encrypted"), F_PEM | F_PRIVATE | F_CRYPT | F_SINGLE | F_TRADITION, tr("OpenSSL specific encrypted private key in text format")),
new pki_export(22, asym_key, "priv",tr("SSH2 private"), F_PRIVATE | F_SSH2 | F_SINGLE, tr("Unencrypted private key in text format")),
new pki_export(23, asym_key, "pub" ,tr("SSH2 public"), F_SSH2, tr("The public key encoded in SSH2 format")),
new pki_export(24, asym_key, "der", tr("DER public"), F_DER | F_SINGLE, tr("Binary DER format of the public key")),

View File

@ -51,6 +51,7 @@ enum {
F_OVPN = BIT(20),/* OpenVPN format */
F_CONFIG = BIT(21),/* OpenSSL config format */
F_TAKEY = BIT(22),/* OpenVPN TLS-Auth key */
F_TRADITION = BIT(23),/* Traditional OpenSSL encrypted PEM */
};
class pki_export : public QObject {