summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/key.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-04-17 10:53:24 +0000
committermarkus <markus@openbsd.org>2001-04-17 10:53:24 +0000
commitb575eeb7de6d5daf64e0b59590bf6687e26155ea (patch)
tree58a848680e7c69ca1d3284db1e00e0ac493cf6ff /usr.bin/ssh/key.c
parenthandle EINTR/EAGAIN on read; ok deraadt@ (diff)
downloadwireguard-openbsd-b575eeb7de6d5daf64e0b59590bf6687e26155ea.tar.xz
wireguard-openbsd-b575eeb7de6d5daf64e0b59590bf6687e26155ea.zip
add HostKeyAlgorithms; based on patch from res@shore.net; ok provos@
Diffstat (limited to 'usr.bin/ssh/key.c')
-rw-r--r--usr.bin/ssh/key.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index fbd9f4efc51..3b9f9f78621 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/key.c
@@ -32,7 +32,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: key.c,v 1.24 2001/04/16 08:26:04 deraadt Exp $");
+RCSID("$OpenBSD: key.c,v 1.25 2001/04/17 10:53:24 markus Exp $");
#include <openssl/evp.h>
@@ -629,6 +629,28 @@ key_type_from_name(char *name)
return KEY_UNSPEC;
}
+int
+key_names_valid2(const char *names)
+{
+ char *s, *cp, *p;
+
+ if (names == NULL || strcmp(names, "") == 0)
+ return 0;
+ s = cp = xstrdup(names);
+ for ((p = strsep(&cp, ",")); p && *p != '\0';
+ (p = strsep(&cp, ","))) {
+ switch (key_type_from_name(p)) {
+ case KEY_RSA1:
+ case KEY_UNSPEC:
+ xfree(s);
+ return 0;
+ }
+ }
+ debug3("key names ok: [%s]", names);
+ xfree(s);
+ return 1;
+}
+
Key *
key_from_blob(char *blob, int blen)
{