summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-16 13:37:16 +1100
committerDamien Miller <djm@mindrot.org>1999-11-16 13:37:16 +1100
commit7e8e820153a620ab1dcd81857a7de0969c41d043 (patch)
tree226cc4185feae97f4069ad60b4c18d259aa5df2f /ssh-add.c
parent4874c79a3a05fc18678d7a85d7091f5139630fac (diff)
- Merged OpenBSD CVS changes:
- [auth-rh-rsa.c auth-rsa.c authfd.c authfd.h hostfile.c mpaux.c] [mpaux.h ssh-add.c ssh-agent.c ssh.h ssh.c sshd.c] the keysize of rsa-parameter 'n' is passed implizit, a few more checks and warnings about 'pretended' keysizes. - [cipher.c cipher.h packet.c packet.h sshd.c] remove support for cipher RC4 - [ssh.c] a note for legay systems about secuity issues with permanently_set_uid(), the private hostkey and ptrace() - [sshconnect.c] more detailed messages about adding and checking hostkeys
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 0f01d5dfd..2a0f0de98 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -14,7 +14,7 @@ Adds an identity to the authentication server, or removes an identity.
14*/ 14*/
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$Id: ssh-add.c,v 1.8 1999/11/15 06:10:57 damien Exp $"); 17RCSID("$Id: ssh-add.c,v 1.9 1999/11/16 02:37:16 damien Exp $");
18 18
19#include "rsa.h" 19#include "rsa.h"
20#include "ssh.h" 20#include "ssh.h"
@@ -133,33 +133,32 @@ void
133list_identities(AuthenticationConnection *ac) 133list_identities(AuthenticationConnection *ac)
134{ 134{
135 BIGNUM *e, *n; 135 BIGNUM *e, *n;
136 int bits, status; 136 int status;
137 char *comment; 137 char *comment;
138 int had_identities; 138 int had_identities;
139 139
140 e = BN_new(); 140 e = BN_new();
141 n = BN_new(); 141 n = BN_new();
142 had_identities = 0; 142 had_identities = 0;
143 for (status = ssh_get_first_identity(ac, &bits, e, n, &comment); 143 for (status = ssh_get_first_identity(ac, e, n, &comment);
144 status; 144 status;
145 status = ssh_get_next_identity(ac, &bits, e, n, &comment)) 145 status = ssh_get_next_identity(ac, e, n, &comment))
146 { 146 {
147 char *buf; 147 char *ebuf, *nbuf;
148 had_identities = 1; 148 had_identities = 1;
149 printf("%d ", bits); 149 ebuf = BN_bn2dec(e);
150 buf = BN_bn2dec(e); 150 if (ebuf == NULL) {
151 if (buf != NULL) { 151 error("list_identities: BN_bn2dec(e) failed.");
152 printf("%s ", buf); 152 }else{
153 free (buf); 153 nbuf = BN_bn2dec(n);
154 } else { 154 if (nbuf == NULL) {
155 error("list_identities: BN_bn2dec #1 failed."); 155 error("list_identities: BN_bn2dec(n) failed.");
156 } 156 }else{
157 buf = BN_bn2dec(n); 157 unsigned int bits = BN_num_bits(n);
158 if (buf != NULL) { 158 printf("%d %s %s %s\n", bits, ebuf, nbuf, comment);
159 printf("%s %s\n", buf, comment); 159 free(nbuf);
160 free (buf); 160 }
161 } else { 161 free(ebuf);
162 error("list_identities: BN_bn2dec #2 failed.");
163 } 162 }
164 xfree(comment); 163 xfree(comment);
165 } 164 }