From c7a30a02722c393f506e91e36a4d0563ff5dcf65 Mon Sep 17 00:00:00 2001 From: logan Date: Sun, 20 Apr 2014 09:24:26 +0000 Subject: [PATCH] Add support for SSHFP DNS records for ED25519 key types. OK from djm@ --- usr.bin/ssh/dns.c | 7 ++++++- usr.bin/ssh/dns.h | 5 +++-- usr.bin/ssh/ssh-keygen.c | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/usr.bin/ssh/dns.c b/usr.bin/ssh/dns.c index 08827216fbd..0ce7db4a8fc 100644 --- a/usr.bin/ssh/dns.c +++ b/usr.bin/ssh/dns.c @@ -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 */ diff --git a/usr.bin/ssh/dns.h b/usr.bin/ssh/dns.h index d5f42817780..b9feae6bef6 100644 --- a/usr.bin/ssh/dns.h +++ b/usr.bin/ssh/dns.h @@ -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 { diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c index 886bd1aa9d8..ad27fcda54c 100644 --- a/usr.bin/ssh/ssh-keygen.c +++ b/usr.bin/ssh/ssh-keygen.c @@ -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 * Copyright (c) 1994 Tatu Ylonen , 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); -- 2.20.1