kwalletd: use definition to check the password hash size

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-03-29 18:34:26 +03:00
parent 4d67708b98
commit df4c601719
3 changed files with 4 additions and 3 deletions

View file

@ -147,7 +147,7 @@ int Backend::openPreHashed(const QByteArray &passwordHash)
}
// check the password hash for correct size (currently fixed)
if (passwordHash.size() != 20 && passwordHash.size() != 128) {
if (passwordHash.size() != KWALLET_SHA512_KEYSIZE) {
return -42; // unsupported encryption scheme
}

View file

@ -28,6 +28,8 @@
#include "kwalletentry.h"
#include "backendpersisthandler.h"
#define KWALLET_SHA512_KEYSIZE 128
namespace KWallet {
/**

View file

@ -32,10 +32,9 @@
#include <sys/un.h>
#include <unistd.h>
#include "kwalletd.h"
#include "backend/kwalletbackend.h" //For the hash size
#include "backend/kwalletbackend.h" // For the hash size
#define BSIZE 1000
#define KWALLET_SHA512_KEYSIZE 128
static int pipefd = 0;
static int socketfd = 0;