summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/key.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2000-08-19 21:34:42 +0000
committermarkus <markus@openbsd.org>2000-08-19 21:34:42 +0000
commit7aabec31c969fece6a14582d67cd23f088c55101 (patch)
tree1c7d97f9accf941c83770b5c2cc0077207108c4e /usr.bin/ssh/key.c
parentproper prototype (diff)
downloadwireguard-openbsd-7aabec31c969fece6a14582d67cd23f088c55101.tar.xz
wireguard-openbsd-7aabec31c969fece6a14582d67cd23f088c55101.zip
add SSH2/DSA support to the agent and some other DSA related cleanups.
(note that we cannot talk to ssh.com's ssh2 agents)
Diffstat (limited to 'usr.bin/ssh/key.c')
-rw-r--r--usr.bin/ssh/key.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index 764f1f227fb..f2ce75e7f1f 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/key.c
@@ -41,7 +41,7 @@
#include "dsa.h"
#include "uuencode.h"
-RCSID("$OpenBSD: key.c,v 1.9 2000/06/22 23:55:00 djm Exp $");
+RCSID("$OpenBSD: key.c,v 1.10 2000/08/19 21:34:43 markus Exp $");
#define SSH_DSS "ssh-dss"
@@ -335,3 +335,15 @@ key_type(Key *k)
}
return "unknown";
}
+unsigned int
+key_size(Key *k){
+ switch (k->type) {
+ case KEY_RSA:
+ return BN_num_bits(k->rsa->n);
+ break;
+ case KEY_DSA:
+ return BN_num_bits(k->dsa->p);
+ break;
+ }
+ return 0;
+}