From a0a4bfc5100dd9576810a74989926a22be10b8b0 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 25 Jul 2015 18:17:59 -0400 Subject: [PATCH] Fix "s2k_count" configuration parameter. --- NEWS | 2 ++ src/commands.c | 7 ++++++- src/rcfile.c | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2b8a0bb9..93c76566 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ Behaves like --reset but doesn't clear the cache entry. PASSWD now kills the scdaemon if enabled in the configuration ("kill_scd"). +Fixed the "s2k_count" configuration parameter. + PWMD v3.0.15 ------------ diff --git a/src/commands.c b/src/commands.c index 52b6b8d6..60b10f41 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1141,7 +1141,12 @@ save_command (assuan_context_t ctx, char *line) && client->crypto->save.hdr.s2k_count < DEFAULT_KDFS2K_ITERATIONS) || !client->crypto->save.hdr.s2k_count) #endif - client->crypto->save.hdr.s2k_count = DEFAULT_KDFS2K_ITERATIONS; + { + client->crypto->save.hdr.s2k_count = + config_get_ulonglong (client->filename, "s2k_count"); + if (!client->crypto->save.hdr.s2k_count) + client->crypto->save.hdr.s2k_count = DEFAULT_KDFS2K_ITERATIONS; + } /* Deal with the hashed vs non-hashed cached key mess by clearing the cached * key entry. */ diff --git a/src/rcfile.c b/src/rcfile.c index 4e67d3ea..2b1095e7 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -87,6 +87,7 @@ static struct config_params_s { "kill_scd", PARAM_BOOL, "false"}, { "cipher_iterations", PARAM_ULONGLONG, "0"}, { "cipher_progress", PARAM_LONG, DEFAULT_ITERATION_PROGRESS}, + { "s2k_count", PARAM_ULONGLONG, "0"}, { "priority", PARAM_INT, INVALID_PRIORITY}, { "keepalive_interval", PARAM_INT, DEFAULT_KEEPALIVE_INTERVAL}, { "tcp_port", PARAM_INT, "6466"}, -- 2.11.4.GIT