commit 826f4993ed2cfa897929a1de238f115211d0a023
parent 89f10851a3bc0edb433b74ffe0fa4c0ab91a7af8
Author: lash <dev@holbrook.no>
Date: Fri, 4 Apr 2025 02:44:15 +0100
Retrieve by fingerprint fix
Diffstat:
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/crypto/gcrypt.c b/src/crypto/gcrypt.c
@@ -547,7 +547,7 @@ static int key_create_store(struct gpg_store *gpg, const char *passphrase, size_
}
// Write the ciphertext to the store.
- l = c + CHACHA20_NONCE_LENGTH_BYTES + POLY1305_MAC_LEN;
+ l = c + POLY1305_MAC_LEN;
c = LQ_FP_LEN;
r = store->put(LQ_CONTENT_KEY, store, buf_key, &c, buf_val, l);
if (r) {
diff --git a/src/test/Makefile b/src/test/Makefile
@@ -7,7 +7,10 @@ LIBS := ../asn1/defs_asn1_tab.o `pkg-config --libs libtasn1 libgcrypt` -L.. -L..
LDFLAGS := -lcheck $(LIBS)
COMMONOBJS = ../mem/std.o ../lq/config.o ../lq/err.o ../lq/base.o ../debug.o
-all: build
+all: build all-tests
+#all: build one-test
+
+all-tests:
cK_FORK=no LD_LIBRARY_PATH=`realpath ../aux/lib` ./test_test_bin
CK_FORK=no LD_LIBRARY_PATH=`realpath ../aux/lib` ./test_debug_bin
CK_FORK=no LD_LIBRARY_PATH=`realpath ../aux/lib` ./test_config_bin
@@ -17,6 +20,9 @@ all: build
CK_FORK=no LD_LIBRARY_PATH=`realpath ../aux/lib` ./test_trust_bin
CK_FORK=no LD_LIBRARY_PATH=`realpath ../aux/lib` ./test_store_bin
+one-test: build
+ CK_FORK=no LD_LIBRARY_PATH=`realpath ../aux/lib` ./test_crypto_bin
+
test: all
build:
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
@@ -145,8 +145,8 @@ START_TEST(check_load_specific) {
ck_assert_ptr_nonnull(pubk);
c = lq_publickey_fingerprint(pubk, &p);
ck_assert_int_gt(c, 0);
- pk_load = lq_privatekey_load(passphrase, passphrase_len, NULL);
- ck_assert_ptr_nonnull(pk_load);
+ //pk_load = lq_privatekey_load(passphrase, passphrase_len, NULL);
+ //ck_assert_ptr_nonnull(pk_load);
pk_load = lq_privatekey_load(passphrase, passphrase_len, p);
ck_assert_ptr_nonnull(pk_load);