Add support for SSHFP DNS records for ED25519 key types.
authorlogan <logan@openbsd.org>
Sun, 20 Apr 2014 09:24:26 +0000 (09:24 +0000)
committerlogan <logan@openbsd.org>
Sun, 20 Apr 2014 09:24:26 +0000 (09:24 +0000)
OK from djm@

usr.bin/ssh/dns.c
usr.bin/ssh/dns.h
usr.bin/ssh/ssh-keygen.c

index 0882721..0ce7db4 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.c,v 1.29 2013/05/17 00:13:13 djm Exp $ */
+/* $OpenBSD: dns.c,v 1.30 2014/04/20 09:24:26 logan Exp $ */
 
 /*
  * Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -93,6 +93,11 @@ dns_read_key(u_int8_t *algorithm, u_int8_t *digest_type,
                if (!*digest_type)
                        *digest_type = SSHFP_HASH_SHA256;
                break;
+       case KEY_ED25519:
+               *algorithm = SSHFP_KEY_ED25519;
+               if (!*digest_type)
+                       *digest_type = SSHFP_HASH_SHA256;
+               break;
        default:
                *algorithm = SSHFP_KEY_RESERVED; /* 0 */
                *digest_type = SSHFP_HASH_RESERVED; /* 0 */
index d5f4281..b9feae6 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.h,v 1.12 2012/05/23 03:28:28 djm Exp $ */
+/* $OpenBSD: dns.h,v 1.13 2014/04/20 09:24:26 logan Exp $ */
 
 /*
  * Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -32,7 +32,8 @@ enum sshfp_types {
        SSHFP_KEY_RESERVED = 0,
        SSHFP_KEY_RSA = 1,
        SSHFP_KEY_DSA = 2,
-       SSHFP_KEY_ECDSA = 3
+       SSHFP_KEY_ECDSA = 3,
+       SSHFP_KEY_ED25519 = 4 
 };
 
 enum sshfp_hashes {
index 886bd1a..ad27fcd 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.243 2014/03/15 17:28:26 deraadt Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.244 2014/04/20 09:24:26 logan Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2479,7 +2479,8 @@ main(int argc, char **argv)
                            _PATH_HOST_DSA_KEY_FILE, rr_hostname);
                        n += do_print_resource_record(pw,
                            _PATH_HOST_ECDSA_KEY_FILE, rr_hostname);
-
+                       n += do_print_resource_record(pw,
+                           _PATH_HOST_ED25519_KEY_FILE, rr_hostname);
                        if (n == 0)
                                fatal("no keys found.");
                        exit(0);