summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r--usr.bin/ssh/ssh-add.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index ca3afa5d4a3..75e584b2cdd 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -14,7 +14,7 @@ Adds an identity to the authentication server, or removes an identity.
*/
#include "includes.h"
-RCSID("$Id: ssh-add.c,v 1.9 1999/11/14 17:53:48 markus Exp $");
+RCSID("$Id: ssh-add.c,v 1.10 1999/11/15 20:53:24 markus Exp $");
#include "rsa.h"
#include "ssh.h"
@@ -106,33 +106,32 @@ void
list_identities(AuthenticationConnection *ac)
{
BIGNUM *e, *n;
- int bits, status;
+ int status;
char *comment;
int had_identities;
e = BN_new();
n = BN_new();
had_identities = 0;
- for (status = ssh_get_first_identity(ac, &bits, e, n, &comment);
+ for (status = ssh_get_first_identity(ac, e, n, &comment);
status;
- status = ssh_get_next_identity(ac, &bits, e, n, &comment))
+ status = ssh_get_next_identity(ac, e, n, &comment))
{
- char *buf;
+ char *ebuf, *nbuf;
had_identities = 1;
- printf("%d ", bits);
- buf = BN_bn2dec(e);
- if (buf != NULL) {
- printf("%s ", buf);
- free (buf);
- } else {
- error("list_identities: BN_bn2dec #1 failed.");
- }
- buf = BN_bn2dec(n);
- if (buf != NULL) {
- printf("%s %s\n", buf, comment);
- free (buf);
- } else {
- error("list_identities: BN_bn2dec #2 failed.");
+ ebuf = BN_bn2dec(e);
+ if (ebuf == NULL) {
+ error("list_identities: BN_bn2dec(e) failed.");
+ }else{
+ nbuf = BN_bn2dec(n);
+ if (nbuf == NULL) {
+ error("list_identities: BN_bn2dec(n) failed.");
+ }else{
+ unsigned int bits = BN_num_bits(n);
+ printf("%d %s %s %s\n", bits, ebuf, nbuf, comment);
+ free(nbuf);
+ }
+ free(ebuf);
}
xfree(comment);
}