summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-add.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2000-11-12 19:50:37 +0000
committermarkus <markus@openbsd.org>2000-11-12 19:50:37 +0000
commit34713819b5dc9d8159a1bb9c8a84be3b251d101b (patch)
tree622ede4c7997c9ffa8a38ae41ae74bd17e74be64 /usr.bin/ssh/ssh-add.c
parentFix XFree86/console mouse transparency for serial mice. Tested with both a (diff)
downloadwireguard-openbsd-34713819b5dc9d8159a1bb9c8a84be3b251d101b.tar.xz
wireguard-openbsd-34713819b5dc9d8159a1bb9c8a84be3b251d101b.zip
add support for RSA to SSH2. please test.
there are now 3 types of keys: RSA1 is used by ssh-1 only, RSA and DSA are used by SSH2. you can use 'ssh-keygen -t rsa -f ssh2_rsa_file' to generate RSA keys for SSH2 and use the RSA keys for hostkeys or for user keys. SSH2 RSA or DSA keys are added to .ssh/authorised_keys2 as before. IdentityFile2, HostDsaKey and DSAAuthentication are obsolete. you can use multiple IdentityFile and HostKey for all types of keys. the option DSAAuthentication is replaced by PubkeyAuthetication.
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r--usr.bin/ssh/ssh-add.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index 4b33f965447..3ab47fb2343 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-add.c,v 1.22 2000/09/07 20:27:54 deraadt Exp $");
+RCSID("$OpenBSD: ssh-add.c,v 1.23 2000/11/12 19:50:38 markus Exp $");
#include <openssl/evp.h>
#include <openssl/rsa.h>
@@ -54,10 +54,10 @@ delete_file(AuthenticationConnection *ac, const char *filename)
Key *public;
char *comment;
- public = key_new(KEY_RSA);
+ public = key_new(KEY_RSA1);
if (!load_public_key(filename, public, &comment)) {
key_free(public);
- public = key_new(KEY_DSA);
+ public = key_new(KEY_UNSPEC);
if (!try_load_public_key(filename, public, &comment)) {
printf("Bad key file %s\n", filename);
return;
@@ -136,7 +136,7 @@ add_file(AuthenticationConnection *ac, const char *filename)
char buf[1024], msg[1024];
int success;
int interactive = isatty(STDIN_FILENO);
- int type = KEY_RSA;
+ int type = KEY_RSA1;
if (stat(filename, &st) < 0) {
perror(filename);
@@ -146,10 +146,10 @@ add_file(AuthenticationConnection *ac, const char *filename)
* try to load the public key. right now this only works for RSA,
* since DSA keys are fully encrypted
*/
- public = key_new(KEY_RSA);
+ public = key_new(KEY_RSA1);
if (!load_public_key(filename, public, &saved_comment)) {
- /* ok, so we will asume this is a DSA key */
- type = KEY_DSA;
+ /* ok, so we will assume this is 'some' key */
+ type = KEY_UNSPEC;
saved_comment = xstrdup(filename);
}
key_free(public);
@@ -215,8 +215,9 @@ list_identities(AuthenticationConnection *ac, int fp)
key = ssh_get_next_identity(ac, &comment, version)) {
had_identities = 1;
if (fp) {
- printf("%d %s %s\n",
- key_size(key), key_fingerprint(key), comment);
+ printf("%d %s %s (%s)\n",
+ key_size(key), key_fingerprint(key),
+ comment, key_type(key));
} else {
if (!key_write(key, stdout))
fprintf(stderr, "key_write failed");
@@ -240,15 +241,6 @@ main(int argc, char **argv)
int i;
int deleting = 0;
- /* check if RSA support exists */
- if (rsa_alive() == 0) {
- extern char *__progname;
-
- fprintf(stderr,
- "%s: no RSA support in libssl and libcrypto. See ssl(8).\n",
- __progname);
- exit(1);
- }
SSLeay_add_all_algorithms();
/* At first, get a connection to the authentication agent. */