summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 3adc2509f..f49d13fb5 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: ssh-add.c,v 1.22 2000/09/07 20:27:54 deraadt Exp $"); 38RCSID("$OpenBSD: ssh-add.c,v 1.23 2000/11/12 19:50:38 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41#include <openssl/rsa.h> 41#include <openssl/rsa.h>
@@ -60,10 +60,10 @@ delete_file(AuthenticationConnection *ac, const char *filename)
60 Key *public; 60 Key *public;
61 char *comment; 61 char *comment;
62 62
63 public = key_new(KEY_RSA); 63 public = key_new(KEY_RSA1);
64 if (!load_public_key(filename, public, &comment)) { 64 if (!load_public_key(filename, public, &comment)) {
65 key_free(public); 65 key_free(public);
66 public = key_new(KEY_DSA); 66 public = key_new(KEY_UNSPEC);
67 if (!try_load_public_key(filename, public, &comment)) { 67 if (!try_load_public_key(filename, public, &comment)) {
68 printf("Bad key file %s\n", filename); 68 printf("Bad key file %s\n", filename);
69 return; 69 return;
@@ -144,7 +144,7 @@ add_file(AuthenticationConnection *ac, const char *filename)
144 char buf[1024], msg[1024]; 144 char buf[1024], msg[1024];
145 int success; 145 int success;
146 int interactive = isatty(STDIN_FILENO); 146 int interactive = isatty(STDIN_FILENO);
147 int type = KEY_RSA; 147 int type = KEY_RSA1;
148 148
149 if (stat(filename, &st) < 0) { 149 if (stat(filename, &st) < 0) {
150 perror(filename); 150 perror(filename);
@@ -154,10 +154,10 @@ add_file(AuthenticationConnection *ac, const char *filename)
154 * try to load the public key. right now this only works for RSA, 154 * try to load the public key. right now this only works for RSA,
155 * since DSA keys are fully encrypted 155 * since DSA keys are fully encrypted
156 */ 156 */
157 public = key_new(KEY_RSA); 157 public = key_new(KEY_RSA1);
158 if (!load_public_key(filename, public, &saved_comment)) { 158 if (!load_public_key(filename, public, &saved_comment)) {
159 /* ok, so we will asume this is a DSA key */ 159 /* ok, so we will assume this is 'some' key */
160 type = KEY_DSA; 160 type = KEY_UNSPEC;
161 saved_comment = xstrdup(filename); 161 saved_comment = xstrdup(filename);
162 } 162 }
163 key_free(public); 163 key_free(public);
@@ -223,8 +223,9 @@ list_identities(AuthenticationConnection *ac, int fp)
223 key = ssh_get_next_identity(ac, &comment, version)) { 223 key = ssh_get_next_identity(ac, &comment, version)) {
224 had_identities = 1; 224 had_identities = 1;
225 if (fp) { 225 if (fp) {
226 printf("%d %s %s\n", 226 printf("%d %s %s (%s)\n",
227 key_size(key), key_fingerprint(key), comment); 227 key_size(key), key_fingerprint(key),
228 comment, key_type(key));
228 } else { 229 } else {
229 if (!key_write(key, stdout)) 230 if (!key_write(key, stdout))
230 fprintf(stderr, "key_write failed"); 231 fprintf(stderr, "key_write failed");
@@ -250,13 +251,6 @@ main(int argc, char **argv)
250 251
251 init_rng(); 252 init_rng();
252 253
253 /* check if RSA support exists */
254 if (rsa_alive() == 0) {
255 fprintf(stderr,
256 "%s: no RSA support in libssl and libcrypto. See ssl(8).\n",
257 __progname);
258 exit(1);
259 }
260 SSLeay_add_all_algorithms(); 254 SSLeay_add_all_algorithms();
261 255
262 /* At first, get a connection to the authentication agent. */ 256 /* At first, get a connection to the authentication agent. */