diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-17 18:11:36 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-17 18:11:36 +0000 |
commit | 982dbbcfda7ab9e56c4caccfba6f8920529421b7 (patch) | |
tree | 1c7d3ed45ad2f89c2e0009a188b76e6171d593a2 /key.c | |
parent | 4c8cff14ddac08f1bdb393d71d9e0907d9a9215e (diff) |
- markus@cvs.openbsd.org 2001/04/17 10:53:26
[key.c key.h readconf.c readconf.h ssh.1 sshconnect2.c]
add HostKeyAlgorithms; based on patch from res@shore.net; ok provos@
Diffstat (limited to 'key.c')
-rw-r--r-- | key.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -32,7 +32,7 @@ | |||
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | 33 | */ |
34 | #include "includes.h" | 34 | #include "includes.h" |
35 | RCSID("$OpenBSD: key.c,v 1.24 2001/04/16 08:26:04 deraadt Exp $"); | 35 | RCSID("$OpenBSD: key.c,v 1.25 2001/04/17 10:53:24 markus Exp $"); |
36 | 36 | ||
37 | #include <openssl/evp.h> | 37 | #include <openssl/evp.h> |
38 | 38 | ||
@@ -629,6 +629,28 @@ key_type_from_name(char *name) | |||
629 | return KEY_UNSPEC; | 629 | return KEY_UNSPEC; |
630 | } | 630 | } |
631 | 631 | ||
632 | int | ||
633 | key_names_valid2(const char *names) | ||
634 | { | ||
635 | char *s, *cp, *p; | ||
636 | |||
637 | if (names == NULL || strcmp(names, "") == 0) | ||
638 | return 0; | ||
639 | s = cp = xstrdup(names); | ||
640 | for ((p = strsep(&cp, ",")); p && *p != '\0'; | ||
641 | (p = strsep(&cp, ","))) { | ||
642 | switch (key_type_from_name(p)) { | ||
643 | case KEY_RSA1: | ||
644 | case KEY_UNSPEC: | ||
645 | xfree(s); | ||
646 | return 0; | ||
647 | } | ||
648 | } | ||
649 | debug3("key names ok: [%s]", names); | ||
650 | xfree(s); | ||
651 | return 1; | ||
652 | } | ||
653 | |||
632 | Key * | 654 | Key * |
633 | key_from_blob(char *blob, int blen) | 655 | key_from_blob(char *blob, int blen) |
634 | { | 656 | { |