Page MenuHome GnuPG

644_0001-Show-passphrase-constraints-errors-as-password-promp.patch
AbandonedPublic

Authored by neal on Jun 18 2015, 12:20 PM.

Details

Reviewers
None
Summary

From 3cee20e5d01fb1b1e90a77f971ebacf94ce1c65a Mon Sep 17 00:00:00 2001
From: "Neal H. Walfield" <neal@gnu.org>
Date: Thu, 18 Jun 2015 00:10:47 -0300
Subject: [PATCH] Show passphrase constraints errors as password prompt errors

  • agent/agent.h (check_passphrase_constraints): Add parameter

failed_constraint and remove parameter silent. Update callers.

  • agent/genkey.c (check_passphrase_constraints): Add parameter

failed_constraint and remove parameter silent. If FAILED_CONSTRAINT
is not NULL and OPT.ENFORCE_PASSPHRASE_CONSTRAINTS is FALSE, save the
error text in *FAILED_CONSTRAINT and don't call take_this_one_anyway
or take_this_one_anyway2. If FAILED_CONSTRAINT is NULL, act as if
SILENT was set.
(agent_ask_new_passphrase): Change initial_errtext's type from a const
char * to a char *. Pass it to check_passphrase_constraints. If it
contains malloc's memory, free it.

Signed-off-by: Neal H. Walfield <neal@g10code.com>

Based on a patch provided by Watson Yuuma Sato <yuuma.sato@gmail.com>

in issue 2018.

agent/agent.h | 4 +++-
agent/call-pinentry.c | 2 +-
agent/command.c | 16 +++++++++-------
agent/genkey.c | 52 +++++++++++++++++++++++++++++++++++----------------
4 files changed, 49 insertions(+), 25 deletions(-)

2.1.4

Test Plan

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped