Bug 522

Summary: terse message prompt when ssh-add fails
Product: Portable OpenSSH Reporter: Federico Grau <donfede>
Component: ssh-addAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: enhancement    
Priority: P2    
Version: -current   
Hardware: All   
OS: All   
Attachments:
Description Flags
a simple fix none

Description Federico Grau 2003-03-27 15:49:25 AEDT
I (and surely others) have multiple keys which I add to my ssh-agent
upon starting X.  I use ssh-askpass to display a pretty password prompt,
and it normally works very well.  Unfortunately, the "error" or "retry"
message prompted when a passphrase is incorrectly entered, does not
RE-display the key to which the passphrase is being entered.  It can be
difficult to tell which key the passphrase prompt was for.

Below is a simple patch to solve this problem.  The solution lies with ssh-add,
since ssh-askpass is simply passing the text to the user.

thanks,
donfede

####################


donfede@xwing:~/projects/hack_ssh-agent/openssh$ cvs diff -u ssh-add.c 
Index: ssh-add.c
===================================================================
RCS file: /cvs/openssh/ssh-add.c,v
retrieving revision 1.71
diff -u -r1.71 ssh-add.c
--- ssh-add.c   10 Mar 2003 00:21:18 -0000      1.71
+++ ssh-add.c   27 Mar 2003 04:36:59 -0000
@@ -164,7 +164,8 @@
                        if (private != NULL)
                                break;
                        clear_pass();
-                       strlcpy(msg, "Bad passphrase, try again: ", sizeof msg);
+                       snprintf(msg, sizeof msg, "Bad passphrase, try again for
%.200s: ",
+                          comment);
                }
        }
Comment 1 Federico Grau 2003-03-27 15:52:40 AEDT
Created attachment 262 [details]
a simple fix

Here is the same patch, but in an attachment (the web form munged of the
lines).
Comment 2 Colin Watson 2003-04-02 11:19:27 AEST
I suggest "Bad passphrase for %.200s, try again" instead of "Bad passphrase, try
again for %.200s".
Comment 3 Damien Miller 2003-07-03 18:18:07 AEST
fixed in -current
Comment 4 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED