mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
SSH Agent: use SSH_MAX_LOCAL_KEY_SIZE define for cert+key size checks
- Add #define SSH_MAX_LOCAL_KEY_SIZE (1 MiB) in KeeAgentSettings.h - Replace magic value "1024 * 1024" with this constant
This commit is contained in:
parent
b7168f6c4e
commit
3d9ef5c4ed
2 changed files with 4 additions and 2 deletions
|
|
@ -568,7 +568,7 @@ bool KeeAgentSettings::toOpenSSHKey(const QString& username,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (localFile.size() > 1024 * 1024) {
|
||||
if (localFile.size() > SSH_MAX_LOCAL_KEY_SIZE) {
|
||||
m_error = QCoreApplication::translate("KeeAgentSettings", "File too large to be a private key");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -634,7 +634,7 @@ bool KeeAgentSettings::toOpenSSHKey(const QString& username,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (localCertificateFile.size() > 1024 * 1024) {
|
||||
if (localCertificateFile.size() > SSH_MAX_LOCAL_KEY_SIZE) {
|
||||
m_error = QCoreApplication::translate("KeeAgentSettings", "File too large to be a certificate");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include <QProcessEnvironment>
|
||||
|
||||
#define SSH_MAX_LOCAL_KEY_SIZE (1024 * 1024)
|
||||
|
||||
class Entry;
|
||||
class EntryAttachments;
|
||||
class OpenSSHKey;
|
||||
|
|
|
|||
Loading…
Reference in a new issue