diff options
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -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" |
17 | RCSID("$Id: ssh-add.c,v 1.8 1999/11/15 06:10:57 damien Exp $"); | 17 | RCSID("$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 | |||
133 | list_identities(AuthenticationConnection *ac) | 133 | list_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 | } |