From 0dcf517700387e75ce46c28993f882031e34c816 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Mon, 12 Sep 2011 20:13:19 -0400 Subject: Allow no protection in pinentry-mode=loopback. When the inquired passphrase has a 0 length then treat it as no protection. --- agent/genkey.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'agent/genkey.c') diff --git a/agent/genkey.c b/agent/genkey.c index b02268497..20b9230bd 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -313,8 +313,13 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, err = pinentry_loopback(ctrl, "NEW_PASSPHRASE", &buffer, &size, len); if (!err) { - buffer[size] = 0; - *r_passphrase = buffer; + if (size) + { + buffer[size] = 0; + *r_passphrase = buffer; + } + else + *r_passphrase = NULL; } return err; } -- cgit v1.2.3