*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-add.c,v 1.67 2003/06/11 11:18:38 djm Exp $");
+RCSID("$OpenBSD: ssh-add.c,v 1.71 2005/03/10 22:01:06 deraadt Exp $");
#include <openssl/evp.h>
#include "authfd.h"
#include "authfile.h"
#include "pathnames.h"
-#include "readpass.h"
#include "misc.h"
-#ifdef HAVE___PROGNAME
-extern char *__progname;
-#else
-char *__progname;
-#endif
-
/* argv0 */
extern char *__progname;
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);
}
}
- if (ssh_add_identity_constrained(ac, private, comment, lifetime,
- confirm)) {
+ if (ssh_add_identity_constrained(ac, private, comment, lifetime,
+ confirm)) {
fprintf(stderr, "Identity added: %s (%s)\n", filename, comment);
ret = 0;
if (lifetime != 0)
fprintf(stderr,
"Lifetime set to %d seconds\n", lifetime);
- if (confirm != 0)
+ if (confirm != 0)
fprintf(stderr,
"The user has to confirm each use of the key\n");
} else if (ssh_add_identity(ac, private, comment)) {
char *sc_reader_id = NULL;
int i, ch, deleting = 0, ret = 0;
- __progname = get_progname(argv[0]);
+ __progname = ssh_get_progname(argv[0]);
init_rng();
seed_rng();
goto done;
}
- for(i = 0; default_files[i]; i++) {
+ for (i = 0; default_files[i]; i++) {
snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir,
default_files[i]);
if (stat(buf, &st) < 0)
if (count == 0)
ret = 1;
} else {
- for(i = 0; i < argc; i++) {
+ for (i = 0; i < argc; i++) {
if (do_file(ac, deleting, argv[i]) == -1)
ret = 1;
}