diff options
author | saturneric <[email protected]> | 2024-07-29 19:29:56 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-29 19:29:56 +0000 |
commit | fa90ec4b5315b9e70a44a9625c143ce253f0e885 (patch) | |
tree | 8ffa82e33522de03974d6d0289aa831b4fd6ebdf /src/core/model/GpgGenKeyInfo.cpp | |
parent | fix: correct urls at appdata.xml (diff) | |
parent | Merge branch 'develop' of github.com:saturneric/GpgFrontend into develop (diff) | |
download | GpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.tar.gz GpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.zip |
Merge branch 'develop'
Diffstat (limited to 'src/core/model/GpgGenKeyInfo.cpp')
-rw-r--r-- | src/core/model/GpgGenKeyInfo.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/core/model/GpgGenKeyInfo.cpp b/src/core/model/GpgGenKeyInfo.cpp index d7daa852..47451253 100644 --- a/src/core/model/GpgGenKeyInfo.cpp +++ b/src/core/model/GpgGenKeyInfo.cpp @@ -30,13 +30,10 @@ #include <cassert> -#include "core/utils/LogUtils.h" - namespace GpgFrontend { void GenKeyInfo::SetAlgo(const QString &t_algo_args) { auto algo_args = t_algo_args.toLower(); - GF_CORE_LOG_DEBUG("set algo args: {}", algo_args); // reset all options reset_options(); @@ -74,6 +71,28 @@ void GenKeyInfo::SetAlgo(const QString &t_algo_args) { suggest_max_key_size_ = 3072; suggest_size_addition_step_ = 1024; SetKeyLength(2048); + } else if (algo_args == "elg") { + /** + * Algorithm (DSA) as a government standard for digital signatures. + * Originally, it supported key lengths between 512 and 1024 bits. + * Recently, NIST has declared 512-bit keys obsolete: + * now, DSA is available in 1024, 2048 and 3072-bit lengths. + */ + SetAllowEncryption(true); + + SetAllowAuthentication(false); + allow_change_authentication_ = false; + + SetAllowSigning(false); + allow_change_signing_ = false; + + SetAllowCertification(false); + allow_change_certification_ = false; + + suggest_min_key_size_ = 1024; + suggest_max_key_size_ = 4096; + suggest_size_addition_step_ = 1024; + SetKeyLength(3072); } else if (algo_args == "ed25519") { /** @@ -105,7 +124,7 @@ void GenKeyInfo::SetAlgo(const QString &t_algo_args) { suggest_size_addition_step_ = -1; SetKeyLength(-1); } else { - SPDLOG_ERROR("unsupported genkey algo arguments: {}", algo_args); + qCWarning(core) << "unsupported genkey algo arguments: " << algo_args; return; } @@ -189,6 +208,7 @@ auto GenKeyInfo::GetSupportedSubkeyAlgo() static const std::vector<GenKeyInfo::KeyGenAlgo> kSupportSubkeyAlgo = { {"RSA", "", "RSA"}, {"DSA", "", "DSA"}, + {"ELG-E", "", "ELG"}, {"ECDSA", "", "ED25519"}, {"ECDH", "", "CV25519"}, {"ECDH NIST P-256", "", "NISTP256"}, |