components/openssh/patches/024-disable_ed25519.patch
changeset 4503 bf30d46ab06e
parent 4078 7cfcde36f97f
child 5025 bdd7dc7d2af4
equal deleted inserted replaced
4498:ce7fc2376fb0 4503:bf30d46ab06e
     1 #
     1 #
     2 # Per Solaris crypto team recommendation, we need to remove support for
     2 # Per Solaris crypto team recommendation, we need to remove support for
     3 # Curve25519 from OpenSSH.
     3 # Curve25519 from OpenSSH.
     4 #
     4 #
     5 # Patch offered upstream:
     5 # Patch offered upstream but rejected:
     6 #     https://bugzilla.mindrot.org/show_bug.cgi?id=2376
     6 #     https://bugzilla.mindrot.org/show_bug.cgi?id=2376
     7 #
     7 #
     8 diff -pur old/Makefile.in new/Makefile.in
     8 diff -pur old/Makefile.in new/Makefile.in
     9 --- old/Makefile.in	2015-03-31 21:14:02.427499635 -0700
     9 --- old/Makefile.in	2015-05-12 06:57:55.737824435 -0700
    10 +++ new/Makefile.in	2015-04-02 02:30:04.830658823 -0700
    10 +++ new/Makefile.in	2015-05-12 06:57:55.859410671 -0700
    11 @@ -141,7 +141,7 @@ $(SSHDOBJS): Makefile.in config.h
    11 @@ -155,7 +155,7 @@ $(SSHDOBJS): Makefile.in config.h
    12  	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
    12  	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
    13  
    13  
    14  LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
    14  LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
    15 -$(LIBCOMPAT): always
    15 -$(LIBCOMPAT): always
    16 +$(LIBCOMPAT): always libssh.a
    16 +$(LIBCOMPAT): always libssh.a
    17  	(cd openbsd-compat && $(MAKE))
    17  	(cd openbsd-compat && $(MAKE))
    18  always:
    18  always:
    19  
    19  
    20 diff -pur old/authfd.c new/authfd.c
    20 diff -pur old/authfd.c new/authfd.c
    21 --- old/authfd.c	2013-12-28 22:49:56.000000000 -0800
    21 --- old/authfd.c	2015-03-16 22:49:20.000000000 -0700
    22 +++ new/authfd.c	2015-04-01 01:53:06.534109950 -0700
    22 +++ new/authfd.c	2015-05-12 06:57:55.860206664 -0700
    23 @@ -508,8 +508,10 @@ ssh_add_identity_constrained(Authenticat
    23 @@ -569,8 +569,10 @@ ssh_add_identity_constrained(int sock, s
    24  	case KEY_DSA_CERT_V00:
       
    25  	case KEY_ECDSA:
    24  	case KEY_ECDSA:
    26  	case KEY_ECDSA_CERT:
    25  	case KEY_ECDSA_CERT:
       
    26  #endif
    27 +#ifndef WITHOUT_ED25519
    27 +#ifndef WITHOUT_ED25519
    28  	case KEY_ED25519:
    28  	case KEY_ED25519:
    29  	case KEY_ED25519_CERT:
    29  	case KEY_ED25519_CERT:
    30 +#endif /* WITHOUT_ED25519 */
    30 +#endif /* WITHOUT_ED25519 */
    31  		type = constrained ?
    31  		type = constrained ?
    32  		    SSH2_AGENTC_ADD_ID_CONSTRAINED :
    32  		    SSH2_AGENTC_ADD_ID_CONSTRAINED :
    33  		    SSH2_AGENTC_ADD_IDENTITY;
    33  		    SSH2_AGENTC_ADD_IDENTITY;
    34 diff -pur old/authfile.c new/authfile.c
    34 diff -pur old/authfile.c new/authfile.c
    35 --- old/authfile.c	2013-12-28 22:50:15.000000000 -0800
    35 --- old/authfile.c	2015-03-16 22:49:20.000000000 -0700
    36 +++ new/authfile.c	2015-04-01 05:27:03.024708427 -0700
    36 +++ new/authfile.c	2015-05-12 06:57:55.860669228 -0700
    37 @@ -597,9 +597,11 @@ key_private_to_blob(Key *key, Buffer *bl
    37 @@ -446,8 +446,10 @@ sshkey_load_private_cert(int type, const
    38  			    comment, new_format_cipher, new_format_rounds);
       
    39  		}
       
    40  		return key_private_pem_to_blob(key, blob, passphrase, comment);
       
    41 +#ifndef WITHOUT_ED25519
       
    42  	case KEY_ED25519:
       
    43  		return key_private_to_blob2(key, blob, passphrase,
       
    44  		    comment, new_format_cipher, new_format_rounds);
       
    45 +#endif /* WITHOUT_ED25519 */
       
    46  	default:
       
    47  		error("%s: cannot save key type %d", __func__, key->type);
       
    48  		return 0;
       
    49 @@ -1005,8 +1007,10 @@ key_parse_private_type(Buffer *blob, int
       
    50  	case KEY_ECDSA:
       
    51  	case KEY_RSA:
       
    52  		return key_parse_private_pem(blob, type, passphrase, commentp);
       
    53 +#ifndef WITHOUT_ED25519
       
    54  	case KEY_ED25519:
       
    55  		return key_parse_private2(blob, type, passphrase, commentp);
       
    56 +#endif /* WITHOUT_ED25519 */
       
    57  	case KEY_UNSPEC:
       
    58  		if ((k = key_parse_private2(blob, type, passphrase, commentp)))
       
    59  			return k;
       
    60 @@ -1213,7 +1217,9 @@ key_load_private_cert(int type, const ch
       
    61  	case KEY_RSA:
    38  	case KEY_RSA:
    62  	case KEY_DSA:
    39  	case KEY_DSA:
    63  	case KEY_ECDSA:
    40  	case KEY_ECDSA:
       
    41 -	case KEY_ED25519:
       
    42  #endif /* WITH_OPENSSL */
       
    43 +#ifndef WITHOUT_ED25519
       
    44 +	case KEY_ED25519:
       
    45 +#endif /* WITHOUT_ED25519 */
       
    46  	case KEY_UNSPEC:
       
    47  		break;
       
    48  	default:
       
    49 diff -pur old/dns.c new/dns.c
       
    50 --- old/dns.c	2015-03-16 22:49:20.000000000 -0700
       
    51 +++ new/dns.c	2015-05-12 06:57:55.861065113 -0700
       
    52 @@ -100,11 +100,13 @@ dns_read_key(u_int8_t *algorithm, u_int8
       
    53  		if (!*digest_type)
       
    54  			*digest_type = SSHFP_HASH_SHA256;
       
    55  		break;
    64 +#ifndef WITHOUT_ED25519
    56 +#ifndef WITHOUT_ED25519
    65  	case KEY_ED25519:
    57  	case KEY_ED25519:
    66 +#endif /* WITHOUT_ED25519 */
    58  		*algorithm = SSHFP_KEY_ED25519;
    67  		break;
    59  		if (!*digest_type)
       
    60  			*digest_type = SSHFP_HASH_SHA256;
       
    61  		break;
       
    62 +#endif /* WITHOUT_ED25519 */
    68  	default:
    63  	default:
    69  		error("%s: unsupported key type", __func__);
    64  		*algorithm = SSHFP_KEY_RESERVED; /* 0 */
    70 diff -pur old/crypto_api.h new/crypto_api.h
    65  		*digest_type = SSHFP_HASH_RESERVED; /* 0 */
    71 --- old/crypto_api.h	2014-01-16 17:31:34.000000000 -0800
    66 diff -pur old/dns.h new/dns.h
    72 +++ new/crypto_api.h	2015-04-02 00:35:29.952105991 -0700
    67 --- old/dns.h	2015-03-16 22:49:20.000000000 -0700
    73 @@ -26,7 +26,7 @@ int	crypto_hashblocks_sha512(unsigned ch
    68 +++ new/dns.h	2015-05-12 06:57:55.861358245 -0700
    74  
    69 @@ -33,7 +33,9 @@ enum sshfp_types {
    75  #define crypto_hash_sha512_BYTES 64U
    70  	SSHFP_KEY_RSA = 1,
    76  
    71  	SSHFP_KEY_DSA = 2,
    77 -int	crypto_hash_sha512(unsigned char *, const unsigned char *,
    72  	SSHFP_KEY_ECDSA = 3,
    78 +extern int	crypto_hash_sha512(unsigned char *, const unsigned char *,
    73 +#ifndef WITHOUT_ED25519
    79      unsigned long long);
    74  	SSHFP_KEY_ED25519 = 4 
    80  
    75 +#endif /* WITHOUT_ED25519 */
    81  int	crypto_verify_32(const unsigned char *, const unsigned char *);
    76  };
       
    77  
       
    78  enum sshfp_hashes {
    82 diff -pur old/ed25519.c new/ed25519.c
    79 diff -pur old/ed25519.c new/ed25519.c
    83 --- old/ed25519.c	2013-12-17 22:48:11.000000000 -0800
    80 --- old/ed25519.c	2015-03-16 22:49:20.000000000 -0700
    84 +++ new/ed25519.c	2015-04-01 09:03:04.052497535 -0700
    81 +++ new/ed25519.c	2015-05-12 06:57:55.861707517 -0700
    85 @@ -6,6 +6,8 @@
    82 @@ -7,6 +7,7 @@
    86   * Copied from supercop-20130419/crypto_sign/ed25519/ref/ed25519.c
       
    87   */
    83   */
    88  
    84  
    89 +#ifndef WITHOUT_ED25519
       
    90 +
       
    91  #include "includes.h"
    85  #include "includes.h"
       
    86 +#ifndef WITHOUT_ED25519
    92  #include "crypto_api.h"
    87  #include "crypto_api.h"
    93  
    88  
    94 @@ -142,3 +144,4 @@ int crypto_sign_ed25519_open(
    89  #include "ge25519.h"
       
    90 @@ -142,3 +143,4 @@ int crypto_sign_ed25519_open(
    95    }
    91    }
    96    return ret;
    92    return ret;
    97  }
    93  }
    98 +#endif /* WITHOUT_ED25519 */
    94 +#endif /* WITHOUT_ED25519 */
    99 diff -pur old/fe25519.c new/fe25519.c
    95 diff -pur old/fe25519.c new/fe25519.c
   100 --- old/fe25519.c	2014-01-16 17:43:44.000000000 -0800
    96 --- old/fe25519.c	2015-03-16 22:49:20.000000000 -0700
   101 +++ new/fe25519.c	2015-04-01 03:48:12.251955071 -0700
    97 +++ new/fe25519.c	2015-05-12 06:57:55.862124169 -0700
   102 @@ -6,6 +6,8 @@
    98 @@ -8,6 +8,7 @@
   103   * Copied from supercop-20130419/crypto_sign/ed25519/ref/fe25519.c
    99  
   104   */
       
   105  
       
   106 +#ifndef WITHOUT_ED25519
       
   107 +
       
   108  #include "includes.h"
   100  #include "includes.h"
   109  
   101  
       
   102 +#ifndef WITHOUT_ED25519
   110  #define WINDOWSIZE 1 /* Should be 1,2, or 4 */
   103  #define WINDOWSIZE 1 /* Should be 1,2, or 4 */
   111 @@ -335,3 +337,5 @@ void fe25519_pow2523(fe25519 *r, const f
   104  #define WINDOWMASK ((1<<WINDOWSIZE)-1)
       
   105  
       
   106 @@ -335,3 +336,4 @@ void fe25519_pow2523(fe25519 *r, const f
   112  	/* 2^252 - 2^2 */ fe25519_square(&t,&t);
   107  	/* 2^252 - 2^2 */ fe25519_square(&t,&t);
   113  	/* 2^252 - 3 */ fe25519_mul(r,&t,x);
   108  	/* 2^252 - 3 */ fe25519_mul(r,&t,x);
   114  }
   109  }
   115 +
       
   116 +#endif /* WITHOUT_ED25519 */
   110 +#endif /* WITHOUT_ED25519 */
   117 diff -pur old/fe25519.h new/fe25519.h
   111 diff -pur old/fe25519.h new/fe25519.h
   118 --- old/fe25519.h	2013-12-17 22:48:11.000000000 -0800
   112 --- old/fe25519.h	2015-03-16 22:49:20.000000000 -0700
   119 +++ new/fe25519.h	2015-04-01 03:47:56.992321351 -0700
   113 +++ new/fe25519.h	2015-05-12 06:57:55.862460867 -0700
   120 @@ -9,6 +9,8 @@
   114 @@ -8,6 +8,7 @@
       
   115  
   121  #ifndef FE25519_H
   116  #ifndef FE25519_H
   122  #define FE25519_H
   117  #define FE25519_H
   123  
   118 +#ifndef WITHOUT_ED25519
   124 +#ifndef WITHOUT_ED25519
   119  
   125 +
       
   126  #include "crypto_api.h"
   120  #include "crypto_api.h"
   127  
   121  
   128  #define fe25519              crypto_sign_ed25519_ref_fe25519
   122 @@ -67,4 +68,5 @@ void fe25519_invert(fe25519 *r, const fe
   129 @@ -67,4 +69,5 @@ void fe25519_invert(fe25519 *r, const fe
       
   130  
   123  
   131  void fe25519_pow2523(fe25519 *r, const fe25519 *x);
   124  void fe25519_pow2523(fe25519 *r, const fe25519 *x);
   132  
   125  
   133 +#endif /* WITHOUT_ED25519 */
   126 +#endif /* WITHOUT_ED25519 */
   134  #endif
   127  #endif
   135 diff -pur old/ge25519.c new/ge25519.c
   128 diff -pur old/ge25519.c new/ge25519.c
   136 --- old/ge25519.c	2014-01-16 17:43:44.000000000 -0800
   129 --- old/ge25519.c	2015-03-16 22:49:20.000000000 -0700
   137 +++ new/ge25519.c	2015-04-01 03:47:40.144323636 -0700
   130 +++ new/ge25519.c	2015-05-12 06:57:55.862878000 -0700
   138 @@ -6,6 +6,8 @@
   131 @@ -7,6 +7,7 @@
   139   * Copied from supercop-20130419/crypto_sign/ed25519/ref/ge25519.c
       
   140   */
   132   */
   141  
   133  
   142 +#ifndef WITHOUT_ED25519
       
   143 +
       
   144  #include "includes.h"
   134  #include "includes.h"
       
   135 +#ifndef WITHOUT_ED25519
   145  
   136  
   146  #include "fe25519.h"
   137  #include "fe25519.h"
   147 @@ -319,3 +321,5 @@ void ge25519_scalarmult_base(ge25519_p3
   138  #include "sc25519.h"
       
   139 @@ -319,3 +320,4 @@ void ge25519_scalarmult_base(ge25519_p3
   148      ge25519_mixadd2(r, &t);
   140      ge25519_mixadd2(r, &t);
   149    }
   141    }
   150  }
   142  }
   151 +
       
   152 +#endif /* WITHOUT_ED25519 */
   143 +#endif /* WITHOUT_ED25519 */
   153 diff -pur old/ge25519.h new/ge25519.h
   144 diff -pur old/ge25519.h new/ge25519.h
   154 --- old/ge25519.h	2013-12-17 22:48:11.000000000 -0800
   145 --- old/ge25519.h	2015-03-16 22:49:20.000000000 -0700
   155 +++ new/ge25519.h	2015-04-01 03:47:22.801071311 -0700
   146 +++ new/ge25519.h	2015-05-12 06:57:55.863212105 -0700
   156 @@ -8,6 +8,7 @@
   147 @@ -8,6 +8,7 @@
   157  
   148  
   158  #ifndef GE25519_H
   149  #ifndef GE25519_H
   159  #define GE25519_H
   150  #define GE25519_H
   160 +#ifndef WITHOUT_ED25519
   151 +#ifndef WITHOUT_ED25519
   166  void ge25519_scalarmult_base(ge25519 *r, const sc25519 *s);
   157  void ge25519_scalarmult_base(ge25519 *r, const sc25519 *s);
   167  
   158  
   168 +#endif /* WITHOUT_ED25519 */
   159 +#endif /* WITHOUT_ED25519 */
   169  #endif
   160  #endif
   170 diff -pur old/kex.c new/kex.c
   161 diff -pur old/kex.c new/kex.c
   171 --- old/kex.c	2015-03-31 21:14:02.430475216 -0700
   162 --- old/kex.c	2015-05-12 06:57:55.741193024 -0700
   172 +++ new/kex.c	2015-04-01 04:49:49.142934463 -0700
   163 +++ new/kex.c	2015-05-12 07:00:10.308904895 -0700
   173 @@ -91,7 +91,7 @@ static const struct kexalg kexalgs[] = {
   164 @@ -96,9 +96,11 @@ static const struct kexalg kexalgs[] = {
   174  # endif
   165  # endif /* OPENSSL_HAS_NISTP521 */
   175  #endif
   166  #endif /* OPENSSL_HAS_ECC */
   176  	{ KEX_DH1, KEX_DH_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
   167  #endif /* WITH_OPENSSL */
   177 -#ifdef HAVE_EVP_SHA256
   168 +#ifndef WITHOUT_ED25519
   178 +#if defined(HAVE_EVP_SHA256) && !defined(WITHOUT_ED25519)
   169  #if defined(HAVE_EVP_SHA256) || !defined(WITH_OPENSSL)
   179  	{ KEX_CURVE25519_SHA256, KEX_C25519_SHA256, 0, SSH_DIGEST_SHA256 },
   170  	{ KEX_CURVE25519_SHA256, KEX_C25519_SHA256, 0, SSH_DIGEST_SHA256 },
   180  #endif
   171  #endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */
       
   172 +#endif /* WITHOUT_ED25519 */
   181  #ifdef GSSAPI
   173  #ifdef GSSAPI
       
   174  	{ KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 },
       
   175  	{ KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
   182 diff -pur old/kex.h new/kex.h
   176 diff -pur old/kex.h new/kex.h
   183 --- old/kex.h	2015-03-31 21:14:02.430845488 -0700
   177 --- old/kex.h	2015-05-12 06:57:55.741694192 -0700
   184 +++ new/kex.h	2015-04-01 04:58:55.837357472 -0700
   178 +++ new/kex.h	2015-05-12 07:01:49.320801815 -0700
   185 @@ -43,7 +43,9 @@
   179 @@ -58,13 +58,17 @@
   186  #define	KEX_ECDH_SHA2_NISTP256	"ecdh-sha2-nistp256"
   180  #define	KEX_ECDH_SHA2_NISTP256	"ecdh-sha2-nistp256"
   187  #define	KEX_ECDH_SHA2_NISTP384	"ecdh-sha2-nistp384"
   181  #define	KEX_ECDH_SHA2_NISTP384	"ecdh-sha2-nistp384"
   188  #define	KEX_ECDH_SHA2_NISTP521	"ecdh-sha2-nistp521"
   182  #define	KEX_ECDH_SHA2_NISTP521	"ecdh-sha2-nistp521"
   189 +#ifndef WITHOUT_ED25519
   183 +#ifndef WITHOUT_ED25519
   190  #define	KEX_CURVE25519_SHA256	"[email protected]"
   184  #define	KEX_CURVE25519_SHA256	"[email protected]"
   191 +#endif /* WITHOUT_ED25519 */
   185 +#endif /* WITHOUT_ED25519 */
   192  
   186  
   193  #define COMP_NONE	0
   187  #define COMP_NONE	0
   194  #define COMP_ZLIB	1
   188  #define COMP_ZLIB	1
   195 @@ -75,7 +77,9 @@ enum kex_exchange {
   189  #define COMP_DELAYED	2
       
   190  
       
   191 +#ifndef WITHOUT_ED25519
       
   192  #define CURVE25519_SIZE 32
       
   193 +#endif /* WITHOUT_ED25519 */
       
   194  
       
   195  enum kex_init_proposals {
       
   196  	PROPOSAL_KEX_ALGS,
       
   197 @@ -92,7 +96,9 @@ enum kex_exchange {
   196  	KEX_DH_GEX_SHA1,
   198  	KEX_DH_GEX_SHA1,
   197  	KEX_DH_GEX_SHA256,
   199  	KEX_DH_GEX_SHA256,
   198  	KEX_ECDH_SHA2,
   200  	KEX_ECDH_SHA2,
   199 +#ifndef WITHOUT_ED25519
   201 +#ifndef WITHOUT_ED25519
   200  	KEX_C25519_SHA256,
   202  	KEX_C25519_SHA256,
   201 +#endif /* WITHOUT_ED25519 */
   203 +#endif /* WITHOUT_ED25519 */
   202  	KEX_GSS_GRP1_SHA1,
   204  	KEX_GSS_GRP1_SHA1,
   203  	KEX_GSS_GRP14_SHA1,
   205  	KEX_GSS_GRP14_SHA1,
   204  	KEX_GSS_GEX_SHA1,
   206  	KEX_GSS_GEX_SHA1,
   205 @@ -172,8 +176,10 @@ void	 kexgex_client(Kex *);
   207 @@ -160,8 +166,10 @@ struct kex {
   206  void	 kexgex_server(Kex *);
   208  	u_int	min, max, nbits;	/* GEX */
   207  void	 kexecdh_client(Kex *);
   209  	EC_KEY	*ec_client_key;		/* ECDH */
   208  void	 kexecdh_server(Kex *);
   210  	const EC_GROUP *ec_group;	/* ECDH */
   209 +#ifndef WITHOUT_ED25519
   211 +#ifndef WITHOUT_ED25519
   210  void	 kexc25519_client(Kex *);
   212  	u_char c25519_client_key[CURVE25519_SIZE]; /* 25519 */
   211  void	 kexc25519_server(Kex *);
   213  	u_char c25519_client_pubkey[CURVE25519_SIZE]; /* 25519 */
   212 +#endif /* WITHOUT_ED25519 */
   214 +#endif /* WITHOUT_ED25519 */
   213  
   215  };
       
   216  
       
   217  int	 kex_names_valid(const char *);
       
   218 @@ -188,8 +196,10 @@ int	 kexgex_client(struct ssh *);
       
   219  int	 kexgex_server(struct ssh *);
       
   220  int	 kexecdh_client(struct ssh *);
       
   221  int	 kexecdh_server(struct ssh *);
       
   222 +#ifndef WITHOUT_ED25519
       
   223  int	 kexc25519_client(struct ssh *);
       
   224  int	 kexc25519_server(struct ssh *);
       
   225 +#endif /* WITHOUT_ED25519 */
   214  #ifdef GSSAPI
   226  #ifdef GSSAPI
   215  void	kexgss_client(Kex *);
   227  int	 kexgss_client(Kex *);
   216 @@ -193,6 +199,7 @@ kex_ecdh_hash(int, const EC_GROUP *, cha
   228  void	 kexgss_server(Kex *);
   217      char *, int, u_char *, int, const EC_POINT *, const EC_POINT *,
   229 @@ -210,6 +220,7 @@ int kex_ecdh_hash(int, const EC_GROUP *,
   218      const BIGNUM *, u_char **, u_int *);
   230      const u_char *, size_t, const u_char *, size_t, const u_char *, size_t,
   219  #endif
   231      const EC_POINT *, const EC_POINT *, const BIGNUM *, u_char *, size_t *);
   220 +#ifndef WITHOUT_ED25519
   232  
   221  void
   233 +#ifndef WITHOUT_ED25519
   222  kex_c25519_hash(int, char *, char *, char *, int,
   234  int	 kex_c25519_hash(int, const char *, const char *, const char *, size_t,
   223      char *, int, u_char *, int, const u_char *, const u_char *,
   235      const char *, size_t, const u_char *, size_t, const u_char *, const u_char *,
   224 @@ -206,6 +213,7 @@ void kexc25519_shared_key(const u_char k
   236      const u_char *, size_t, u_char *, size_t *);
   225      const u_char pub[CURVE25519_SIZE], Buffer *out)
   237 @@ -221,6 +232,7 @@ int	kexc25519_shared_key(const u_char ke
       
   238      const u_char pub[CURVE25519_SIZE], struct sshbuf *out)
   226  	__attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
   239  	__attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
   227  	__attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)));
   240  	__attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)));
   228 +#endif /* WITHOUT_ED25519 */
   241 +#endif /* WITHOUT_ED25519 */
   229  
   242  
   230  void
   243  int
   231  derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]);
   244  derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]);
   232 diff -pur old/kexc25519.c new/kexc25519.c
   245 diff -pur old/kexc25519.c new/kexc25519.c
   233 --- old/kexc25519.c	2014-01-12 00:21:23.000000000 -0800
   246 --- old/kexc25519.c	2015-03-16 22:49:20.000000000 -0700
   234 +++ new/kexc25519.c	2015-04-01 04:52:44.039054396 -0700
   247 +++ new/kexc25519.c	2015-05-12 06:57:55.865837542 -0700
   235 @@ -25,6 +25,8 @@
   248 @@ -27,6 +27,7 @@
   236   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   249  
   237   */
   250  #include "includes.h"
       
   251  
       
   252 +#ifndef WITHOUT_ED25519
       
   253  #include <sys/types.h>
       
   254  
       
   255  #include <signal.h>
       
   256 @@ -126,3 +127,4 @@ kex_c25519_hash(
       
   257  #endif
       
   258  	return 0;
       
   259  }
       
   260 +#endif /* WITHOUT_ED25519 */
       
   261 diff -pur old/kexc25519c.c new/kexc25519c.c
       
   262 --- old/kexc25519c.c	2015-03-16 22:49:20.000000000 -0700
       
   263 +++ new/kexc25519c.c	2015-05-12 06:57:55.866212606 -0700
       
   264 @@ -27,6 +27,7 @@
       
   265  
       
   266  #include "includes.h"
       
   267  
       
   268 +#ifndef WITHOUT_ED25519
       
   269  #include <sys/types.h>
       
   270  
       
   271  #include <stdio.h>
       
   272 @@ -168,3 +169,4 @@ out:
       
   273  	sshbuf_free(shared_secret);
       
   274  	return r;
       
   275  }
       
   276 +#endif /* WITHOUT_ED25519 */
       
   277 diff -pur old/kexc25519s.c new/kexc25519s.c
       
   278 --- old/kexc25519s.c	2015-03-16 22:49:20.000000000 -0700
       
   279 +++ new/kexc25519s.c	2015-05-12 06:57:55.866584623 -0700
       
   280 @@ -26,6 +26,8 @@
       
   281  
       
   282  #include "includes.h"
   238  
   283  
   239 +#ifndef WITHOUT_ED25519
   284 +#ifndef WITHOUT_ED25519
   240 +
   285 +
   241  #include "includes.h"
       
   242  
       
   243  #include <sys/types.h>
   286  #include <sys/types.h>
   244 @@ -120,3 +122,5 @@ kex_c25519_hash(
   287  #include <string.h>
   245  	*hash = digest;
   288  #include <signal.h>
   246  	*hashlen = ssh_digest_bytes(hash_alg);
   289 @@ -156,3 +158,4 @@ out:
       
   290  	sshbuf_free(shared_secret);
       
   291  	return r;
   247  }
   292  }
       
   293 +#endif /* WITHOUT_ED25519 */
       
   294 diff -pur old/monitor.c new/monitor.c
       
   295 --- old/monitor.c	2015-05-12 06:57:55.743678816 -0700
       
   296 +++ new/monitor.c	2015-05-12 07:02:27.111640142 -0700
       
   297 @@ -1937,7 +1937,9 @@ monitor_apply_keystate(struct monitor *p
       
   298  		kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
       
   299  # endif
       
   300  #endif /* WITH_OPENSSL */
       
   301 +#ifndef WITHOUT_ED25519
       
   302  		kex->kex[KEX_C25519_SHA256] = kexc25519_server;
       
   303 +#endif /* WITHOUT_ED25519 */
       
   304  #ifdef GSSAPI
       
   305  		if (options.gss_keyex) {
       
   306  			kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server;
       
   307 diff -pur old/myproposal.h new/myproposal.h
       
   308 --- old/myproposal.h	2015-03-16 22:49:20.000000000 -0700
       
   309 +++ new/myproposal.h	2015-06-05 02:29:36.569958448 -0700
       
   310 @@ -59,6 +59,20 @@
       
   311  # define HOSTKEY_ECDSA_METHODS
       
   312  #endif
       
   313  
       
   314 +#ifndef WITHOUT_ED25519
       
   315 +# if defined(WITH_OPENSSL) && defined(HAVE_EVP_SHA256)
       
   316 +#  define KEX_CURVE25519_METHODS "[email protected],"
       
   317 +# else
       
   318 +#  define KEX_CURVE25519_METHODS
       
   319 +# endif
       
   320 +# define HOSTKEY_CURVE25519_CERT_METHODS "[email protected],"
       
   321 +# define HOSTKEY_CURVE25519_METHODS "ssh-ed25519,"
       
   322 +#else
       
   323 +# define KEX_CURVE25519_METHODS
       
   324 +# define HOSTKEY_CURVE25519_CERT_METHODS
       
   325 +# define HOSTKEY_CURVE25519_METHODS
       
   326 +#endif /* WITHOUT_ED25519 */
   248 +
   327 +
   249 +#endif /* WITHOUT_ED25519 */
   328  #ifdef OPENSSL_HAVE_EVPGCM
   250 diff -pur old/kexc25519c.c new/kexc25519c.c
   329  # define AESGCM_CIPHER_MODES \
   251 --- old/kexc25519c.c	2014-01-12 00:21:23.000000000 -0800
   330  	"[email protected],[email protected],"
   252 +++ new/kexc25519c.c	2015-04-01 04:52:57.326754535 -0700
   331 @@ -78,11 +92,6 @@
   253 @@ -25,6 +25,8 @@
       
   254   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
   255   */
       
   256  
       
   257 +#ifndef WITHOUT_ED25519
       
   258 +
       
   259  #include "includes.h"
       
   260  
       
   261  #include <sys/types.h>
       
   262 @@ -127,3 +129,5 @@ kexc25519_client(Kex *kex)
       
   263  	buffer_free(&shared_secret);
       
   264  	kex_finish(kex);
       
   265  }
       
   266 +
       
   267 +#endif /* WITHOUT_ED25519 */
       
   268 diff -pur old/kexc25519s.c new/kexc25519s.c
       
   269 --- old/kexc25519s.c	2014-01-12 00:21:23.000000000 -0800
       
   270 +++ new/kexc25519s.c	2015-04-01 04:53:14.320854854 -0700
       
   271 @@ -24,6 +24,8 @@
       
   272   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
   273   */
       
   274  
       
   275 +#ifndef WITHOUT_ED25519
       
   276 +
       
   277  #include "includes.h"
       
   278  
       
   279  #include <sys/types.h>
       
   280 @@ -124,3 +126,5 @@ kexc25519_server(Kex *kex)
       
   281  	buffer_free(&shared_secret);
       
   282  	kex_finish(kex);
       
   283  }
       
   284 +
       
   285 +#endif /* WITHOUT_ED25519 */
       
   286 diff -pur old/key.c new/key.c
       
   287 --- old/key.c	2015-03-31 21:14:02.432016878 -0700
       
   288 +++ new/key.c	2015-04-01 02:05:27.074044366 -0700
       
   289 @@ -89,8 +89,10 @@ key_new(int type)
       
   290  	k->dsa = NULL;
       
   291  	k->rsa = NULL;
       
   292  	k->cert = NULL;
       
   293 +#ifndef WITHOUT_ED25519
       
   294  	k->ed25519_sk = NULL;
       
   295  	k->ed25519_pk = NULL;
       
   296 +#endif /* WITHOUT_ED25519 */
       
   297  	switch (k->type) {
       
   298  	case KEY_RSA1:
       
   299  	case KEY_RSA:
       
   300 @@ -125,10 +127,12 @@ key_new(int type)
       
   301  		/* Cannot do anything until we know the group */
       
   302  		break;
       
   303  #endif
   332  #endif
   304 +#ifndef WITHOUT_ED25519
   333  
   305  	case KEY_ED25519:
   334  #ifdef WITH_OPENSSL
   306  	case KEY_ED25519_CERT:
   335 -# ifdef HAVE_EVP_SHA256
   307  		/* no need to prealloc */
   336 -#  define KEX_CURVE25519_METHODS "[email protected],"
   308  		break;
   337 -# else
   309 +#endif /* WITHOUT_ED25519 */
   338 -#  define KEX_CURVE25519_METHODS ""
   310  	case KEY_UNSPEC:
   339 -# endif
   311  		break;
   340  #define KEX_SERVER_KEX \
   312  	default:
       
   313 @@ -173,10 +177,12 @@ key_add_private(Key *k)
       
   314  	case KEY_ECDSA_CERT:
       
   315  		/* Cannot do anything until we know the group */
       
   316  		break;
       
   317 +#ifndef WITHOUT_ED25519
       
   318  	case KEY_ED25519:
       
   319  	case KEY_ED25519_CERT:
       
   320  		/* no need to prealloc */
       
   321  		break;
       
   322 +#endif /* WITHOUT_ED25519 */
       
   323  	case KEY_UNSPEC:
       
   324  		break;
       
   325  	default:
       
   326 @@ -239,6 +245,7 @@ key_free(Key *k)
       
   327  		k->ecdsa = NULL;
       
   328  		break;
       
   329  #endif
       
   330 +#ifndef WITHOUT_ED25519
       
   331  	case KEY_ED25519:
       
   332  	case KEY_ED25519_CERT:
       
   333  		if (k->ed25519_pk) {
       
   334 @@ -252,6 +259,7 @@ key_free(Key *k)
       
   335  			k->ed25519_sk = NULL;
       
   336  		}
       
   337  		break;
       
   338 +#endif /* WITHOUT_ED25519 */
       
   339  	case KEY_UNSPEC:
       
   340  		break;
       
   341  	default:
       
   342 @@ -333,10 +341,12 @@ key_equal_public(const Key *a, const Key
       
   343  		BN_CTX_free(bnctx);
       
   344  		return 1;
       
   345  #endif /* OPENSSL_HAS_ECC */
       
   346 +#ifndef WITHOUT_ED25519
       
   347  	case KEY_ED25519:
       
   348  	case KEY_ED25519_CERT:
       
   349  		return a->ed25519_pk != NULL && b->ed25519_pk != NULL &&
       
   350  		    memcmp(a->ed25519_pk, b->ed25519_pk, ED25519_PK_SZ) == 0;
       
   351 +#endif /* WITHOUT_ED25519 */
       
   352  	default:
       
   353  		fatal("key_equal: bad key type %d", a->type);
       
   354  	}
       
   355 @@ -392,7 +402,9 @@ key_fingerprint_raw(const Key *k, enum f
       
   356  	case KEY_DSA:
       
   357  	case KEY_ECDSA:
       
   358  	case KEY_RSA:
       
   359 +#ifndef WITHOUT_ED25519
       
   360  	case KEY_ED25519:
       
   361 +#endif /* WITHOUT_ED25519 */
       
   362  		key_to_blob(k, &blob, &len);
       
   363  		break;
       
   364  	case KEY_DSA_CERT_V00:
       
   365 @@ -400,7 +412,9 @@ key_fingerprint_raw(const Key *k, enum f
       
   366  	case KEY_DSA_CERT:
       
   367  	case KEY_ECDSA_CERT:
       
   368  	case KEY_RSA_CERT:
       
   369 +#ifndef WITHOUT_ED25519
       
   370  	case KEY_ED25519_CERT:
       
   371 +#endif /* WITHOUT_ED25519 */
       
   372  		/* We want a fingerprint of the _key_ not of the cert */
       
   373  		to_blob(k, &blob, &len, 1);
       
   374  		break;
       
   375 @@ -728,13 +742,17 @@ key_read(Key *ret, char **cpp)
       
   376  	case KEY_RSA:
       
   377  	case KEY_DSA:
       
   378  	case KEY_ECDSA:
       
   379 +#ifndef WITHOUT_ED25519
       
   380  	case KEY_ED25519:
       
   381 +#endif /* WITHOUT_ED25519 */
       
   382  	case KEY_DSA_CERT_V00:
       
   383  	case KEY_RSA_CERT_V00:
       
   384  	case KEY_DSA_CERT:
       
   385  	case KEY_ECDSA_CERT:
       
   386  	case KEY_RSA_CERT:
       
   387 +#ifndef WITHOUT_ED25519
       
   388  	case KEY_ED25519_CERT:
       
   389 +#endif /* WITHOUT_ED25519 */
       
   390  		space = strchr(cp, ' ');
       
   391  		if (space == NULL) {
       
   392  			debug3("key_read: missing whitespace");
       
   393 @@ -836,6 +854,7 @@ key_read(Key *ret, char **cpp)
       
   394  #endif
       
   395  		}
       
   396  #endif
       
   397 +#ifndef WITHOUT_ED25519
       
   398  		if (key_type_plain(ret->type) == KEY_ED25519) {
       
   399  			free(ret->ed25519_pk);
       
   400  			ret->ed25519_pk = k->ed25519_pk;
       
   401 @@ -844,6 +863,7 @@ key_read(Key *ret, char **cpp)
       
   402  			/* XXX */
       
   403  #endif
       
   404  		}
       
   405 +#endif /* WITHOUT_ED25519 */
       
   406  		success = 1;
       
   407  /*XXXX*/
       
   408  		key_free(k);
       
   409 @@ -907,11 +927,13 @@ key_write(const Key *key, FILE *f)
       
   410  			return 0;
       
   411  		break;
       
   412  #endif
       
   413 +#ifndef WITHOUT_ED25519
       
   414  	case KEY_ED25519:
       
   415  	case KEY_ED25519_CERT:
       
   416  		if (key->ed25519_pk == NULL)
       
   417  			return 0;
       
   418  		break;
       
   419 +#endif /* WITHOUT_ED25519 */
       
   420  	case KEY_RSA:
       
   421  	case KEY_RSA_CERT_V00:
       
   422  	case KEY_RSA_CERT:
       
   423 @@ -959,7 +981,9 @@ static const struct keytype keytypes[] =
       
   424  	{ NULL, "RSA1", KEY_RSA1, 0, 0 },
       
   425  	{ "ssh-rsa", "RSA", KEY_RSA, 0, 0 },
       
   426  	{ "ssh-dss", "DSA", KEY_DSA, 0, 0 },
       
   427 +#ifndef WITHOUT_ED25519
       
   428  	{ "ssh-ed25519", "ED25519", KEY_ED25519, 0, 0 },
       
   429 +#endif /* WITHOUT_ED25519 */
       
   430  #ifdef OPENSSL_HAS_ECC
       
   431  	{ "ecdsa-sha2-nistp256", "ECDSA", KEY_ECDSA, NID_X9_62_prime256v1, 0 },
       
   432  	{ "ecdsa-sha2-nistp384", "ECDSA", KEY_ECDSA, NID_secp384r1, 0 },
       
   433 @@ -983,8 +1007,10 @@ static const struct keytype keytypes[] =
       
   434  	    KEY_RSA_CERT_V00, 0, 1 },
       
   435  	{ "[email protected]", "DSA-CERT-V00",
       
   436  	    KEY_DSA_CERT_V00, 0, 1 },
       
   437 +#ifndef WITHOUT_ED25519
       
   438  	{ "[email protected]", "ED25519-CERT",
       
   439  	    KEY_ED25519_CERT, 0, 1 },
       
   440 +#endif /* WITHOUT_ED25519 */
       
   441  	{ "null", "null", KEY_NULL, 0, 0 },
       
   442  	{ NULL, NULL, -1, -1, 0 }
       
   443  };
       
   444 @@ -1097,7 +1123,9 @@ key_type_is_valid_ca(int type)
       
   445  	case KEY_RSA:
       
   446  	case KEY_DSA:
       
   447  	case KEY_ECDSA:
       
   448 +#ifndef WITHOUT_ED25519
       
   449  	case KEY_ED25519:
       
   450 +#endif /* WITHOUT_ED25519 */
       
   451  		return 1;
       
   452  	default:
       
   453  		return 0;
       
   454 @@ -1117,8 +1145,10 @@ key_size(const Key *k)
       
   455  	case KEY_DSA_CERT_V00:
       
   456  	case KEY_DSA_CERT:
       
   457  		return BN_num_bits(k->dsa->p);
       
   458 +#ifndef WITHOUT_ED25519
       
   459  	case KEY_ED25519:
       
   460  		return 256;	/* XXX */
       
   461 +#endif /* WITHOUT_ED25519 */
       
   462  #ifdef OPENSSL_HAS_ECC
       
   463  	case KEY_ECDSA:
       
   464  	case KEY_ECDSA_CERT:
       
   465 @@ -1262,11 +1292,13 @@ key_generate(int type, u_int bits)
       
   466  	case KEY_RSA1:
       
   467  		k->rsa = rsa_generate_private_key(bits);
       
   468  		break;
       
   469 +#ifndef WITHOUT_ED25519
       
   470  	case KEY_ED25519:
       
   471  		k->ed25519_pk = xmalloc(ED25519_PK_SZ);
       
   472  		k->ed25519_sk = xmalloc(ED25519_SK_SZ);
       
   473  		crypto_sign_ed25519_keypair(k->ed25519_pk, k->ed25519_sk);
       
   474  		break;
       
   475 +#endif /* WITHOUT_ED25519 */
       
   476  	case KEY_RSA_CERT_V00:
       
   477  	case KEY_DSA_CERT_V00:
       
   478  	case KEY_RSA_CERT:
       
   479 @@ -1360,6 +1392,7 @@ key_from_private(const Key *k)
       
   480  		    (BN_copy(n->rsa->e, k->rsa->e) == NULL))
       
   481  			fatal("key_from_private: BN_copy failed");
       
   482  		break;
       
   483 +#ifndef WITHOUT_ED25519
       
   484  	case KEY_ED25519:
       
   485  	case KEY_ED25519_CERT:
       
   486  		n = key_new(k->type);
       
   487 @@ -1368,6 +1401,7 @@ key_from_private(const Key *k)
       
   488  			memcpy(n->ed25519_pk, k->ed25519_pk, ED25519_PK_SZ);
       
   489  		}
       
   490  		break;
       
   491 +#endif /* WITHOUT_ED25519 */
       
   492  	default:
       
   493  		fatal("key_from_private: unknown type %d", k->type);
       
   494  		break;
       
   495 @@ -1629,6 +1663,7 @@ key_from_blob2(const u_char *blob, u_int
       
   496  #endif
       
   497  		break;
       
   498  #endif /* OPENSSL_HAS_ECC */
       
   499 +#ifndef WITHOUT_ED25519
       
   500  	case KEY_ED25519_CERT:
       
   501  		(void)buffer_get_string_ptr_ret(&b, NULL); /* Skip nonce */
       
   502  		/* FALLTHROUGH */
       
   503 @@ -1646,6 +1681,7 @@ key_from_blob2(const u_char *blob, u_int
       
   504  		key->ed25519_pk = pk;
       
   505  		pk = NULL;
       
   506  		break;
       
   507 +#endif /* WITHOUT_ED25519 */
       
   508  	case KEY_UNSPEC:
       
   509  		key = key_new(type);
       
   510  		break;
       
   511 @@ -1700,7 +1736,9 @@ to_blob(const Key *key, u_char **blobp,
       
   512  	case KEY_DSA_CERT:
       
   513  	case KEY_ECDSA_CERT:
       
   514  	case KEY_RSA_CERT:
       
   515 +#ifndef WITHOUT_ED25519
       
   516  	case KEY_ED25519_CERT:
       
   517 +#endif /* WITHOUT_ED25519 */
       
   518  		/* Use the existing blob */
       
   519  		buffer_append(&b, buffer_ptr(&key->cert->certblob),
       
   520  		    buffer_len(&key->cert->certblob));
       
   521 @@ -1728,11 +1766,13 @@ to_blob(const Key *key, u_char **blobp,
       
   522  		buffer_put_bignum2(&b, key->rsa->e);
       
   523  		buffer_put_bignum2(&b, key->rsa->n);
       
   524  		break;
       
   525 +#ifndef WITHOUT_ED25519
       
   526  	case KEY_ED25519:
       
   527  		buffer_put_cstring(&b,
       
   528  		    key_ssh_name_from_type_nid(type, key->ecdsa_nid));
       
   529  		buffer_put_string(&b, key->ed25519_pk, ED25519_PK_SZ);
       
   530  		break;
       
   531 +#endif /* WITHOUT_ED25519 */
       
   532  	default:
       
   533  		error("key_to_blob: unsupported key type %d", key->type);
       
   534  		buffer_free(&b);
       
   535 @@ -1776,9 +1816,11 @@ key_sign(
       
   536  	case KEY_RSA_CERT:
       
   537  	case KEY_RSA:
       
   538  		return ssh_rsa_sign(key, sigp, lenp, data, datalen);
       
   539 +#ifndef WITHOUT_ED25519
       
   540  	case KEY_ED25519:
       
   541  	case KEY_ED25519_CERT:
       
   542  		return ssh_ed25519_sign(key, sigp, lenp, data, datalen);
       
   543 +#endif /* WITHOUT_ED25519 */
       
   544  	default:
       
   545  		error("key_sign: invalid key type %d", key->type);
       
   546  		return -1;
       
   547 @@ -1812,9 +1854,11 @@ key_verify(
       
   548  	case KEY_RSA_CERT:
       
   549  	case KEY_RSA:
       
   550  		return ssh_rsa_verify(key, signature, signaturelen, data, datalen);
       
   551 +#ifndef WITHOUT_ED25519
       
   552  	case KEY_ED25519:
       
   553  	case KEY_ED25519_CERT:
       
   554  		return ssh_ed25519_verify(key, signature, signaturelen, data, datalen);
       
   555 +#endif /* WITHOUT_ED25519 */
       
   556  	default:
       
   557  		error("key_verify: invalid key type %d", key->type);
       
   558  		return -1;
       
   559 @@ -1834,8 +1878,10 @@ key_demote(const Key *k)
       
   560  	pk->dsa = NULL;
       
   561  	pk->ecdsa = NULL;
       
   562  	pk->rsa = NULL;
       
   563 +#ifndef WITHOUT_ED25519
       
   564  	pk->ed25519_pk = NULL;
       
   565  	pk->ed25519_sk = NULL;
       
   566 +#endif /* WITHOUT_ED25519 */
       
   567  
       
   568  	switch (k->type) {
       
   569  	case KEY_RSA_CERT_V00:
       
   570 @@ -1879,6 +1925,7 @@ key_demote(const Key *k)
       
   571  			fatal("key_demote: EC_KEY_set_public_key failed");
       
   572  		break;
       
   573  #endif
       
   574 +#ifndef WITHOUT_ED25519
       
   575  	case KEY_ED25519_CERT:
       
   576  		key_cert_copy(k, pk);
       
   577  		/* FALLTHROUGH */
       
   578 @@ -1888,6 +1935,7 @@ key_demote(const Key *k)
       
   579  			memcpy(pk->ed25519_pk, k->ed25519_pk, ED25519_PK_SZ);
       
   580  		}
       
   581  		break;
       
   582 +#endif /* WITHOUT_ED25519 */
       
   583  	default:
       
   584  		fatal("key_demote: bad key type %d", k->type);
       
   585  		break;
       
   586 @@ -1917,8 +1965,10 @@ key_type_plain(int type)
       
   587  		return KEY_DSA;
       
   588  	case KEY_ECDSA_CERT:
       
   589  		return KEY_ECDSA;
       
   590 +#ifndef WITHOUT_ED25519
       
   591  	case KEY_ED25519_CERT:
       
   592  		return KEY_ED25519;
       
   593 +#endif /* WITHOUT_ED25519 */
       
   594  	default:
       
   595  		return type;
       
   596  	}
       
   597 @@ -1944,6 +1994,7 @@ key_to_certified(Key *k, int legacy)
       
   598  		k->cert = cert_new();
       
   599  		k->type = KEY_ECDSA_CERT;
       
   600  		return 0;
       
   601 +#ifndef WITHOUT_ED25519
       
   602  	case KEY_ED25519:
       
   603  		if (legacy)
       
   604  			fatal("%s: legacy ED25519 certificates are not "
       
   605 @@ -1951,6 +2002,7 @@ key_to_certified(Key *k, int legacy)
       
   606  		k->cert = cert_new();
       
   607  		k->type = KEY_ED25519_CERT;
       
   608  		return 0;
       
   609 +#endif /* WITHOUT_ED25519 */
       
   610  	default:
       
   611  		error("%s: key has incorrect type %s", __func__, key_type(k));
       
   612  		return -1;
       
   613 @@ -2029,10 +2081,12 @@ key_certify(Key *k, Key *ca)
       
   614  		buffer_put_bignum2(&k->cert->certblob, k->rsa->e);
       
   615  		buffer_put_bignum2(&k->cert->certblob, k->rsa->n);
       
   616  		break;
       
   617 +#ifndef WITHOUT_ED25519
       
   618  	case KEY_ED25519_CERT:
       
   619  		buffer_put_string(&k->cert->certblob,
       
   620  		    k->ed25519_pk, ED25519_PK_SZ);
       
   621  		break;
       
   622 +#endif /* WITHOUT_ED25519 */
       
   623  	default:
       
   624  		error("%s: key has incorrect type %s", __func__, key_type(k));
       
   625  		buffer_clear(&k->cert->certblob);
       
   626 @@ -2450,6 +2504,7 @@ key_private_serialize(const Key *key, Bu
       
   627  		buffer_put_bignum2(b, EC_KEY_get0_private_key(key->ecdsa));
       
   628  		break;
       
   629  #endif /* OPENSSL_HAS_ECC */
       
   630 +#ifndef WITHOUT_ED25519
       
   631  	case KEY_ED25519:
       
   632  		buffer_put_string(b, key->ed25519_pk, ED25519_PK_SZ);
       
   633  		buffer_put_string(b, key->ed25519_sk, ED25519_SK_SZ);
       
   634 @@ -2462,6 +2517,7 @@ key_private_serialize(const Key *key, Bu
       
   635  		buffer_put_string(b, key->ed25519_pk, ED25519_PK_SZ);
       
   636  		buffer_put_string(b, key->ed25519_sk, ED25519_SK_SZ);
       
   637  		break;
       
   638 +#endif /* WITHOUT_ED25519 */
       
   639  	}
       
   640  }
       
   641  
       
   642 @@ -2576,6 +2632,7 @@ key_private_deserialize(Buffer *blob)
       
   643  		buffer_get_bignum2(blob, k->rsa->p);
       
   644  		buffer_get_bignum2(blob, k->rsa->q);
       
   645  		break;
       
   646 +#ifndef WITHOUT_ED25519
       
   647  	case KEY_ED25519:
       
   648  		k = key_new_private(type);
       
   649  		k->ed25519_pk = buffer_get_string(blob, &pklen);
       
   650 @@ -2602,6 +2659,7 @@ key_private_deserialize(Buffer *blob)
       
   651  			fatal("%s: ed25519 sklen %d != %d",
       
   652  			    __func__, sklen, ED25519_SK_SZ);
       
   653  		break;
       
   654 +#endif /* WITHOUT_ED25519 */
       
   655  	default:
       
   656  		free(type_name);
       
   657  		buffer_clear(blob);
       
   658 diff -pur old/key.h new/key.h
       
   659 --- old/key.h	2015-03-31 21:14:02.432362912 -0700
       
   660 +++ new/key.h	2015-04-01 02:07:01.018270150 -0700
       
   661 @@ -39,11 +39,15 @@ enum types {
       
   662  	KEY_RSA,
       
   663  	KEY_DSA,
       
   664  	KEY_ECDSA,
       
   665 +#ifndef WITHOUT_ED25519
       
   666  	KEY_ED25519,
       
   667 +#endif /* WITHOUT_ED25519 */
       
   668  	KEY_RSA_CERT,
       
   669  	KEY_DSA_CERT,
       
   670  	KEY_ECDSA_CERT,
       
   671 +#ifndef WITHOUT_ED25519
       
   672  	KEY_ED25519_CERT,
       
   673 +#endif /* WITHOUT_ED25519 */
       
   674  	KEY_RSA_CERT_V00,
       
   675  	KEY_DSA_CERT_V00,
       
   676  	KEY_NULL,
       
   677 @@ -89,12 +93,16 @@ struct Key {
       
   678  	void	*ecdsa;
       
   679  #endif
       
   680  	struct KeyCert *cert;
       
   681 +#ifndef WITHOUT_ED25519
       
   682  	u_char	*ed25519_sk;
       
   683  	u_char	*ed25519_pk;
       
   684 +#endif /* WITHOUT_ED25519 */
       
   685  };
       
   686  
       
   687 +#ifndef WITHOUT_ED25519
       
   688  #define	ED25519_SK_SZ	crypto_sign_ed25519_SECRETKEYBYTES
       
   689  #define	ED25519_PK_SZ	crypto_sign_ed25519_PUBLICKEYBYTES
       
   690 +#endif /* WITHOUT_ED25519 */
       
   691  
       
   692  Key		*key_new(int);
       
   693  void		 key_add_private(Key *);
       
   694 @@ -153,8 +161,10 @@ int	 ssh_ecdsa_sign(const Key *, u_char
       
   695  int	 ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
       
   696  int	 ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
       
   697  int	 ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
       
   698 +#ifndef WITHOUT_ED25519
       
   699  int	 ssh_ed25519_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
       
   700  int	 ssh_ed25519_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
       
   701 +#endif /* WITHOUT_ED25519 */
       
   702  
       
   703  #if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK))
       
   704  void	key_dump_ec_point(const EC_GROUP *, const EC_POINT *);
       
   705 diff -pur old/monitor.c new/monitor.c
       
   706 --- old/monitor.c	2015-03-31 21:14:02.433735148 -0700
       
   707 +++ new/monitor.c	2015-04-01 04:54:56.314967559 -0700
       
   708 @@ -1902,7 +1902,9 @@ mm_get_kex(Buffer *m)
       
   709  	kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
       
   710  	kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
       
   711  	kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
       
   712 +#ifndef WITHOUT_ED25519
       
   713  	kex->kex[KEX_C25519_SHA256] = kexc25519_server;
       
   714 +#endif /* WITHOUT_ED25519 */
       
   715  #ifdef GSSAPI
       
   716  	if (options.gss_keyex) {
       
   717  		kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server;
       
   718 diff -pur old/myproposal.h new/myproposal.h
       
   719 --- old/myproposal.h	2013-12-06 16:24:02.000000000 -0800
       
   720 +++ new/myproposal.h	2015-04-01 02:12:36.430101847 -0700
       
   721 @@ -80,6 +80,24 @@
       
   722  # define SHA2_HMAC_MODES
       
   723  #endif
       
   724  
       
   725 +#ifdef WITHOUT_ED25519
       
   726 +# define KEX_DEFAULT_KEX \
       
   727 +	KEX_ECDH_METHODS \
       
   728 +	KEX_SHA256_METHODS \
       
   729 +	"diffie-hellman-group-exchange-sha1," \
       
   730 +	"diffie-hellman-group14-sha1," \
       
   731 +	"diffie-hellman-group1-sha1"
       
   732 +
       
   733 +#define	KEX_DEFAULT_PK_ALG	\
       
   734 +	HOSTKEY_ECDSA_CERT_METHODS \
       
   735 +	"[email protected]," \
       
   736 +	"[email protected]," \
       
   737 +	"[email protected]," \
       
   738 +	"[email protected]," \
       
   739 +	HOSTKEY_ECDSA_METHODS \
       
   740 +	"ssh-rsa," \
       
   741 +	"ssh-dss"
       
   742 +#else /* WITHOUT_ED25519 */
       
   743  # define KEX_DEFAULT_KEX \
       
   744  	KEX_CURVE25519_METHODS \
   341  	KEX_CURVE25519_METHODS \
   745  	KEX_ECDH_METHODS \
   342  	KEX_ECDH_METHODS \
   746 @@ -99,6 +117,7 @@
   343 @@ -95,13 +104,13 @@
   747  	"ssh-ed25519," \
   344  
       
   345  #define	KEX_DEFAULT_PK_ALG	\
       
   346  	HOSTKEY_ECDSA_CERT_METHODS \
       
   347 -	"[email protected]," \
       
   348 +	HOSTKEY_CURVE25519_CERT_METHODS \
       
   349  	"[email protected]," \
       
   350  	"[email protected]," \
       
   351  	"[email protected]," \
       
   352  	"[email protected]," \
       
   353  	HOSTKEY_ECDSA_METHODS \
       
   354 -	"ssh-ed25519," \
       
   355 +	HOSTKEY_CURVE25519_METHODS \
   748  	"ssh-rsa," \
   356  	"ssh-rsa," \
   749  	"ssh-dss"
   357  	"ssh-dss"
   750 +#endif /* WITHOUT_ED25519 */
   358  
   751  
   359 @@ -143,10 +152,10 @@
   752  /* the actual algorithms */
   360  #else
   753  
   361  
       
   362  #define KEX_SERVER_KEX		\
       
   363 -	"[email protected]"
       
   364 +	KEX_CURVE25519_METHODS
       
   365  #define	KEX_DEFAULT_PK_ALG	\
       
   366 -	"[email protected]," \
       
   367 -	"ssh-ed25519"
       
   368 +	HOSTKEY_CURVE25519_CERT_METHODS \
       
   369 +	HOSTKEY_CURVE25519_METHODS
       
   370  #define	KEX_SERVER_ENCRYPT \
       
   371  	"aes128-ctr,aes192-ctr,aes256-ctr," \
       
   372  	"[email protected]"
   754 diff -pur old/openbsd-compat/Makefile.in new/openbsd-compat/Makefile.in
   373 diff -pur old/openbsd-compat/Makefile.in new/openbsd-compat/Makefile.in
   755 --- old/openbsd-compat/Makefile.in	2013-12-06 17:37:54.000000000 -0800
   374 --- old/openbsd-compat/Makefile.in	2015-03-16 22:49:20.000000000 -0700
   756 +++ new/openbsd-compat/Makefile.in	2015-04-02 02:29:35.165103300 -0700
   375 +++ new/openbsd-compat/Makefile.in	2015-05-12 06:57:55.869383953 -0700
   757 @@ -18,7 +18,7 @@ LDFLAGS=-L. @LDFLAGS@
       
   758  
       
   759  OPENBSD=base64.o basename.o bcrypt_pbkdf.o bindresvport.o blowfish.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o blowfish.o bcrypt_pbkdf.o
       
   760  
       
   761 -COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o
       
   762 +COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o 
       
   763  
       
   764  PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o
       
   765  
       
   766 @@ -32,7 +32,7 @@ $(OPENBSD): ../config.h
   376 @@ -32,7 +32,7 @@ $(OPENBSD): ../config.h
   767  $(PORTS): ../config.h
   377  $(PORTS): ../config.h
   768  
   378  
   769  libopenbsd-compat.a:  $(COMPAT) $(OPENBSD) $(PORTS)
   379  libopenbsd-compat.a:  $(COMPAT) $(OPENBSD) $(PORTS)
   770 -	$(AR) rv $@ $(COMPAT) $(OPENBSD) $(PORTS)
   380 -	$(AR) rv $@ $(COMPAT) $(OPENBSD) $(PORTS)
   771 +	$(AR) rv $@ $(COMPAT) $(OPENBSD) $(PORTS) ../hash.o ../blocks.o
   381 +	$(AR) rv $@ $(COMPAT) $(OPENBSD) $(PORTS) ../hash.o ../blocks.o
   772  	$(RANLIB) $@
   382  	$(RANLIB) $@
   773  
   383  
   774  clean:
   384  clean:
   775 diff -pur old/pathnames.h new/pathnames.h
   385 diff -pur old/pathnames.h new/pathnames.h
   776 --- old/pathnames.h	2013-12-06 16:24:02.000000000 -0800
   386 --- old/pathnames.h	2015-03-16 22:49:20.000000000 -0700
   777 +++ new/pathnames.h	2015-04-01 02:13:45.651827507 -0700
   387 +++ new/pathnames.h	2015-05-12 06:57:55.869773325 -0700
   778 @@ -39,7 +39,9 @@
   388 @@ -39,7 +39,9 @@
   779  #define _PATH_HOST_KEY_FILE		SSHDIR "/ssh_host_key"
   389  #define _PATH_HOST_KEY_FILE		SSHDIR "/ssh_host_key"
   780  #define _PATH_HOST_DSA_KEY_FILE		SSHDIR "/ssh_host_dsa_key"
   390  #define _PATH_HOST_DSA_KEY_FILE		SSHDIR "/ssh_host_dsa_key"
   781  #define _PATH_HOST_ECDSA_KEY_FILE	SSHDIR "/ssh_host_ecdsa_key"
   391  #define _PATH_HOST_ECDSA_KEY_FILE	SSHDIR "/ssh_host_ecdsa_key"
   782 +#ifndef WITHOUT_ED25519
   392 +#ifndef WITHOUT_ED25519
   794 +#endif /* WITHOUT_ED25519 */
   404 +#endif /* WITHOUT_ED25519 */
   795  
   405  
   796  /*
   406  /*
   797   * Configuration file in user's home directory.  This file need not be
   407   * Configuration file in user's home directory.  This file need not be
   798 diff -pur old/readconf.c new/readconf.c
   408 diff -pur old/readconf.c new/readconf.c
   799 --- old/readconf.c	2015-03-31 21:14:02.435957183 -0700
   409 --- old/readconf.c	2015-05-12 06:57:55.746561528 -0700
   800 +++ new/readconf.c	2015-04-01 02:14:22.222135058 -0700
   410 +++ new/readconf.c	2015-05-12 06:57:55.870873194 -0700
   801 @@ -1715,8 +1715,10 @@ fill_default_options(Options * options)
   411 @@ -1848,8 +1848,10 @@ fill_default_options(Options * options)
   802  			add_identity_file(options, "~/",
   412  			add_identity_file(options, "~/",
   803  			    _PATH_SSH_CLIENT_ID_ECDSA, 0);
   413  			    _PATH_SSH_CLIENT_ID_ECDSA, 0);
   804  #endif
   414  #endif
   805 +#ifndef WITHOUT_ED25519
   415 +#ifndef WITHOUT_ED25519
   806  			add_identity_file(options, "~/",
   416  			add_identity_file(options, "~/",
   807  			    _PATH_SSH_CLIENT_ID_ED25519, 0);
   417  			    _PATH_SSH_CLIENT_ID_ED25519, 0);
   808 +#endif /* WITHOUT_ED25519 */
   418 +#endif /* WITHOUT_ED25519 */
   809  		}
   419  		}
   810  	}
   420  	}
   811  	if (options->escape_char == -1)
   421  	if (options->escape_char == -1)
   812 diff -pur old/sc25519.c new/sc25519.c
       
   813 --- old/sc25519.c	2014-01-16 17:43:44.000000000 -0800
       
   814 +++ new/sc25519.c	2015-04-01 03:46:19.162528358 -0700
       
   815 @@ -6,6 +6,8 @@
       
   816   * Copied from supercop-20130419/crypto_sign/ed25519/ref/sc25519.c
       
   817   */
       
   818  
       
   819 +#ifndef WITHOUT_ED25519
       
   820 +
       
   821  #include "includes.h"
       
   822  
       
   823  #include "sc25519.h"
       
   824 @@ -306,3 +308,5 @@ void sc25519_2interleave2(unsigned char
       
   825    r[125] = ((s1->v[31] >> 2) & 3) ^ (((s2->v[31] >> 2) & 3) << 2);
       
   826    r[126] = ((s1->v[31] >> 4) & 3) ^ (((s2->v[31] >> 4) & 3) << 2);
       
   827  }
       
   828 +
       
   829 +#endif /* WITHOUT_ED25519 */
       
   830 diff -pur old/sc25519.h new/sc25519.h
       
   831 --- old/sc25519.h	2013-12-17 22:48:11.000000000 -0800
       
   832 +++ new/sc25519.h	2015-04-01 03:45:37.633735864 -0700
       
   833 @@ -8,6 +8,7 @@
       
   834  
       
   835  #ifndef SC25519_H
       
   836  #define SC25519_H
       
   837 +#ifndef WITHOUT_ED25519
       
   838  
       
   839  #include "crypto_api.h"
       
   840  
       
   841 @@ -77,4 +78,5 @@ void sc25519_window5(signed char r[51],
       
   842  
       
   843  void sc25519_2interleave2(unsigned char r[127], const sc25519 *s1, const sc25519 *s2);
       
   844  
       
   845 +#endif /* WITHOUT_ED25519 */
       
   846  #endif
       
   847 diff -pur old/servconf.c new/servconf.c
   422 diff -pur old/servconf.c new/servconf.c
   848 --- old/servconf.c	2015-03-31 21:14:02.437668507 -0700
   423 --- old/servconf.c	2015-05-12 06:57:55.748493685 -0700
   849 +++ new/servconf.c	2015-04-01 02:15:09.724697791 -0700
   424 +++ new/servconf.c	2015-05-12 06:57:55.872093181 -0700
   850 @@ -190,8 +190,10 @@ fill_default_server_options(ServerOption
   425 @@ -216,8 +216,10 @@ fill_default_server_options(ServerOption
   851  			options->host_key_files[options->num_host_key_files++] =
   426  			options->host_key_files[options->num_host_key_files++] =
   852  			    _PATH_HOST_ECDSA_KEY_FILE;
   427  			    _PATH_HOST_ECDSA_KEY_FILE;
   853  #endif
   428  #endif
   854 +#ifndef WITHOUT_ED25519
   429 +#ifndef WITHOUT_ED25519
   855  			options->host_key_files[options->num_host_key_files++] =
   430  			options->host_key_files[options->num_host_key_files++] =
   857 +#endif /* WITHOUT_ED25519 */
   432 +#endif /* WITHOUT_ED25519 */
   858  		}
   433  		}
   859  	}
   434  	}
   860  	/* No certificates by default */
   435  	/* No certificates by default */
   861 diff -pur old/smult_curve25519_ref.c new/smult_curve25519_ref.c
   436 diff -pur old/smult_curve25519_ref.c new/smult_curve25519_ref.c
   862 --- old/smult_curve25519_ref.c	2013-11-03 13:26:53.000000000 -0800
   437 --- old/smult_curve25519_ref.c	2015-03-16 22:49:20.000000000 -0700
   863 +++ new/smult_curve25519_ref.c	2015-04-01 04:55:30.360761627 -0700
   438 +++ new/smult_curve25519_ref.c	2015-05-12 06:57:55.872682983 -0700
   864 @@ -6,6 +6,8 @@ Public domain.
   439 @@ -6,6 +6,8 @@ Public domain.
   865  Derived from public domain code by D. J. Bernstein.
   440  Derived from public domain code by D. J. Bernstein.
   866  */
   441  */
   867  
   442  
   868 +#ifndef WITHOUT_ED25519
   443 +#ifndef WITHOUT_ED25519
   869 +
   444 +
   870  int crypto_scalarmult_curve25519(unsigned char *, const unsigned char *, const unsigned char *);
   445  int crypto_scalarmult_curve25519(unsigned char *, const unsigned char *, const unsigned char *);
   871  
   446  
   872  static void add(unsigned int out[32],const unsigned int a[32],const unsigned int b[32])
   447  static void add(unsigned int out[32],const unsigned int a[32],const unsigned int b[32])
   873 @@ -263,3 +265,5 @@ int crypto_scalarmult_curve25519(unsigne
   448 @@ -263,3 +265,4 @@ int crypto_scalarmult_curve25519(unsigne
   874    for (i = 0;i < 32;++i) q[i] = work[64 + i];
   449    for (i = 0;i < 32;++i) q[i] = work[64 + i];
   875    return 0;
   450    return 0;
   876  }
   451  }
   877 +
       
   878 +#endif /* WITHOUT_ED25519 */
   452 +#endif /* WITHOUT_ED25519 */
   879 diff -pur old/ssh-add.0 new/ssh-add.0
   453 diff -pur old/ssh-add.0 new/ssh-add.0
   880 --- old/ssh-add.0	2014-01-29 17:52:47.000000000 -0800
   454 --- old/ssh-add.0	2015-03-17 21:26:35.000000000 -0700
   881 +++ new/ssh-add.0	2015-04-02 08:18:24.840811117 -0700
   455 +++ new/ssh-add.0	2015-05-12 07:37:37.356166396 -0700
   882 @@ -11,7 +11,7 @@ SYNOPSIS
   456 @@ -11,7 +11,7 @@ SYNOPSIS
   883  DESCRIPTION
   457  DESCRIPTION
   884       ssh-add adds private key identities to the authentication agent,
   458       ssh-add adds private key identities to the authentication agent,
   885       ssh-agent(1).  When run without arguments, it adds the files
   459       ssh-agent(1).  When run without arguments, it adds the files
   886 -     ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and
   460 -     ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and
   887 +     ~/.ssh/id_rsa, ~/.ssh/id_dsa and
   461 +     ~/.ssh/id_rsa, ~/.ssh/id_dsa, and
   888       ~/.ssh/identity.  After loading a private key, ssh-add will try to load
   462       ~/.ssh/identity.  After loading a private key, ssh-add will try to load
   889       corresponding certificate information from the filename obtained by
   463       corresponding certificate information from the filename obtained by
   890       appending -cert.pub to the name of the private key file.  Alternative
   464       appending -cert.pub to the name of the private key file.  Alternative
   891 @@ -91,14 +91,6 @@ FILES
   465 @@ -96,14 +96,6 @@ FILES
   892               Contains the protocol version 2 DSA authentication identity of
   466               Contains the protocol version 2 DSA authentication identity of
   893               the user.
   467               the user.
   894  
   468  
   895 -     ~/.ssh/id_ecdsa
   469 -     ~/.ssh/id_ecdsa
   896 -             Contains the protocol version 2 ECDSA authentication identity of
   470 -             Contains the protocol version 2 ECDSA authentication identity of
   897 -             the user.
   471 -             the user.
   898 -
   472 -
   899 -     ~/.ssh/id_ed25519
   473 -     ~/.ssh/id_ed25519
   900 -             Contains the protocol version 2 ED25519 authentication identity
   474 -             Contains the protocol version 2 Ed25519 authentication identity
   901 -             of the user.
   475 -             of the user.
   902 -
   476 -
   903       ~/.ssh/id_rsa
   477       ~/.ssh/id_rsa
   904               Contains the protocol version 2 RSA authentication identity of
   478               Contains the protocol version 2 RSA authentication identity of
   905               the user.
   479               the user.
   906 diff -pur old/ssh-add.1 new/ssh-add.1
   480 diff -pur old/ssh-add.1 new/ssh-add.1
   907 --- old/ssh-add.1	2013-12-17 22:46:28.000000000 -0800
   481 --- old/ssh-add.1	2015-03-16 22:49:20.000000000 -0700
   908 +++ new/ssh-add.1	2015-04-02 08:11:00.150982710 -0700
   482 +++ new/ssh-add.1	2015-05-12 07:47:42.099918141 -0700
   909 @@ -57,8 +57,6 @@ adds private key identities to the authe
   483 @@ -58,8 +58,6 @@ adds private key identities to the authe
   910  When run without arguments, it adds the files
   484  When run without arguments, it adds the files
   911  .Pa ~/.ssh/id_rsa ,
   485  .Pa ~/.ssh/id_rsa ,
   912  .Pa ~/.ssh/id_dsa ,
   486  .Pa ~/.ssh/id_dsa ,
   913 -.Pa ~/.ssh/id_ecdsa ,
   487 -.Pa ~/.ssh/id_ecdsa ,
   914 -.Pa ~/.ssh/id_ed25519
   488 -.Pa ~/.ssh/id_ed25519
   915  and
   489  and
   916  .Pa ~/.ssh/identity .
   490  .Pa ~/.ssh/identity .
   917  After loading a private key,
   491  After loading a private key,
   918 @@ -168,10 +166,6 @@ socket used to communicate with the agen
   492 @@ -177,10 +175,6 @@ socket used to communicate with the agen
   919  Contains the protocol version 1 RSA authentication identity of the user.
   493  Contains the protocol version 1 RSA authentication identity of the user.
   920  .It Pa ~/.ssh/id_dsa
   494  .It Pa ~/.ssh/id_dsa
   921  Contains the protocol version 2 DSA authentication identity of the user.
   495  Contains the protocol version 2 DSA authentication identity of the user.
   922 -.It Pa ~/.ssh/id_ecdsa
   496 -.It Pa ~/.ssh/id_ecdsa
   923 -Contains the protocol version 2 ECDSA authentication identity of the user.
   497 -Contains the protocol version 2 ECDSA authentication identity of the user.
   924 -.It Pa ~/.ssh/id_ed25519
   498 -.It Pa ~/.ssh/id_ed25519
   925 -Contains the protocol version 2 ED25519 authentication identity of the user.
   499 -Contains the protocol version 2 Ed25519 authentication identity of the user.
   926  .It Pa ~/.ssh/id_rsa
   500  .It Pa ~/.ssh/id_rsa
   927  Contains the protocol version 2 RSA authentication identity of the user.
   501  Contains the protocol version 2 RSA authentication identity of the user.
   928  .El
   502  .El
   929 diff -pur old/ssh-add.c new/ssh-add.c
   503 diff -pur old/ssh-add.c new/ssh-add.c
   930 --- old/ssh-add.c	2013-12-28 22:44:07.000000000 -0800
   504 --- old/ssh-add.c	2015-03-16 22:49:20.000000000 -0700
   931 +++ new/ssh-add.c	2015-04-01 04:55:52.619415360 -0700
   505 +++ new/ssh-add.c	2015-05-12 06:57:55.873128238 -0700
   932 @@ -73,7 +73,9 @@ static char *default_files[] = {
   506 @@ -78,7 +78,9 @@ static char *default_files[] = {
   933  #ifdef OPENSSL_HAS_ECC
       
   934  	_PATH_SSH_CLIENT_ID_ECDSA,
   507  	_PATH_SSH_CLIENT_ID_ECDSA,
   935  #endif
   508  #endif
       
   509  #endif /* WITH_OPENSSL */
   936 +#ifndef WITHOUT_ED25519
   510 +#ifndef WITHOUT_ED25519
   937  	_PATH_SSH_CLIENT_ID_ED25519,
   511  	_PATH_SSH_CLIENT_ID_ED25519,
   938 +#endif /* WITHOUT_ED25519 */
   512 +#endif /* WITHOUT_ED25519 */
   939  	_PATH_SSH_CLIENT_IDENTITY,
   513  	_PATH_SSH_CLIENT_IDENTITY,
   940  	NULL
   514  	NULL
   941  };
   515  };
   942 diff -pur old/ssh-agent.0 new/ssh-agent.0
   516 diff -pur old/ssh-agent.0 new/ssh-agent.0
   943 --- old/ssh-agent.0	2014-01-29 17:52:47.000000000 -0800
   517 --- old/ssh-agent.0	2015-03-17 21:26:35.000000000 -0700
   944 +++ new/ssh-agent.0	2015-04-02 08:18:54.504859476 -0700
   518 +++ new/ssh-agent.0	2015-05-12 07:37:55.617194120 -0700
   945 @@ -9,7 +9,7 @@ SYNOPSIS
   519 @@ -10,7 +10,7 @@ SYNOPSIS
   946  
   520  
   947  DESCRIPTION
   521  DESCRIPTION
   948       ssh-agent is a program to hold private keys used for public key
   522       ssh-agent is a program to hold private keys used for public key
   949 -     authentication (RSA, DSA, ECDSA, ED25519).  The idea is that ssh-agent is
   523 -     authentication (RSA, DSA, ECDSA, Ed25519).  ssh-agent is usually started
   950 +     authentication (RSA, DSA).  The idea is that ssh-agent is
   524 +     authentication (RSA, DSA).  ssh-agent is usually started
   951       started in the beginning of an X-session or a login session, and all
   525       in the beginning of an X-session or a login session, and all other
   952       other windows or programs are started as clients to the ssh-agent
   526       windows or programs are started as clients to the ssh-agent program.
   953       program.  Through use of environment variables the agent can be located
   527       Through use of environment variables the agent can be located and
   954 @@ -46,8 +46,8 @@ DESCRIPTION
       
   955  
       
   956       The agent initially does not have any private keys.  Keys are added using
       
   957       ssh-add(1).  When executed without arguments, ssh-add(1) adds the files
       
   958 -     ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and
       
   959 -     ~/.ssh/identity.  If the identity has a passphrase, ssh-add(1) asks for
       
   960 +     ~/.ssh/id_rsa, ~/.ssh/id_dsa ~/.ssh/identity.  
       
   961 +     If the identity has a passphrase, ssh-add(1) asks for
       
   962       the passphrase on the terminal if it has one or from a small X11 program
       
   963       if running under X11.  If neither of these is the case then the
       
   964       authentication will fail.  It then sends the identity to the agent.
       
   965 @@ -97,14 +97,6 @@ FILES
       
   966               Contains the protocol version 2 DSA authentication identity of
       
   967               the user.
       
   968  
       
   969 -     ~/.ssh/id_ecdsa
       
   970 -             Contains the protocol version 2 ECDSA authentication identity of
       
   971 -             the user.
       
   972 -
       
   973 -     ~/.ssh/id_ed25519
       
   974 -             Contains the protocol version 2 ED25519 authentication identity
       
   975 -             of the user.
       
   976 -
       
   977       ~/.ssh/id_rsa
       
   978               Contains the protocol version 2 RSA authentication identity of
       
   979               the user.
       
   980 diff -pur old/ssh-agent.1 new/ssh-agent.1
   528 diff -pur old/ssh-agent.1 new/ssh-agent.1
   981 --- old/ssh-agent.1	2013-12-17 22:46:28.000000000 -0800
   529 --- old/ssh-agent.1	2015-03-16 22:49:20.000000000 -0700
   982 +++ new/ssh-agent.1	2015-04-02 08:11:35.139725778 -0700
   530 +++ new/ssh-agent.1	2015-05-12 07:47:53.707510271 -0700
   983 @@ -53,7 +53,7 @@
   531 @@ -54,7 +54,7 @@
   984  .Sh DESCRIPTION
   532  .Sh DESCRIPTION
   985  .Nm
   533  .Nm
   986  is a program to hold private keys used for public key authentication
   534  is a program to hold private keys used for public key authentication
   987 -(RSA, DSA, ECDSA, ED25519).
   535 -(RSA, DSA, ECDSA, Ed25519).
   988 +(RSA, DSA).
   536 +(RSA, DSA).
   989  The idea is that
       
   990  .Nm
   537  .Nm
   991  is started in the beginning of an X-session or a login session, and
   538  is usually started in the beginning of an X-session or a login session, and
   992 @@ -114,9 +114,7 @@ When executed without arguments,
   539  all other windows or programs are started as clients to the ssh-agent
   993  .Xr ssh-add 1
       
   994  adds the files
       
   995  .Pa ~/.ssh/id_rsa ,
       
   996 -.Pa ~/.ssh/id_dsa ,
       
   997 -.Pa ~/.ssh/id_ecdsa ,
       
   998 -.Pa ~/.ssh/id_ed25519
       
   999 +.Pa ~/.ssh/id_dsa 
       
  1000  and
       
  1001  .Pa ~/.ssh/identity .
       
  1002  If the identity has a passphrase,
       
  1003 @@ -189,10 +187,6 @@ line terminates.
       
  1004  Contains the protocol version 1 RSA authentication identity of the user.
       
  1005  .It Pa ~/.ssh/id_dsa
       
  1006  Contains the protocol version 2 DSA authentication identity of the user.
       
  1007 -.It Pa ~/.ssh/id_ecdsa
       
  1008 -Contains the protocol version 2 ECDSA authentication identity of the user.
       
  1009 -.It Pa ~/.ssh/id_ed25519
       
  1010 -Contains the protocol version 2 ED25519 authentication identity of the user.
       
  1011  .It Pa ~/.ssh/id_rsa
       
  1012  Contains the protocol version 2 RSA authentication identity of the user.
       
  1013  .It Pa $TMPDIR/ssh-XXXXXXXXXX/agent.\*(Ltppid\*(Gt
       
  1014 diff -pur old/ssh-ed25519.c new/ssh-ed25519.c
   540 diff -pur old/ssh-ed25519.c new/ssh-ed25519.c
  1015 --- old/ssh-ed25519.c	2013-12-06 17:37:54.000000000 -0800
   541 --- old/ssh-ed25519.c	2015-03-16 22:49:20.000000000 -0700
  1016 +++ new/ssh-ed25519.c	2015-04-01 03:45:52.747724716 -0700
   542 +++ new/ssh-ed25519.c	2015-05-12 06:57:55.873512963 -0700
  1017 @@ -15,6 +15,8 @@
   543 @@ -17,6 +17,8 @@
  1018   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   544  
  1019   */
   545  #include "includes.h"
  1020  
   546  
  1021 +#ifndef WITHOUT_ED25519
   547 +#ifndef WITHOUT_ED25519
  1022 +
   548 +
  1023  #include "includes.h"
       
  1024  
       
  1025  #include <sys/types.h>
   549  #include <sys/types.h>
  1026 @@ -141,3 +143,5 @@ ssh_ed25519_verify(const Key *key, const
   550  #include <limits.h>
  1027  	/* translate return code carefully */
   551  
  1028  	return (ret == 0) ? 1 : -1;
   552 @@ -164,3 +166,4 @@ ssh_ed25519_verify(const struct sshkey *
       
   553  	free(ktype);
       
   554  	return r;
  1029  }
   555  }
  1030 +
       
  1031 +#endif /* WITHOUT_ED25519 */
   556 +#endif /* WITHOUT_ED25519 */
  1032 diff -pur old/ssh-keygen.0 new/ssh-keygen.0
   557 diff -pur old/ssh-keygen.0 new/ssh-keygen.0
  1033 --- old/ssh-keygen.0	2014-01-29 17:52:47.000000000 -0800
   558 --- old/ssh-keygen.0	2015-03-17 21:26:35.000000000 -0700
  1034 +++ new/ssh-keygen.0	2015-04-02 08:01:54.866988427 -0700
   559 +++ new/ssh-keygen.0	2015-05-12 07:40:51.445122062 -0700
       
   560 @@ -4,7 +4,7 @@ NAME
       
   561       ssh-keygen M-bM-^@M-^S authentication key generation, management and conversion
       
   562  
       
   563  SYNOPSIS
       
   564 -     ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa | rsa1]
       
   565 +     ssh-keygen [-q] [-b bits] [-t dsa | rsa | rsa1]
       
   566                  [-N new_passphrase] [-C comment] [-f output_keyfile]
       
   567       ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
       
   568       ssh-keygen -i [-m key_format] [-f input_keyfile]
  1035 @@ -32,7 +32,7 @@ SYNOPSIS
   569 @@ -32,7 +32,7 @@ SYNOPSIS
  1036  DESCRIPTION
   570  DESCRIPTION
  1037       ssh-keygen generates, manages and converts authentication keys for
   571       ssh-keygen generates, manages and converts authentication keys for
  1038       ssh(1).  ssh-keygen can create RSA keys for use by SSH protocol version 1
   572       ssh(1).  ssh-keygen can create RSA keys for use by SSH protocol version 1
  1039 -     and DSA, ECDSA, ED25519 or RSA keys for use by SSH protocol version 2.
   573 -     and DSA, ECDSA, Ed25519 or RSA keys for use by SSH protocol version 2.
  1040 +     and DSA or RSA keys for use by SSH protocol version 2.
   574 +     and DSA or RSA keys for use by SSH protocol version 2.
  1041       The type of key to be generated is specified with the -t option.  If
   575       The type of key to be generated is specified with the -t option.  If
  1042       invoked without any arguments, ssh-keygen will generate an RSA key for
   576       invoked without any arguments, ssh-keygen will generate an RSA key for
  1043       use in SSH protocol 2 connections.
   577       use in SSH protocol 2 connections.
  1044 @@ -46,7 +46,7 @@ DESCRIPTION
   578 @@ -46,7 +46,7 @@ DESCRIPTION
  1053 @@ -79,14 +79,14 @@ DESCRIPTION
   587 @@ -79,14 +79,14 @@ DESCRIPTION
  1054  
   588  
  1055       The options are as follows:
   589       The options are as follows:
  1056  
   590  
  1057 -     -A      For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519) for
   591 -     -A      For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519) for
  1058 +     -A      For each of the key types (rsa1, rsa, and dsa) for
   592 +     -A      For each of the key types (rsa1, rsa and dsa) for
  1059               which host keys do not exist, generate the host keys with the
   593               which host keys do not exist, generate the host keys with the
  1060               default key file path, an empty passphrase, default bits for the
   594               default key file path, an empty passphrase, default bits for the
  1061               key type, and default comment.  This is used by /etc/rc to
   595               key type, and default comment.  This is used by /etc/rc to
  1062               generate new host keys.
   596               generate new host keys.
  1063  
   597  
  1064       -a rounds
   598       -a rounds
  1065 -             When saving a new-format private key (i.e. an ed25519 key or any
   599 -             When saving a new-format private key (i.e. an ed25519 key or any
  1066 +             When saving a new-format private key (i.e. any
   600 +             When saving a new-format private key (i.e. 
  1067               SSH protocol 2 key when the -o flag is set), this option
   601               SSH protocol 2 key when the -o flag is set), this option
  1068               specifies the number of KDF (key derivation function) rounds
   602               specifies the number of KDF (key derivation function) rounds
  1069               used.  Higher numbers result in slower passphrase verification
   603               used.  Higher numbers result in slower passphrase verification
  1070 @@ -103,12 +103,7 @@ DESCRIPTION
   604 @@ -103,12 +103,7 @@ DESCRIPTION
  1071               Specifies the number of bits in the key to create.  For RSA keys,
   605               Specifies the number of bits in the key to create.  For RSA keys,
  1073               Generally, 2048 bits is considered sufficient.  DSA keys must be
   607               Generally, 2048 bits is considered sufficient.  DSA keys must be
  1074 -             exactly 1024 bits as specified by FIPS 186-2.  For ECDSA keys,
   608 -             exactly 1024 bits as specified by FIPS 186-2.  For ECDSA keys,
  1075 -             the -b flag determines the key length by selecting from one of
   609 -             the -b flag determines the key length by selecting from one of
  1076 -             three elliptic curve sizes: 256, 384 or 521 bits.  Attempting to
   610 -             three elliptic curve sizes: 256, 384 or 521 bits.  Attempting to
  1077 -             use bit lengths other than these three values for ECDSA keys will
   611 -             use bit lengths other than these three values for ECDSA keys will
  1078 -             fail.  ED25519 keys have a fixed length and the -b flag will be
   612 -             fail.  Ed25519 keys have a fixed length and the -b flag will be
  1079 -             ignored.
   613 -             ignored.
  1080 +             exactly 1024 bits as specified by FIPS 186-2.
   614 +             exactly 1024 bits as specified by FIPS 186-2.
  1081  
   615  
  1082       -C comment
   616       -C comment
  1083               Provides a new comment.
   617               Provides a new comment.
  1084 @@ -274,7 +269,7 @@ DESCRIPTION
   618 @@ -279,7 +274,7 @@ DESCRIPTION
  1085               new OpenSSH format rather than the more compatible PEM format.
   619               new OpenSSH format rather than the more compatible PEM format.
  1086               The new format has increased resistance to brute-force password
   620               The new format has increased resistance to brute-force password
  1087               cracking but is not supported by versions of OpenSSH prior to
   621               cracking but is not supported by versions of OpenSSH prior to
  1088 -             6.5.  Ed25519 keys always use the new private key format.
   622 -             6.5.  Ed25519 keys always use the new private key format.
  1089 +             6.5.
   623 +             6.5.
  1090  
   624  
  1091       -P passphrase
   625       -P passphrase
  1092               Provides the (old) passphrase.
   626               Provides the (old) passphrase.
  1093 @@ -315,8 +310,8 @@ DESCRIPTION
   627 @@ -318,9 +313,9 @@ DESCRIPTION
  1094  
   628               Test DH group exchange candidate primes (generated using the -G
  1095       -t type
   629               option) for safety.
       
   630  
       
   631 -     -t dsa | ecdsa | ed25519 | rsa | rsa1
       
   632 +     -t dsa |  rsa | rsa1
  1096               Specifies the type of key to create.  The possible values are
   633               Specifies the type of key to create.  The possible values are
  1097 -             ``rsa1'' for protocol version 1 and ``dsa'', ``ecdsa'',
   634 -             M-bM-^@M-^\rsa1M-bM-^@M-^] for protocol version 1 and M-bM-^@M-^\dsaM-bM-^@M-^], M-bM-^@M-^\ecdsaM-bM-^@M-^], M-bM-^@M-^\ed25519M-bM-^@M-^], or
  1098 -             ``ed25519'', or ``rsa'' for protocol version 2.
   635 +             M-bM-^@M-^\rsa1M-bM-^@M-^] for protocol version 1 and M-bM-^@M-^\dsaM-bM-^@M-^], or
  1099 +             ``rsa1'' for protocol version 1 and ``dsa'' or ``rsa'' for 
   636               M-bM-^@M-^\rsaM-bM-^@M-^] for protocol version 2.
  1100 +             protocol version 2.
       
  1101  
   637  
  1102       -u      Update a KRL.  When specified with -k, keys listed via the
   638       -u      Update a KRL.  When specified with -k, keys listed via the
  1103               command line are added to the existing KRL rather than a new KRL
   639 @@ -525,10 +520,8 @@ FILES
  1104 @@ -521,10 +516,8 @@ FILES
       
  1105               contents of this file secret.
   640               contents of this file secret.
  1106  
   641  
  1107       ~/.ssh/id_dsa
   642       ~/.ssh/id_dsa
  1108 -     ~/.ssh/id_ecdsa
   643 -     ~/.ssh/id_ecdsa
  1109 -     ~/.ssh/id_ed25519
   644 -     ~/.ssh/id_ed25519
  1110       ~/.ssh/id_rsa
   645       ~/.ssh/id_rsa
  1111 -             Contains the protocol version 2 DSA, ECDSA, ED25519 or RSA
   646 -             Contains the protocol version 2 DSA, ECDSA, Ed25519 or RSA
  1112 +             Contains the protocol version 2 DSA or RSA
   647 +             Contains the protocol version 2 DSA or RSA
  1113               authentication identity of the user.  This file should not be
   648               authentication identity of the user.  This file should not be
  1114               readable by anyone but the user.  It is possible to specify a
   649               readable by anyone but the user.  It is possible to specify a
  1115               passphrase when generating the key; that passphrase will be used
   650               passphrase when generating the key; that passphrase will be used
  1116 @@ -534,10 +527,8 @@ FILES
   651 @@ -538,10 +531,8 @@ FILES
  1117               read this file when a login attempt is made.
   652               read this file when a login attempt is made.
  1118  
   653  
  1119       ~/.ssh/id_dsa.pub
   654       ~/.ssh/id_dsa.pub
  1120 -     ~/.ssh/id_ecdsa.pub
   655 -     ~/.ssh/id_ecdsa.pub
  1121 -     ~/.ssh/id_ed25519.pub
   656 -     ~/.ssh/id_ed25519.pub
  1122       ~/.ssh/id_rsa.pub
   657       ~/.ssh/id_rsa.pub
  1123 -             Contains the protocol version 2 DSA, ECDSA, ED25519 or RSA public
   658 -             Contains the protocol version 2 DSA, ECDSA, Ed25519 or RSA public
  1124 +             Contains the protocol version 2 DSA or RSA public
   659 +             Contains the protocol version 2 DSA or RSA public
  1125               key for authentication.  The contents of this file should be
   660               key for authentication.  The contents of this file should be
  1126               added to ~/.ssh/authorized_keys on all machines where the user
   661               added to ~/.ssh/authorized_keys on all machines where the user
  1127               wishes to log in using public key authentication.  There is no
   662               wishes to log in using public key authentication.  There is no
  1128 diff -pur old/ssh-keygen.1 new/ssh-keygen.1
   663 diff -pur old/ssh-keygen.1 new/ssh-keygen.1
  1129 --- old/ssh-keygen.1	2013-12-28 22:47:14.000000000 -0800
   664 --- old/ssh-keygen.1	2015-03-16 22:49:20.000000000 -0700
  1130 +++ new/ssh-keygen.1	2015-04-02 08:13:41.714356008 -0700
   665 +++ new/ssh-keygen.1	2015-05-12 07:49:52.125219558 -0700
  1131 @@ -140,7 +140,7 @@ generates, manages and converts authenti
   666 @@ -46,7 +46,7 @@
       
   667  .Nm ssh-keygen
       
   668  .Op Fl q
       
   669  .Op Fl b Ar bits
       
   670 -.Op Fl t Cm dsa | ecdsa | ed25519 | rsa | rsa1
       
   671 +.Op Fl t Cm dsa | rsa | rsa1
       
   672  .Op Fl N Ar new_passphrase
       
   673  .Op Fl C Ar comment
       
   674  .Op Fl f Ar output_keyfile
       
   675 @@ -142,7 +142,7 @@ generates, manages and converts authenti
  1132  .Xr ssh 1 .
   676  .Xr ssh 1 .
  1133  .Nm
   677  .Nm
  1134  can create RSA keys for use by SSH protocol version 1 and
   678  can create RSA keys for use by SSH protocol version 1 and
  1135 -DSA, ECDSA, ED25519 or RSA keys for use by SSH protocol version 2.
   679 -DSA, ECDSA, Ed25519 or RSA keys for use by SSH protocol version 2.
  1136 +DSA or RSA keys for use by SSH protocol version 2.
   680 +DSA or RSA keys for use by SSH protocol version 2.
  1137  The type of key to be generated is specified with the
   681  The type of key to be generated is specified with the
  1138  .Fl t
   682  .Fl t
  1139  option.
   683  option.
  1140 @@ -168,8 +168,6 @@ with public key authentication runs this
   684 @@ -170,8 +170,6 @@ with public key authentication runs this
  1141  key in
   685  key in
  1142  .Pa ~/.ssh/identity ,
   686  .Pa ~/.ssh/identity ,
  1143  .Pa ~/.ssh/id_dsa ,
   687  .Pa ~/.ssh/id_dsa ,
  1144 -.Pa ~/.ssh/id_ecdsa ,
   688 -.Pa ~/.ssh/id_ecdsa ,
  1145 -.Pa ~/.ssh/id_ed25519
   689 -.Pa ~/.ssh/id_ed25519
  1146  or
   690  or
  1147  .Pa ~/.ssh/id_rsa .
   691  .Pa ~/.ssh/id_rsa .
  1148  Additionally, the system administrator may use this to generate host keys,
   692  Additionally, the system administrator may use this to generate host keys,
  1149 @@ -217,7 +215,7 @@ should be placed to be activated.
   693 @@ -219,7 +217,7 @@ should be placed to be activated.
  1150  The options are as follows:
   694  The options are as follows:
  1151  .Bl -tag -width Ds
   695  .Bl -tag -width Ds
  1152  .It Fl A
   696  .It Fl A
  1153 -For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519)
   697 -For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519)
  1154 +For each of the key types (rsa1, rsa, dsa)
   698 +For each of the key types (rsa1, rsa and dsa)
  1155  for which host keys
   699  for which host keys
  1156  do not exist, generate the host keys with the default key file path,
   700  do not exist, generate the host keys with the default key file path,
  1157  an empty passphrase, default bits for the key type, and default comment.
   701  an empty passphrase, default bits for the key type, and default comment.
  1158 @@ -225,8 +223,7 @@ This is used by
   702 @@ -227,7 +225,7 @@ This is used by
  1159  .Pa /etc/rc
   703  .Pa /etc/rc
  1160  to generate new host keys.
   704  to generate new host keys.
  1161  .It Fl a Ar rounds
   705  .It Fl a Ar rounds
  1162 -When saving a new-format private key (i.e. an ed25519 key or any SSH protocol
   706 -When saving a new-format private key (i.e. an ed25519 key or any SSH protocol
  1163 -2 key when the
   707 +When saving a new-format private key (i.e. SSH protocol
  1164 +When saving a new-format private key (i.e. any SSH protocol 2 key when the
   708  2 key when the
  1165  .Fl o
   709  .Fl o
  1166  flag is set), this option specifies the number of KDF (key derivation function)
   710  flag is set), this option specifies the number of KDF (key derivation function)
  1167  rounds used.
   711 @@ -247,15 +245,6 @@ Specifies the number of bits in the key
  1168 @@ -245,15 +242,6 @@ Specifies the number of bits in the key
       
  1169  For RSA keys, the minimum size is 768 bits and the default is 2048 bits.
   712  For RSA keys, the minimum size is 768 bits and the default is 2048 bits.
  1170  Generally, 2048 bits is considered sufficient.
   713  Generally, 2048 bits is considered sufficient.
  1171  DSA keys must be exactly 1024 bits as specified by FIPS 186-2.
   714  DSA keys must be exactly 1024 bits as specified by FIPS 186-2.
  1172 -For ECDSA keys, the
   715 -For ECDSA keys, the
  1173 -.Fl b
   716 -.Fl b
  1174 -flag determines the key length by selecting from one of three elliptic
   717 -flag determines the key length by selecting from one of three elliptic
  1175 -curve sizes: 256, 384 or 521 bits.
   718 -curve sizes: 256, 384 or 521 bits.
  1176 -Attempting to use bit lengths other than these three values for ECDSA keys
   719 -Attempting to use bit lengths other than these three values for ECDSA keys
  1177 -will fail.
   720 -will fail.
  1178 -ED25519 keys have a fixed length and the
   721 -Ed25519 keys have a fixed length and the
  1179 -.Fl b
   722 -.Fl b
  1180 -flag will be ignored.
   723 -flag will be ignored.
  1181  .It Fl C Ar comment
   724  .It Fl C Ar comment
  1182  Provides a new comment.
   725  Provides a new comment.
  1183  .It Fl c
   726  .It Fl c
  1184 @@ -468,7 +456,6 @@ to save SSH protocol 2 private keys usin
   727 @@ -478,7 +467,6 @@ to save SSH protocol 2 private keys usin
  1185  the more compatible PEM format.
   728  the more compatible PEM format.
  1186  The new format has increased resistance to brute-force password cracking
   729  The new format has increased resistance to brute-force password cracking
  1187  but is not supported by versions of OpenSSH prior to 6.5.
   730  but is not supported by versions of OpenSSH prior to 6.5.
  1188 -Ed25519 keys always use the new private key format.
   731 -Ed25519 keys always use the new private key format.
  1189  .It Fl P Ar passphrase
   732  .It Fl P Ar passphrase
  1190  Provides the (old) passphrase.
   733  Provides the (old) passphrase.
  1191  .It Fl p
   734  .It Fl p
  1192 @@ -520,8 +507,6 @@ The possible values are
   735 @@ -524,14 +512,12 @@ section for details.
       
   736  Test DH group exchange candidate primes (generated using the
       
   737  .Fl G
       
   738  option) for safety.
       
   739 -.It Fl t Cm dsa | ecdsa | ed25519 | rsa | rsa1
       
   740 +.It Fl t Cm dsa | rsa | rsa1
       
   741  Specifies the type of key to create.
       
   742  The possible values are
  1193  .Dq rsa1
   743  .Dq rsa1
  1194  for protocol version 1 and
   744  for protocol version 1 and
  1195  .Dq dsa ,
   745  .Dq dsa ,
  1196 -.Dq ecdsa ,
   746 -.Dq ecdsa ,
  1197 -.Dq ed25519 ,
   747 -.Dq ed25519 ,
  1198  or
   748  or
  1199  .Dq rsa
   749  .Dq rsa
  1200  for protocol version 2.
   750  for protocol version 2.
  1201 @@ -800,10 +785,8 @@ where the user wishes to log in using RS
   751 @@ -810,10 +796,8 @@ where the user wishes to log in using RS
  1202  There is no need to keep the contents of this file secret.
   752  There is no need to keep the contents of this file secret.
  1203  .Pp
   753  .Pp
  1204  .It Pa ~/.ssh/id_dsa
   754  .It Pa ~/.ssh/id_dsa
  1205 -.It Pa ~/.ssh/id_ecdsa
   755 -.It Pa ~/.ssh/id_ecdsa
  1206 -.It Pa ~/.ssh/id_ed25519
   756 -.It Pa ~/.ssh/id_ed25519
  1207  .It Pa ~/.ssh/id_rsa
   757  .It Pa ~/.ssh/id_rsa
  1208 -Contains the protocol version 2 DSA, ECDSA, ED25519 or RSA
   758 -Contains the protocol version 2 DSA, ECDSA, Ed25519 or RSA
  1209 +Contains the protocol version 2 DSA or RSA
   759 +Contains the protocol version 2 DSA or RSA
  1210  authentication identity of the user.
   760  authentication identity of the user.
  1211  This file should not be readable by anyone but the user.
   761  This file should not be readable by anyone but the user.
  1212  It is possible to
   762  It is possible to
  1213 @@ -816,10 +799,8 @@ but it is offered as the default file fo
   763 @@ -826,10 +810,8 @@ but it is offered as the default file fo
  1214  will read this file when a login attempt is made.
   764  will read this file when a login attempt is made.
  1215  .Pp
   765  .Pp
  1216  .It Pa ~/.ssh/id_dsa.pub
   766  .It Pa ~/.ssh/id_dsa.pub
  1217 -.It Pa ~/.ssh/id_ecdsa.pub
   767 -.It Pa ~/.ssh/id_ecdsa.pub
  1218 -.It Pa ~/.ssh/id_ed25519.pub
   768 -.It Pa ~/.ssh/id_ed25519.pub
  1219  .It Pa ~/.ssh/id_rsa.pub
   769  .It Pa ~/.ssh/id_rsa.pub
  1220 -Contains the protocol version 2 DSA, ECDSA, ED25519 or RSA
   770 -Contains the protocol version 2 DSA, ECDSA, Ed25519 or RSA
  1221 +Contains the protocol version 2 DSA or RSA
   771 +Contains the protocol version 2 DSA or RSA
  1222  public key for authentication.
   772  public key for authentication.
  1223  The contents of this file should be added to
   773  The contents of this file should be added to
  1224  .Pa ~/.ssh/authorized_keys
   774  .Pa ~/.ssh/authorized_keys
  1225 diff -pur old/ssh-keygen.c new/ssh-keygen.c
   775 diff -pur old/ssh-keygen.c new/ssh-keygen.c
  1226 --- old/ssh-keygen.c	2013-12-06 16:24:02.000000000 -0800
   776 --- old/ssh-keygen.c	2015-03-16 22:49:20.000000000 -0700
  1227 +++ new/ssh-keygen.c	2015-04-01 02:26:11.265143754 -0700
   777 +++ new/ssh-keygen.c	2015-05-12 06:57:55.874834232 -0700
  1228 @@ -197,7 +197,11 @@ type_bits_valid(int type, u_int32_t *bit
   778 @@ -214,7 +214,11 @@ type_bits_valid(int type, const char *na
  1229  	}
   779  	}
  1230  	if (type == KEY_DSA && *bitsp != 1024)
   780  	if (type == KEY_DSA && *bitsp != 1024)
  1231  		fatal("DSA keys must be 1024 bits");
   781  		fatal("DSA keys must be 1024 bits");
  1232 +#ifdef WITHOUT_ED25519
   782 -	else if (type != KEY_ECDSA && type != KEY_ED25519 && *bitsp < 768)
  1233 +	else if (type != KEY_ECDSA && *bitsp < 768)
   783 +	else if (type != KEY_ECDSA &&
  1234 +#else /* WITHOUT_ED25519 */
   784 +#ifndef WITHOUT_ED25519
  1235  	else if (type != KEY_ECDSA && type != KEY_ED25519 && *bitsp < 768)
   785 +		 type != KEY_ED25519 &&
  1236 +#endif /* WITHOUT_ED25519 */
   786 +#endif /* WITHOUT_ED25519 */
       
   787 +		 *bitsp < 768)
  1237  		fatal("Key must at least be 768 bits");
   788  		fatal("Key must at least be 768 bits");
  1238  	else if (type == KEY_ECDSA && key_ecdsa_bits_to_nid(*bitsp) == -1)
   789  	else if (type == KEY_ECDSA && sshkey_ecdsa_bits_to_nid(*bitsp) == -1)
  1239  		fatal("Invalid ECDSA key length - valid lengths are "
   790  		fatal("Invalid ECDSA key length - valid lengths are "
  1240 @@ -233,10 +237,12 @@ ask_filename(struct passwd *pw, const ch
   791 @@ -251,10 +255,12 @@ ask_filename(struct passwd *pw, const ch
  1241  		case KEY_RSA:
   792  		case KEY_RSA:
  1242  			name = _PATH_SSH_CLIENT_ID_RSA;
   793  			name = _PATH_SSH_CLIENT_ID_RSA;
  1243  			break;
   794  			break;
  1244 +#ifndef WITHOUT_ED25519
   795 +#ifndef WITHOUT_ED25519
  1245  		case KEY_ED25519:
   796  		case KEY_ED25519:
  1248  			break;
   799  			break;
  1249 +#endif /* WITHOUT_ED25519 */
   800 +#endif /* WITHOUT_ED25519 */
  1250  		default:
   801  		default:
  1251  			fprintf(stderr, "bad key type\n");
   802  			fprintf(stderr, "bad key type\n");
  1252  			exit(1);
   803  			exit(1);
  1253 @@ -900,7 +906,9 @@ do_gen_all_hostkeys(struct passwd *pw)
   804 @@ -954,7 +960,9 @@ do_gen_all_hostkeys(struct passwd *pw)
  1254  #ifdef OPENSSL_HAS_ECC
   805  #ifdef OPENSSL_HAS_ECC
  1255  		{ "ecdsa", "ECDSA",_PATH_HOST_ECDSA_KEY_FILE },
   806  		{ "ecdsa", "ECDSA",_PATH_HOST_ECDSA_KEY_FILE },
  1256  #endif
   807  #endif
  1257 +#ifndef WITHOUT_ED25519
   808 +#ifndef WITHOUT_ED25519
  1258  		{ "ed25519", "ED25519",_PATH_HOST_ED25519_KEY_FILE },
   809  		{ "ed25519", "ED25519",_PATH_HOST_ED25519_KEY_FILE },
  1259 +#endif /* WITHOUT_ED25519 */
   810 +#endif /* WITHOUT_ED25519 */
  1260  		{ NULL, NULL, NULL }
   811  		{ NULL, NULL, NULL }
  1261  	};
   812  	};
  1262  
   813  
  1263 @@ -1616,7 +1624,10 @@ do_ca_sign(struct passwd *pw, int argc,
   814 @@ -1643,7 +1651,10 @@ do_ca_sign(struct passwd *pw, int argc,
  1264  		if ((public = key_load_public(tmp, &comment)) == NULL)
   815  			fatal("%s: unable to open \"%s\": %s",
  1265  			fatal("%s: unable to open \"%s\"", __func__, tmp);
   816  			    __func__, tmp, ssh_err(r));
  1266  		if (public->type != KEY_RSA && public->type != KEY_DSA &&
   817  		if (public->type != KEY_RSA && public->type != KEY_DSA &&
  1267 -		    public->type != KEY_ECDSA && public->type != KEY_ED25519)
   818 -		    public->type != KEY_ECDSA && public->type != KEY_ED25519)
  1268 +#ifndef WITHOUT_ED25519
   819 +#ifndef WITHOUT_ED25519
  1269 +		    public->type != KEY_ED25519 &&
   820 +		    public->type != KEY_ED25519 && 
  1270 +#endif /* WITHOUT_ED25519 */
   821 +#endif /* WITHOUT_ED25519 */
  1271 +		    public->type != KEY_ECDSA)
   822 +		    public->type != KEY_ECDSA)
  1272  			fatal("%s: key \"%s\" type %s cannot be certified",
   823  			fatal("%s: key \"%s\" type %s cannot be certified",
  1273  			    __func__, tmp, key_type(public));
   824  			    __func__, tmp, sshkey_type(public));
  1274  
   825  
       
   826 @@ -2558,8 +2569,10 @@ main(int argc, char **argv)
       
   827  			    _PATH_HOST_DSA_KEY_FILE, rr_hostname);
       
   828  			n += do_print_resource_record(pw,
       
   829  			    _PATH_HOST_ECDSA_KEY_FILE, rr_hostname);
       
   830 +#ifndef WITHOUT_ED25519
       
   831  			n += do_print_resource_record(pw,
       
   832  			    _PATH_HOST_ED25519_KEY_FILE, rr_hostname);
       
   833 +#endif /* WITHOUT_ED25519 */
       
   834  			if (n == 0)
       
   835  				fatal("no keys found.");
       
   836  			exit(0);
  1275 diff -pur old/ssh-keyscan.0 new/ssh-keyscan.0
   837 diff -pur old/ssh-keyscan.0 new/ssh-keyscan.0
  1276 --- old/ssh-keyscan.0	2014-01-29 17:52:47.000000000 -0800
   838 --- old/ssh-keyscan.0	2015-03-17 21:26:35.000000000 -0700
  1277 +++ new/ssh-keyscan.0	2015-04-02 08:03:08.223476077 -0700
   839 +++ new/ssh-keyscan.0	2015-05-12 07:42:45.592281964 -0700
  1278 @@ -48,9 +48,9 @@ DESCRIPTION
   840 @@ -48,9 +48,9 @@ DESCRIPTION
  1279       -t type
   841       -t type
  1280               Specifies the type of the key to fetch from the scanned hosts.
   842               Specifies the type of the key to fetch from the scanned hosts.
  1281               The possible values are ``rsa1'' for protocol version 1 and
   843               The possible values are M-bM-^@M-^\rsa1M-bM-^@M-^] for protocol version 1 and M-bM-^@M-^\dsaM-bM-^@M-^],
  1282 -             ``dsa'', ``ecdsa'', ``ed25519'', or ``rsa'' for protocol version
   844 -             M-bM-^@M-^\ecdsaM-bM-^@M-^], M-bM-^@M-^\ed25519M-bM-^@M-^], or M-bM-^@M-^\rsaM-bM-^@M-^] for protocol version 2.  Multiple
  1283 +             ``dsa'' or ``rsa'' for protocol version
   845 +             or M-bM-^@M-^\rsaM-bM-^@M-^] for protocol version 2.  Multiple
  1284               2.  Multiple values may be specified by separating them with
   846               values may be specified by separating them with commas.  The
  1285 -             commas.  The default is to fetch ``rsa'' and ``ecdsa'' keys.
   847 -             default is to fetch M-bM-^@M-^\rsaM-bM-^@M-^], M-bM-^@M-^\ecdsaM-bM-^@M-^], and M-bM-^@M-^\ed25519M-bM-^@M-^] keys.
  1286 +             commas.  The default is to fetch ``rsa'' keys.
   848 +             default is to fetch M-bM-^@M-^\rsaM-bM-^@M-^] keys.
  1287  
   849  
  1288       -v      Verbose mode.  Causes ssh-keyscan to print debugging messages
   850       -v      Verbose mode.  Causes ssh-keyscan to print debugging messages
  1289               about its progress.
   851               about its progress.
  1290 @@ -72,12 +72,11 @@ FILES
   852 @@ -72,12 +72,11 @@ FILES
  1291  
   853  
  1292       host-or-namelist bits exponent modulus
   854       host-or-namelist bits exponent modulus
  1293  
   855  
  1294 -     Output format for rsa, dsa and ecdsa keys:
   856 -     Output format for RSA, DSA, ECDSA, and Ed25519 keys:
  1295 +     Output format for rsa and dsa keys:
   857 +     Output format for RSA, and DSA keys:
  1296  
   858  
  1297       host-or-namelist keytype base64-encoded-key
   859       host-or-namelist keytype base64-encoded-key
  1298  
   860  
  1299 -     Where keytype is either ``ecdsa-sha2-nistp256'', ``ecdsa-sha2-nistp384'',
   861 -     Where keytype is either M-bM-^@M-^\ecdsa-sha2-nistp256M-bM-^@M-^], M-bM-^@M-^\ecdsa-sha2-nistp384M-bM-^@M-^],
  1300 -     ``ecdsa-sha2-nistp521'', ``ssh-ed25519'', ``ssh-dss'' or ``ssh-rsa''.
   862 -     M-bM-^@M-^\ecdsa-sha2-nistp521M-bM-^@M-^], M-bM-^@M-^\ssh-ed25519M-bM-^@M-^], M-bM-^@M-^\ssh-dssM-bM-^@M-^] or M-bM-^@M-^\ssh-rsaM-bM-^@M-^].
  1301 +     Where keytype is either ``ssh-dss'' or ``ssh-rsa''.
   863 +     Where keytype is either M-bM-^@M-^\ssh-dssM-bM-^@M-^] or M-bM-^@M-^\ssh-rsaM-bM-^@M-^].
  1302  
   864  
  1303       /etc/ssh/ssh_known_hosts
   865       /etc/ssh/ssh_known_hosts
  1304  
   866  
  1305 @@ -89,7 +88,7 @@ EXAMPLES
   867 @@ -89,7 +88,7 @@ EXAMPLES
  1306       Find all hosts from the file ssh_hosts which have new or different keys
   868       Find all hosts from the file ssh_hosts which have new or different keys
  1307       from those in the sorted file ssh_known_hosts:
   869       from those in the sorted file ssh_known_hosts:
  1308  
   870  
  1309 -     $ ssh-keyscan -t rsa,dsa,ecdsa -f ssh_hosts | \
   871 -     $ ssh-keyscan -t rsa,dsa,ecdsa,ed25519 -f ssh_hosts | \
  1310 +     $ ssh-keyscan -t rsa,dsa -f ssh_hosts | \
   872 +     $ ssh-keyscan -t rsa,dsa -f ssh_hosts | \
  1311               sort -u - ssh_known_hosts | diff ssh_known_hosts -
   873               sort -u - ssh_known_hosts | diff ssh_known_hosts -
  1312  
   874  
  1313  SEE ALSO
   875  SEE ALSO
  1314 diff -pur old/ssh-keyscan.1 new/ssh-keyscan.1
   876 diff -pur old/ssh-keyscan.1 new/ssh-keyscan.1
  1315 --- old/ssh-keyscan.1	2013-12-17 22:46:28.000000000 -0800
   877 --- old/ssh-keyscan.1	2015-03-16 22:49:20.000000000 -0700
  1316 +++ new/ssh-keyscan.1	2015-04-02 08:14:50.877137257 -0700
   878 +++ new/ssh-keyscan.1	2015-05-12 07:50:53.173745820 -0700
  1317 @@ -89,16 +89,12 @@ The possible values are
   879 @@ -90,18 +90,13 @@ Specifies the type of the key to fetch f
       
   880  The possible values are
  1318  .Dq rsa1
   881  .Dq rsa1
  1319  for protocol version 1 and
   882  for protocol version 1 and
  1320  .Dq dsa ,
   883 -.Dq dsa ,
  1321 -.Dq ecdsa ,
   884 -.Dq ecdsa ,
  1322 -.Dq ed25519 ,
   885 -.Dq ed25519 ,
       
   886 +.Dq dsa 
  1323  or
   887  or
  1324  .Dq rsa
   888  .Dq rsa
  1325  for protocol version 2.
   889  for protocol version 2.
  1326  Multiple values may be specified by separating them with commas.
   890  Multiple values may be specified by separating them with commas.
  1327  The default is to fetch
   891  The default is to fetch
  1328  .Dq rsa
   892 -.Dq rsa ,
       
   893 -.Dq ecdsa ,
  1329 -and
   894 -and
  1330 -.Dq ecdsa
   895 -.Dq ed25519
       
   896 +.Dq rsa 
  1331  keys.
   897  keys.
  1332  .It Fl v
   898  .It Fl v
  1333  Verbose mode.
   899  Verbose mode.
  1334 @@ -127,7 +123,7 @@ attacks which have begun after the ssh_k
   900 @@ -130,7 +125,7 @@ Output format for RSA1 keys:
  1335  host-or-namelist bits exponent modulus
   901  host-or-namelist bits exponent modulus
  1336  .Ed
   902  .Ed
  1337  .Pp
   903  .Pp
  1338 -.Pa Output format for rsa, dsa and ecdsa keys:
   904 -Output format for RSA, DSA, ECDSA, and Ed25519 keys:
  1339 +.Pa Output format for rsa and dsa keys:
   905 +Output format for RSA and DSA keys:
  1340  .Bd -literal
   906  .Bd -literal
  1341  host-or-namelist keytype base64-encoded-key
   907  host-or-namelist keytype base64-encoded-key
  1342  .Ed
   908  .Ed
  1343 @@ -135,10 +131,6 @@ host-or-namelist keytype base64-encoded-
   909 @@ -138,10 +133,6 @@ host-or-namelist keytype base64-encoded-
  1344  Where
   910  Where
  1345  .Pa keytype
   911  .Ar keytype
  1346  is either
   912  is either
  1347 -.Dq ecdsa-sha2-nistp256 ,
   913 -.Dq ecdsa-sha2-nistp256 ,
  1348 -.Dq ecdsa-sha2-nistp384 ,
   914 -.Dq ecdsa-sha2-nistp384 ,
  1349 -.Dq ecdsa-sha2-nistp521 ,
   915 -.Dq ecdsa-sha2-nistp521 ,
  1350 -.Dq ssh-ed25519 ,
   916 -.Dq ssh-ed25519 ,
  1351  .Dq ssh-dss
   917  .Dq ssh-dss
  1352  or
   918  or
  1353  .Dq ssh-rsa .
   919  .Dq ssh-rsa .
  1354 @@ -158,7 +150,7 @@ Find all hosts from the file
   920 @@ -159,7 +150,7 @@ Find all hosts from the file
  1355  which have new or different keys from those in the sorted file
   921  which have new or different keys from those in the sorted file
  1356  .Pa ssh_known_hosts :
   922  .Pa ssh_known_hosts :
  1357  .Bd -literal
   923  .Bd -literal
  1358 -$ ssh-keyscan -t rsa,dsa,ecdsa -f ssh_hosts | \e
   924 -$ ssh-keyscan -t rsa,dsa,ecdsa,ed25519 -f ssh_hosts | \e
  1359 +$ ssh-keyscan -t rsa,dsa -f ssh_hosts | \e
   925 +$ ssh-keyscan -t rsa,dsa -f ssh_hosts | \e
  1360  	sort -u - ssh_known_hosts | diff ssh_known_hosts -
   926  	sort -u - ssh_known_hosts | diff ssh_known_hosts -
  1361  .Ed
   927  .Ed
  1362  .Sh SEE ALSO
   928  .Sh SEE ALSO
  1363 diff -pur old/ssh-keyscan.c new/ssh-keyscan.c
   929 diff -pur old/ssh-keyscan.c new/ssh-keyscan.c
  1364 --- old/ssh-keyscan.c	2013-12-06 16:24:02.000000000 -0800
   930 --- old/ssh-keyscan.c	2015-03-16 22:49:20.000000000 -0700
  1365 +++ new/ssh-keyscan.c	2015-04-01 02:51:28.981556385 -0700
   931 +++ new/ssh-keyscan.c	2015-05-12 06:57:55.875467494 -0700
  1366 @@ -56,7 +56,9 @@ int ssh_port = SSH_DEFAULT_PORT;
   932 @@ -286,7 +286,9 @@ keygrab_ssh2(con *c)
  1367  #define KT_DSA		2
   933  	c->c_ssh->kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
  1368  #define KT_RSA		4
   934  # endif
  1369  #define KT_ECDSA	8
   935  #endif
  1370 +#ifndef WITHOUT_ED25519
   936 +#ifndef WITHOUT_ED25519
  1371  #define KT_ED25519	16
   937  	c->c_ssh->kex->kex[KEX_C25519_SHA256] = kexc25519_client;
  1372 +#endif /* WITHOUT_ED25519 */
   938 +#endif /* WITHOUT_ED25519 */
  1373  
   939  	ssh_set_verify_host_key_callback(c->c_ssh, key_print_wrapper);
  1374  int get_keytypes = KT_RSA|KT_ECDSA;/* Get RSA and ECDSA keys by default */
   940  	/*
  1375  
   941  	 * do the key-exchange until an error occurs or until
  1376 @@ -247,9 +249,11 @@ keygrab_ssh2(con *c)
   942 @@ -609,10 +611,15 @@ do_host(char *host)
  1377  	packet_set_connection(c->c_fd, c->c_fd);
       
  1378  	enable_compat20();
       
  1379  	myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] =
       
  1380 -	    c->c_keytype == KT_DSA ?  "ssh-dss" :
       
  1381 +#ifndef WITHOUT_ED25519
       
  1382 +	    c->c_keytype == KT_ED25519 ?  "ssh-ed25519" :
       
  1383 +#endif /* WITHOUT_ED25519 */
       
  1384  	    (c->c_keytype == KT_RSA ? "ssh-rsa" :
       
  1385 -	    (c->c_keytype == KT_ED25519 ? "ssh-ed25519" :
       
  1386 +	    (c->c_keytype == KT_DSA ? "ssh-dss" :
       
  1387  	    "ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521"));
       
  1388  	c->c_kex = kex_setup(myproposal);
       
  1389  	c->c_kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client;
       
  1390 @@ -257,7 +261,9 @@ keygrab_ssh2(con *c)
       
  1391  	c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
       
  1392  	c->c_kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
       
  1393  	c->c_kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
       
  1394 +#ifndef WITHOUT_ED25519
       
  1395  	c->c_kex->kex[KEX_C25519_SHA256] = kexc25519_client;
       
  1396 +#endif /* WITHOUT_ED25519 */
       
  1397  	c->c_kex->verify_host_key = hostjump;
       
  1398  
       
  1399  	if (!(j = setjmp(kexjmp))) {
       
  1400 @@ -575,10 +581,15 @@ do_host(char *host)
       
  1401  {
   943  {
  1402  	char *name = strnnsep(&host, " \t\n");
   944  	char *name = strnnsep(&host, " \t\n");
  1403  	int j;
   945  	int j;
  1404 +#ifdef WITHOUT_ED25519
   946 +#ifndef WITHOUT_ED25519
       
   947 +	int max_kt = KT_ED25519;
       
   948 +#else
  1405 +	int max_kt = KT_ECDSA;
   949 +	int max_kt = KT_ECDSA;
  1406 +#else
   950 +#endif /* WITHOUT_ED25519 */
  1407 +	int max_kt = KT_ED25519;
       
  1408 +#endif
       
  1409  
   951  
  1410  	if (name == NULL)
   952  	if (name == NULL)
  1411  		return;
   953  		return;
  1412 -	for (j = KT_RSA1; j <= KT_ED25519; j *= 2) {
   954 -	for (j = KT_RSA1; j <= KT_ED25519; j *= 2) {
  1413 +	for (j = KT_RSA1; j <= max_kt; j *= 2) {
   955 +	for (j = KT_RSA1; j <= max_kt; j *= 2) {
  1414  		if (get_keytypes & j) {
   956  		if (get_keytypes & j) {
  1415  			while (ncon >= MAXCON)
   957  			while (ncon >= MAXCON)
  1416  				conloop();
   958  				conloop();
  1417 @@ -685,9 +696,11 @@ main(int argc, char **argv)
   959 @@ -716,9 +723,11 @@ main(int argc, char **argv)
  1418  				case KEY_RSA:
   960  				case KEY_RSA:
  1419  					get_keytypes |= KT_RSA;
   961  					get_keytypes |= KT_RSA;
  1420  					break;
   962  					break;
  1421 +#ifndef WITHOUT_ED25519
   963 +#ifndef WITHOUT_ED25519
  1422  				case KEY_ED25519:
   964  				case KEY_ED25519:
  1425 +#endif /* WITHOUT_ED25519 */
   967 +#endif /* WITHOUT_ED25519 */
  1426  				case KEY_UNSPEC:
   968  				case KEY_UNSPEC:
  1427  					fatal("unknown key type %s", tname);
   969  					fatal("unknown key type %s", tname);
  1428  				}
   970  				}
  1429 diff -pur old/ssh-keysign.0 new/ssh-keysign.0
   971 diff -pur old/ssh-keysign.0 new/ssh-keysign.0
  1430 --- old/ssh-keysign.0	2014-01-29 17:52:48.000000000 -0800
   972 --- old/ssh-keysign.0	2015-03-17 21:26:36.000000000 -0700
  1431 +++ new/ssh-keysign.0	2015-04-02 08:03:28.313581826 -0700
   973 +++ new/ssh-keysign.0	2015-05-12 07:42:57.261187576 -0700
  1432 @@ -24,8 +24,6 @@ FILES
   974 @@ -24,8 +24,6 @@ FILES
  1433               Controls whether ssh-keysign is enabled.
   975               Controls whether ssh-keysign is enabled.
  1434  
   976  
  1435       /etc/ssh/ssh_host_dsa_key
   977       /etc/ssh/ssh_host_dsa_key
  1436 -     /etc/ssh/ssh_host_ecdsa_key
   978 -     /etc/ssh/ssh_host_ecdsa_key
  1446 -     /etc/ssh/ssh_host_ed25519_key-cert.pub
   988 -     /etc/ssh/ssh_host_ed25519_key-cert.pub
  1447       /etc/ssh/ssh_host_rsa_key-cert.pub
   989       /etc/ssh/ssh_host_rsa_key-cert.pub
  1448               If these files exist they are assumed to contain public
   990               If these files exist they are assumed to contain public
  1449               certificate information corresponding with the private keys
   991               certificate information corresponding with the private keys
  1450 diff -pur old/ssh-keysign.8 new/ssh-keysign.8
   992 diff -pur old/ssh-keysign.8 new/ssh-keysign.8
  1451 --- old/ssh-keysign.8	2015-03-31 21:14:02.337922491 -0700
   993 --- old/ssh-keysign.8	2015-05-12 06:57:55.609219058 -0700
  1452 +++ new/ssh-keysign.8	2015-04-02 08:16:42.230595366 -0700
   994 +++ new/ssh-keysign.8	2015-05-12 07:52:35.880504667 -0700
  1453 @@ -62,8 +62,6 @@ Controls whether
   995 @@ -62,8 +62,6 @@ Controls whether
  1454  is enabled.
   996  is enabled.
  1455  .Pp
   997  .Pp
  1456  .It Pa /etc/ssh/ssh_host_dsa_key
   998  .It Pa /etc/ssh/ssh_host_dsa_key
  1457 -.It Pa /etc/ssh/ssh_host_ecdsa_key
   999 -.It Pa /etc/ssh/ssh_host_ecdsa_key
  1467 -.It Pa /etc/ssh/ssh_host_ed25519_key-cert.pub
  1009 -.It Pa /etc/ssh/ssh_host_ed25519_key-cert.pub
  1468  .It Pa /etc/ssh/ssh_host_rsa_key-cert.pub
  1010  .It Pa /etc/ssh/ssh_host_rsa_key-cert.pub
  1469  If these files exist they are assumed to contain public certificate
  1011  If these files exist they are assumed to contain public certificate
  1470  information corresponding with the private keys above.
  1012  information corresponding with the private keys above.
  1471 diff -pur old/ssh-keysign.c new/ssh-keysign.c
  1013 diff -pur old/ssh-keysign.c new/ssh-keysign.c
  1472 --- old/ssh-keysign.c	2013-12-06 16:24:02.000000000 -0800
  1014 --- old/ssh-keysign.c	2015-03-16 22:49:20.000000000 -0700
  1473 +++ new/ssh-keysign.c	2015-04-01 02:53:53.600004403 -0700
  1015 +++ new/ssh-keysign.c	2015-05-25 04:37:07.788045828 -0700
  1474 @@ -150,7 +150,11 @@ main(int argc, char **argv)
  1016 @@ -168,7 +168,7 @@ main(int argc, char **argv)
  1475  {
  1017  {
  1476  	Buffer b;
  1018  	struct sshbuf *b;
  1477  	Options options;
  1019  	Options options;
  1478 +#ifdef WITHOUT_ED25519
  1020 -#define NUM_KEYTYPES 4
  1479 +#define NUM_KEYTYPES 3
  1021 +#define NUM_KEYTYPES 3
  1480 +#else
  1022  	struct sshkey *keys[NUM_KEYTYPES], *key = NULL;
  1481  #define NUM_KEYTYPES 4
       
  1482 +#endif
       
  1483  	Key *keys[NUM_KEYTYPES], *key = NULL;
       
  1484  	struct passwd *pw;
  1023  	struct passwd *pw;
  1485  	int key_fd[NUM_KEYTYPES], i, found, version = 2, fd;
  1024  	int r, key_fd[NUM_KEYTYPES], i, found, version = 2, fd;
  1486 @@ -169,7 +173,9 @@ main(int argc, char **argv)
  1025 @@ -189,7 +189,9 @@ main(int argc, char **argv)
  1487  	i = 0;
  1026  	i = 0;
  1488  	key_fd[i++] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
  1027  	key_fd[i++] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
  1489  	key_fd[i++] = open(_PATH_HOST_ECDSA_KEY_FILE, O_RDONLY);
  1028  	key_fd[i++] = open(_PATH_HOST_ECDSA_KEY_FILE, O_RDONLY);
  1490 +#ifndef WITHOUT_ED25519
  1029 +#ifndef WITHOUT_ED25519
  1491  	key_fd[i++] = open(_PATH_HOST_ED25519_KEY_FILE, O_RDONLY);
  1030  	key_fd[i++] = open(_PATH_HOST_ED25519_KEY_FILE, O_RDONLY);
  1492 +#endif /* WITHOUT_ED25519 */
  1031 +#endif /* WITHOUT_ED25519 */
  1493  	key_fd[i++] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
  1032  	key_fd[i++] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
  1494  
  1033  
  1495  	original_real_uid = getuid();	/* XXX readconf.c needs this */
  1034  	original_real_uid = getuid();	/* XXX readconf.c needs this */
  1496 diff -pur old/ssh.0 new/ssh.0
  1035 diff -pur old/ssh.0 new/ssh.0
  1497 --- old/ssh.0	2014-01-29 17:52:47.000000000 -0800
  1036 --- old/ssh.0	2015-03-17 21:26:35.000000000 -0700
  1498 +++ new/ssh.0	2015-04-02 08:05:51.667197938 -0700
  1037 +++ new/ssh.0	2015-05-12 07:44:32.393217723 -0700
  1499 @@ -142,8 +142,8 @@ DESCRIPTION
  1038 @@ -141,8 +141,8 @@ DESCRIPTION
  1500       -i identity_file
  1039       -i identity_file
  1501               Selects a file from which the identity (private key) for public
  1040               Selects a file from which the identity (private key) for public
  1502               key authentication is read.  The default is ~/.ssh/identity for
  1041               key authentication is read.  The default is ~/.ssh/identity for
  1503 -             protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
  1042 -             protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
  1504 -             ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
  1043 -             ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
  1505 +             protocol version 1, and ~/.ssh/id_dsa, and ~/.ssh/id_rsa for
  1044 +             protocol version 1, and ~/.ssh/id_dsa
  1506 +             protocol version 2.
  1045 +             and ~/.ssh/id_rsa for protocol version 2.
  1507               Identity files may also be specified on a per-host basis in the
  1046               Identity files may also be specified on a per-host basis in the
  1508               configuration file.  It is possible to have multiple -i options
  1047               configuration file.  It is possible to have multiple -i options
  1509               (and multiple identities specified in configuration files).  ssh
  1048               (and multiple identities specified in configuration files).  ssh
  1510 @@ -446,7 +446,7 @@ AUTHENTICATION
  1049 @@ -451,7 +451,7 @@ AUTHENTICATION
  1511       creates a public/private key pair for authentication purposes.  The
  1050       creates a public/private key pair for authentication purposes.  The
  1512       server knows the public key, and only the user knows the private key.
  1051       server knows the public key, and only the user knows the private key.
  1513       ssh implements public key authentication protocol automatically, using
  1052       ssh implements public key authentication protocol automatically, using
  1514 -     one of the DSA, ECDSA, ED25519 or RSA algorithms.  Protocol 1 is
  1053 -     one of the DSA, ECDSA, Ed25519 or RSA algorithms.  Protocol 1 is
  1515 +     one of the DSA or RSA algorithms.  Protocol 1 is
  1054 +     one of the DSA or RSA algorithms.  Protocol 1 is
  1516       restricted to using only RSA keys, but protocol 2 may use any.  The
  1055       restricted to using only RSA keys, but protocol 2 may use any.  The
  1517       HISTORY section of ssl(8) contains a brief discussion of the DSA and RSA
  1056       HISTORY section of ssl(8) contains a brief discussion of the DSA and RSA
  1518       algorithms.
  1057       algorithms.
  1519 @@ -459,11 +459,9 @@ AUTHENTICATION
  1058 @@ -464,11 +464,9 @@ AUTHENTICATION
  1520  
  1059  
  1521       The user creates his/her key pair by running ssh-keygen(1).  This stores
  1060       The user creates his/her key pair by running ssh-keygen(1).  This stores
  1522       the private key in ~/.ssh/identity (protocol 1), ~/.ssh/id_dsa (protocol
  1061       the private key in ~/.ssh/identity (protocol 1), ~/.ssh/id_dsa (protocol
  1523 -     2 DSA), ~/.ssh/id_ecdsa (protocol 2 ECDSA), ~/.ssh/id_ed25519 (protocol 2
  1062 -     2 DSA), ~/.ssh/id_ecdsa (protocol 2 ECDSA), ~/.ssh/id_ed25519 (protocol 2
  1524 -     ED25519), or ~/.ssh/id_rsa (protocol 2 RSA) and stores the public key in
  1063 -     Ed25519), or ~/.ssh/id_rsa (protocol 2 RSA) and stores the public key in
  1525 -     ~/.ssh/identity.pub (protocol 1), ~/.ssh/id_dsa.pub (protocol 2 DSA),
  1064 -     ~/.ssh/identity.pub (protocol 1), ~/.ssh/id_dsa.pub (protocol 2 DSA),
  1526 -     ~/.ssh/id_ecdsa.pub (protocol 2 ECDSA), ~/.ssh/id_ed25519.pub (protocol 2
  1065 -     ~/.ssh/id_ecdsa.pub (protocol 2 ECDSA), ~/.ssh/id_ed25519.pub (protocol 2
  1527 -     ED25519), or ~/.ssh/id_rsa.pub (protocol 2 RSA) in the user's home
  1066 -     Ed25519), or ~/.ssh/id_rsa.pub (protocol 2 RSA) in the user's home
  1528 +     2 DSA) or ~/.ssh/id_rsa (protocol 2 RSA) and stores the public key in
  1067 +     2 DSA) or ~/.ssh/id_rsa (protocol 2 RSA) and stores the public key in
  1529 +     ~/.ssh/identity.pub (protocol 1), ~/.ssh/id_dsa.pub (protocol 2 DSA)
  1068 +     ~/.ssh/identity.pub (protocol 1), ~/.ssh/id_dsa.pub (protocol 2 DSA)
  1530 +     or ~/.ssh/id_rsa.pub (protocol 2 RSA) in the user's home
  1069 +     or ~/.ssh/id_rsa.pub (protocol 2 RSA) in the user's home
  1531       directory.  The user should then copy the public key to
  1070       directory.  The user should then copy the public key to
  1532       ~/.ssh/authorized_keys in his/her home directory on the remote machine.
  1071       ~/.ssh/authorized_keys in his/her home directory on the remote machine.
  1533       The authorized_keys file corresponds to the conventional ~/.rhosts file,
  1072       The authorized_keys file corresponds to the conventional ~/.rhosts file,
  1534 @@ -799,7 +797,7 @@ FILES
  1073 @@ -804,7 +802,7 @@ FILES
  1535               for the user, and not accessible by others.
  1074               for the user, and not accessible by others.
  1536  
  1075  
  1537       ~/.ssh/authorized_keys
  1076       ~/.ssh/authorized_keys
  1538 -             Lists the public keys (DSA, ECDSA, ED25519, RSA) that can be used
  1077 -             Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used
  1539 +             Lists the public keys (DSA, RSA) that can be used
  1078 +             Lists the public keys (DSA, RSA) that can be used
  1540               for logging in as this user.  The format of this file is
  1079               for logging in as this user.  The format of this file is
  1541               described in the sshd(8) manual page.  This file is not highly
  1080               described in the sshd(8) manual page.  This file is not highly
  1542               sensitive, but the recommended permissions are read/write for the
  1081               sensitive, but the recommended permissions are read/write for the
  1543 @@ -817,8 +815,6 @@ FILES
  1082 @@ -822,8 +820,6 @@ FILES
  1544  
  1083  
  1545       ~/.ssh/identity
  1084       ~/.ssh/identity
  1546       ~/.ssh/id_dsa
  1085       ~/.ssh/id_dsa
  1547 -     ~/.ssh/id_ecdsa
  1086 -     ~/.ssh/id_ecdsa
  1548 -     ~/.ssh/id_ed25519
  1087 -     ~/.ssh/id_ed25519
  1549       ~/.ssh/id_rsa
  1088       ~/.ssh/id_rsa
  1550               Contains the private key for authentication.  These files contain
  1089               Contains the private key for authentication.  These files contain
  1551               sensitive data and should be readable by the user but not
  1090               sensitive data and should be readable by the user but not
  1552 @@ -830,8 +826,6 @@ FILES
  1091 @@ -835,8 +831,6 @@ FILES
  1553  
  1092  
  1554       ~/.ssh/identity.pub
  1093       ~/.ssh/identity.pub
  1555       ~/.ssh/id_dsa.pub
  1094       ~/.ssh/id_dsa.pub
  1556 -     ~/.ssh/id_ecdsa.pub
  1095 -     ~/.ssh/id_ecdsa.pub
  1557 -     ~/.ssh/id_ed25519.pub
  1096 -     ~/.ssh/id_ed25519.pub
  1558       ~/.ssh/id_rsa.pub
  1097       ~/.ssh/id_rsa.pub
  1559               Contains the public key for authentication.  These files are not
  1098               Contains the public key for authentication.  These files are not
  1560               sensitive and can (but need not) be readable by anyone.
  1099               sensitive and can (but need not) be readable by anyone.
  1561 @@ -862,8 +856,6 @@ FILES
  1100 @@ -867,8 +861,6 @@ FILES
  1562  
  1101  
  1563       /etc/ssh/ssh_host_key
  1102       /etc/ssh/ssh_host_key
  1564       /etc/ssh/ssh_host_dsa_key
  1103       /etc/ssh/ssh_host_dsa_key
  1565 -     /etc/ssh/ssh_host_ecdsa_key
  1104 -     /etc/ssh/ssh_host_ecdsa_key
  1566 -     /etc/ssh/ssh_host_ed25519_key
  1105 -     /etc/ssh/ssh_host_ed25519_key
  1567       /etc/ssh/ssh_host_rsa_key
  1106       /etc/ssh/ssh_host_rsa_key
  1568               These files contain the private parts of the host keys and are
  1107               These files contain the private parts of the host keys and are
  1569               used for host-based authentication.  If protocol version 1 is
  1108               used for host-based authentication.  If protocol version 1 is
  1570 diff -pur old/ssh.1 new/ssh.1
  1109 diff -pur old/ssh.1 new/ssh.1
  1571 --- old/ssh.1	2013-12-17 22:46:28.000000000 -0800
  1110 --- old/ssh.1	2015-03-16 22:49:20.000000000 -0700
  1572 +++ new/ssh.1	2015-04-02 08:15:39.041359535 -0700
  1111 +++ new/ssh.1	2015-05-12 07:51:38.403098490 -0700
  1573 @@ -279,8 +279,6 @@ The default is
  1112 @@ -274,9 +274,7 @@ public key authentication is read.
       
  1113  The default is
  1574  .Pa ~/.ssh/identity
  1114  .Pa ~/.ssh/identity
  1575  for protocol version 1, and
  1115  for protocol version 1, and
  1576  .Pa ~/.ssh/id_dsa ,
  1116 -.Pa ~/.ssh/id_dsa ,
  1577 -.Pa ~/.ssh/id_ecdsa ,
  1117 -.Pa ~/.ssh/id_ecdsa ,
  1578 -.Pa ~/.ssh/id_ed25519
  1118 -.Pa ~/.ssh/id_ed25519
       
  1119 +.Pa ~/.ssh/id_dsa
  1579  and
  1120  and
  1580  .Pa ~/.ssh/id_rsa
  1121  .Pa ~/.ssh/id_rsa
  1581  for protocol version 2.
  1122  for protocol version 2.
  1582 @@ -758,7 +756,7 @@ key pair for authentication purposes.
  1123 @@ -761,7 +759,7 @@ key pair for authentication purposes.
  1583  The server knows the public key, and only the user knows the private key.
  1124  The server knows the public key, and only the user knows the private key.
  1584  .Nm
  1125  .Nm
  1585  implements public key authentication protocol automatically,
  1126  implements public key authentication protocol automatically,
  1586 -using one of the DSA, ECDSA, ED25519 or RSA algorithms.
  1127 -using one of the DSA, ECDSA, Ed25519 or RSA algorithms.
  1587 +using one of the DSA or RSA algorithms.
  1128 +using one of the DSA or RSA algorithms.
  1588  Protocol 1 is restricted to using only RSA keys,
  1129  Protocol 1 is restricted to using only RSA keys,
  1589  but protocol 2 may use any.
  1130  but protocol 2 may use any.
  1590  The HISTORY section of
  1131  The HISTORY section of
  1591 @@ -783,10 +781,6 @@ This stores the private key in
  1132 @@ -786,10 +784,6 @@ This stores the private key in
  1592  (protocol 1),
  1133  (protocol 1),
  1593  .Pa ~/.ssh/id_dsa
  1134  .Pa ~/.ssh/id_dsa
  1594  (protocol 2 DSA),
  1135  (protocol 2 DSA),
  1595 -.Pa ~/.ssh/id_ecdsa
  1136 -.Pa ~/.ssh/id_ecdsa
  1596 -(protocol 2 ECDSA),
  1137 -(protocol 2 ECDSA),
  1597 -.Pa ~/.ssh/id_ed25519
  1138 -.Pa ~/.ssh/id_ed25519
  1598 -(protocol 2 ED25519),
  1139 -(protocol 2 Ed25519),
  1599  or
  1140  or
  1600  .Pa ~/.ssh/id_rsa
  1141  .Pa ~/.ssh/id_rsa
  1601  (protocol 2 RSA)
  1142  (protocol 2 RSA)
  1602 @@ -795,10 +789,6 @@ and stores the public key in
  1143 @@ -798,10 +792,6 @@ and stores the public key in
  1603  (protocol 1),
  1144  (protocol 1),
  1604  .Pa ~/.ssh/id_dsa.pub
  1145  .Pa ~/.ssh/id_dsa.pub
  1605  (protocol 2 DSA),
  1146  (protocol 2 DSA),
  1606 -.Pa ~/.ssh/id_ecdsa.pub
  1147 -.Pa ~/.ssh/id_ecdsa.pub
  1607 -(protocol 2 ECDSA),
  1148 -(protocol 2 ECDSA),
  1608 -.Pa ~/.ssh/id_ed25519.pub
  1149 -.Pa ~/.ssh/id_ed25519.pub
  1609 -(protocol 2 ED25519),
  1150 -(protocol 2 Ed25519),
  1610  or
  1151  or
  1611  .Pa ~/.ssh/id_rsa.pub
  1152  .Pa ~/.ssh/id_rsa.pub
  1612  (protocol 2 RSA)
  1153  (protocol 2 RSA)
  1613 @@ -1338,7 +1328,7 @@ secret, but the recommended permissions
  1154 @@ -1341,7 +1331,7 @@ secret, but the recommended permissions
  1614  and not accessible by others.
  1155  and not accessible by others.
  1615  .Pp
  1156  .Pp
  1616  .It Pa ~/.ssh/authorized_keys
  1157  .It Pa ~/.ssh/authorized_keys
  1617 -Lists the public keys (DSA, ECDSA, ED25519, RSA)
  1158 -Lists the public keys (DSA, ECDSA, Ed25519, RSA)
  1618 +Lists the public keys (DSA, RSA)
  1159 +Lists the public keys (DSA, RSA)
  1619  that can be used for logging in as this user.
  1160  that can be used for logging in as this user.
  1620  The format of this file is described in the
  1161  The format of this file is described in the
  1621  .Xr sshd 8
  1162  .Xr sshd 8
  1622 @@ -1360,8 +1350,6 @@ above.
  1163 @@ -1363,8 +1353,6 @@ above.
  1623  .Pp
  1164  .Pp
  1624  .It Pa ~/.ssh/identity
  1165  .It Pa ~/.ssh/identity
  1625  .It Pa ~/.ssh/id_dsa
  1166  .It Pa ~/.ssh/id_dsa
  1626 -.It Pa ~/.ssh/id_ecdsa
  1167 -.It Pa ~/.ssh/id_ecdsa
  1627 -.It Pa ~/.ssh/id_ed25519
  1168 -.It Pa ~/.ssh/id_ed25519
  1628  .It Pa ~/.ssh/id_rsa
  1169  .It Pa ~/.ssh/id_rsa
  1629  Contains the private key for authentication.
  1170  Contains the private key for authentication.
  1630  These files
  1171  These files
  1631 @@ -1375,8 +1363,6 @@ sensitive part of this file using 3DES.
  1172 @@ -1378,8 +1366,6 @@ sensitive part of this file using 3DES.
  1632  .Pp
  1173  .Pp
  1633  .It Pa ~/.ssh/identity.pub
  1174  .It Pa ~/.ssh/identity.pub
  1634  .It Pa ~/.ssh/id_dsa.pub
  1175  .It Pa ~/.ssh/id_dsa.pub
  1635 -.It Pa ~/.ssh/id_ecdsa.pub
  1176 -.It Pa ~/.ssh/id_ecdsa.pub
  1636 -.It Pa ~/.ssh/id_ed25519.pub
  1177 -.It Pa ~/.ssh/id_ed25519.pub
  1637  .It Pa ~/.ssh/id_rsa.pub
  1178  .It Pa ~/.ssh/id_rsa.pub
  1638  Contains the public key for authentication.
  1179  Contains the public key for authentication.
  1639  These files are not
  1180  These files are not
  1640 @@ -1415,8 +1401,6 @@ The file format and configuration option
  1181 @@ -1418,8 +1404,6 @@ The file format and configuration option
  1641  .Pp
  1182  .Pp
  1642  .It Pa /etc/ssh/ssh_host_key
  1183  .It Pa /etc/ssh/ssh_host_key
  1643  .It Pa /etc/ssh/ssh_host_dsa_key
  1184  .It Pa /etc/ssh/ssh_host_dsa_key
  1644 -.It Pa /etc/ssh/ssh_host_ecdsa_key
  1185 -.It Pa /etc/ssh/ssh_host_ecdsa_key
  1645 -.It Pa /etc/ssh/ssh_host_ed25519_key
  1186 -.It Pa /etc/ssh/ssh_host_ed25519_key
  1646  .It Pa /etc/ssh/ssh_host_rsa_key
  1187  .It Pa /etc/ssh/ssh_host_rsa_key
  1647  These files contain the private parts of the host keys
  1188  These files contain the private parts of the host keys
  1648  and are used for host-based authentication.
  1189  and are used for host-based authentication.
  1649 diff -pur old/ssh.c new/ssh.c
  1190 diff -pur old/ssh.c new/ssh.c
  1650 --- old/ssh.c	2013-12-28 22:53:40.000000000 -0800
  1191 --- old/ssh.c	2015-03-16 22:49:20.000000000 -0700
  1651 +++ new/ssh.c	2015-04-01 03:33:55.003074053 -0700
  1192 +++ new/ssh.c	2015-05-12 06:57:55.876878130 -0700
  1652 @@ -1010,8 +1010,10 @@ main(int ac, char **av)
  1193 @@ -1234,8 +1234,10 @@ main(int ac, char **av)
       
  1194  		sensitive_data.keys[1] = key_load_private_cert(KEY_ECDSA,
       
  1195  		    _PATH_HOST_ECDSA_KEY_FILE, "", NULL);
  1653  #endif
  1196  #endif
       
  1197 +#ifndef WITHOUT_ED25519
       
  1198  		sensitive_data.keys[2] = key_load_private_cert(KEY_ED25519,
       
  1199  		    _PATH_HOST_ED25519_KEY_FILE, "", NULL);
       
  1200 +#endif /* WITHOUT_ED25519 */
  1654  		sensitive_data.keys[3] = key_load_private_cert(KEY_RSA,
  1201  		sensitive_data.keys[3] = key_load_private_cert(KEY_RSA,
  1655  		    _PATH_HOST_RSA_KEY_FILE, "", NULL);
  1202  		    _PATH_HOST_RSA_KEY_FILE, "", NULL);
  1656 +#ifndef WITHOUT_ED25519
  1203  		sensitive_data.keys[4] = key_load_private_cert(KEY_DSA,
  1657  		sensitive_data.keys[4] = key_load_private_cert(KEY_ED25519,
  1204 @@ -1244,8 +1246,10 @@ main(int ac, char **av)
  1658  		    _PATH_HOST_ED25519_KEY_FILE, "", NULL);
  1205  		sensitive_data.keys[5] = key_load_private_type(KEY_ECDSA,
  1659 +#endif /* WITHOUT_ED25519 */
  1206  		    _PATH_HOST_ECDSA_KEY_FILE, "", NULL, NULL);
  1660  		sensitive_data.keys[5] = key_load_private_type(KEY_DSA,
       
  1661  		    _PATH_HOST_DSA_KEY_FILE, "", NULL, NULL);
       
  1662  #ifdef OPENSSL_HAS_ECC
       
  1663 @@ -1020,8 +1022,10 @@ main(int ac, char **av)
       
  1664  #endif
  1207  #endif
       
  1208 +#ifndef WITHOUT_ED25519
       
  1209  		sensitive_data.keys[6] = key_load_private_type(KEY_ED25519,
       
  1210  		    _PATH_HOST_ED25519_KEY_FILE, "", NULL, NULL);
       
  1211 +#endif /* WITHOUT_ED25519 */
  1665  		sensitive_data.keys[7] = key_load_private_type(KEY_RSA,
  1212  		sensitive_data.keys[7] = key_load_private_type(KEY_RSA,
  1666  		    _PATH_HOST_RSA_KEY_FILE, "", NULL, NULL);
  1213  		    _PATH_HOST_RSA_KEY_FILE, "", NULL, NULL);
  1667 +#ifndef WITHOUT_ED25519
  1214  		sensitive_data.keys[8] = key_load_private_type(KEY_DSA,
  1668  		sensitive_data.keys[8] = key_load_private_type(KEY_ED25519,
  1215 @@ -1262,8 +1266,10 @@ main(int ac, char **av)
  1669  		    _PATH_HOST_ED25519_KEY_FILE, "", NULL, NULL);
  1216  			sensitive_data.keys[1] = key_load_cert(
  1670 +#endif /* WITHOUT_ED25519 */
  1217  			    _PATH_HOST_ECDSA_KEY_FILE);
  1671  		PRIV_END;
       
  1672  
       
  1673  		if (options.hostbased_authentication == 1 &&
       
  1674 @@ -1038,8 +1042,10 @@ main(int ac, char **av)
       
  1675  #endif
  1218  #endif
       
  1219 +#ifndef WITHOUT_ED25519
       
  1220  			sensitive_data.keys[2] = key_load_cert(
       
  1221  			    _PATH_HOST_ED25519_KEY_FILE);
       
  1222 +#endif /* WITHOUT_ED25519 */
  1676  			sensitive_data.keys[3] = key_load_cert(
  1223  			sensitive_data.keys[3] = key_load_cert(
  1677  			    _PATH_HOST_RSA_KEY_FILE);
  1224  			    _PATH_HOST_RSA_KEY_FILE);
  1678 +#ifndef WITHOUT_ED25519
       
  1679  			sensitive_data.keys[4] = key_load_cert(
  1225  			sensitive_data.keys[4] = key_load_cert(
  1680  			    _PATH_HOST_ED25519_KEY_FILE);
  1226 @@ -1272,8 +1278,10 @@ main(int ac, char **av)
  1681 +#endif /* WITHOUT_ED25519 */
       
  1682  			sensitive_data.keys[5] = key_load_public(
  1227  			sensitive_data.keys[5] = key_load_public(
  1683  			    _PATH_HOST_DSA_KEY_FILE, NULL);
  1228  			    _PATH_HOST_ECDSA_KEY_FILE, NULL);
  1684  #ifdef OPENSSL_HAS_ECC
       
  1685 @@ -1048,8 +1054,10 @@ main(int ac, char **av)
       
  1686  #endif
  1229  #endif
       
  1230 +#ifndef WITHOUT_ED25519
       
  1231  			sensitive_data.keys[6] = key_load_public(
       
  1232  			    _PATH_HOST_ED25519_KEY_FILE, NULL);
       
  1233 +#endif /* WITHOUT_ED25519 */
  1687  			sensitive_data.keys[7] = key_load_public(
  1234  			sensitive_data.keys[7] = key_load_public(
  1688  			    _PATH_HOST_RSA_KEY_FILE, NULL);
  1235  			    _PATH_HOST_RSA_KEY_FILE, NULL);
  1689 +#ifndef WITHOUT_ED25519
       
  1690  			sensitive_data.keys[8] = key_load_public(
  1236  			sensitive_data.keys[8] = key_load_public(
  1691  			    _PATH_HOST_ED25519_KEY_FILE, NULL);
  1237 diff -pur old/ssh_api.c new/ssh_api.c
  1692 +#endif /* WITHOUT_ED25519 */
  1238 --- old/ssh_api.c	2015-03-16 22:49:20.000000000 -0700
  1693  			sensitive_data.external_keysign = 1;
  1239 +++ new/ssh_api.c	2015-05-12 06:57:55.877368137 -0700
  1694  		}
  1240 @@ -109,7 +109,9 @@ ssh_init(struct ssh **sshp, int is_serve
       
  1241  		ssh->kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
       
  1242  # endif
       
  1243  #endif /* WITH_OPENSSL */
       
  1244 +#ifndef WITHOUT_ED25519
       
  1245  		ssh->kex->kex[KEX_C25519_SHA256] = kexc25519_server;
       
  1246 +#endif /* WITHOUT_ED25519 */
       
  1247  		ssh->kex->load_host_public_key=&_ssh_host_public_key;
       
  1248  		ssh->kex->load_host_private_key=&_ssh_host_private_key;
       
  1249  		ssh->kex->sign=&_ssh_host_key_sign;
       
  1250 @@ -123,7 +125,9 @@ ssh_init(struct ssh **sshp, int is_serve
       
  1251  		ssh->kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
       
  1252  # endif
       
  1253  #endif /* WITH_OPENSSL */
       
  1254 +#ifndef WITHOUT_ED25519
       
  1255  		ssh->kex->kex[KEX_C25519_SHA256] = kexc25519_client;
       
  1256 +#endif /* WITHOUT_ED25519 */
       
  1257  		ssh->kex->verify_host_key =&_ssh_verify_host_key;
  1695  	}
  1258  	}
       
  1259  	*sshp = ssh;
  1696 diff -pur old/ssh_config.0 new/ssh_config.0
  1260 diff -pur old/ssh_config.0 new/ssh_config.0
  1697 --- old/ssh_config.0	2014-01-29 17:52:48.000000000 -0800
  1261 --- old/ssh_config.0	2015-03-17 21:26:36.000000000 -0700
  1698 +++ new/ssh_config.0	2015-04-02 08:07:55.171885768 -0700
  1262 +++ new/ssh_config.0	2015-05-12 07:45:14.754320503 -0700
  1699 @@ -409,14 +409,9 @@ DESCRIPTION
  1263 @@ -443,14 +443,8 @@ DESCRIPTION
  1700               client wants to use in order of preference.  The default for this
  1264               client wants to use in order of preference.  The default for this
  1701               option is:
  1265               option is:
  1702  
  1266  
  1703 -                [email protected],
  1267 -                [email protected],
  1704 -                [email protected],
  1268 -                [email protected],
  1706 -                [email protected],
  1270 -                [email protected],
  1707                  [email protected],[email protected],
  1271                  [email protected],[email protected],
  1708                  [email protected],[email protected],
  1272                  [email protected],[email protected],
  1709 -                ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  1273 -                ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  1710 -                ssh-ed25519,ssh-rsa,ssh-dss
  1274 -                ssh-ed25519,ssh-rsa,ssh-dss
  1711 +                ssh-rsa,ssh-dss
       
  1712  
  1275  
  1713               If hostkeys are known for the destination host then this default
  1276               If hostkeys are known for the destination host then this default
  1714               is modified to prefer their algorithms.
  1277               is modified to prefer their algorithms.
  1715 @@ -446,10 +441,10 @@ DESCRIPTION
  1278 @@ -486,10 +480,10 @@ DESCRIPTION
  1716               default is ``no''.
  1279               default is M-bM-^@M-^\noM-bM-^@M-^].
  1717  
  1280  
  1718       IdentityFile
  1281       IdentityFile
  1719 -             Specifies a file from which the user's DSA, ECDSA, ED25519 or RSA
  1282 -             Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA
  1720 +             Specifies a file from which the user's DSA or RSA
  1283 +             Specifies a file from which the user's DSA or RSA
  1721               authentication identity is read.  The default is ~/.ssh/identity
  1284               authentication identity is read.  The default is ~/.ssh/identity
  1722 -             for protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
  1285 -             for protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
  1723 -             ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
  1286 -             ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
  1724 +             for protocol version 1, and ~/.ssh/id_dsa and ~/.ssh/id_rsa for
  1287 +             for protocol version 1, and ~/.ssh/id_dsa
  1725 +             protocol version 2.
  1288 +             and ~/.ssh/id_rsa for protocol version 2.
  1726               Additionally, any identities represented by the authentication
  1289               Additionally, any identities represented by the authentication
  1727               agent will be used for authentication unless IdentitiesOnly is
  1290               agent will be used for authentication unless IdentitiesOnly is
  1728               set.  ssh(1) will try to load certificate information from the
  1291               set.  ssh(1) will try to load certificate information from the
  1729 @@ -509,8 +504,6 @@ DESCRIPTION
  1292 @@ -549,7 +543,6 @@ DESCRIPTION
  1730               Specifies the available KEX (Key Exchange) algorithms.  Multiple
  1293               Specifies the available KEX (Key Exchange) algorithms.  Multiple
  1731               algorithms must be comma-separated.  The default is:
  1294               algorithms must be comma-separated.  The default is:
  1732  
  1295  
  1733 -                   [email protected],
  1296 -                   [email protected],
  1734 -                   ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1297                     ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1735                     diffie-hellman-group-exchange-sha256,
  1298                     diffie-hellman-group-exchange-sha256,
  1736                     diffie-hellman-group-exchange-sha1,
       
  1737                     diffie-hellman-group14-sha1,
  1299                     diffie-hellman-group14-sha1,
  1738 diff -pur old/ssh_config.5 new/ssh_config.5
  1300 diff -pur old/ssh_config.5 new/ssh_config.5
  1739 --- old/ssh_config.5	2015-03-31 21:14:02.439364932 -0700
  1301 --- old/ssh_config.5	2015-05-12 06:57:55.750682668 -0700
  1740 +++ new/ssh_config.5	2015-04-02 08:16:12.714886637 -0700
  1302 +++ new/ssh_config.5	2015-05-12 07:52:05.483411337 -0700
  1741 @@ -729,14 +729,9 @@ Specifies the protocol version 2 host ke
  1303 @@ -807,14 +807,8 @@ Specifies the protocol version 2 host ke
  1742  that the client wants to use in order of preference.
  1304  that the client wants to use in order of preference.
  1743  The default for this option is:
  1305  The default for this option is:
  1744  .Bd -literal -offset 3n
  1306  .Bd -literal -offset 3n
  1745 [email protected],
  1307 [email protected],
  1746 [email protected],
  1308 [email protected],
  1748 [email protected],
  1310 [email protected],
  1749  [email protected],[email protected],
  1311  [email protected],[email protected],
  1750  [email protected],[email protected],
  1312  [email protected],[email protected],
  1751 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  1313 -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  1752 -ssh-ed25519,ssh-rsa,ssh-dss
  1314 -ssh-ed25519,ssh-rsa,ssh-dss
  1753 +ssh-rsa,ssh-dss
       
  1754  .Ed
  1315  .Ed
  1755  .Pp
  1316  .Pp
  1756  If hostkeys are known for the destination host then this default is modified
  1317  If hostkeys are known for the destination host then this default is modified
  1757 @@ -778,14 +773,12 @@ offers many different identities.
  1318 @@ -869,14 +863,12 @@ offers many different identities.
  1758  The default is
  1319  The default is
  1759  .Dq no .
  1320  .Dq no .
  1760  .It Cm IdentityFile
  1321  .It Cm IdentityFile
  1761 -Specifies a file from which the user's DSA, ECDSA, ED25519 or RSA authentication
  1322 -Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
  1762 +Specifies a file from which the user's DSA or RSA authentication
  1323 +Specifies a file from which the user's DSA or RSA authentication
  1763  identity is read.
  1324  identity is read.
  1764  The default is
  1325  The default is
  1765  .Pa ~/.ssh/identity
  1326  .Pa ~/.ssh/identity
  1766  for protocol version 1, and
  1327  for protocol version 1, and
  1768 -.Pa ~/.ssh/id_ecdsa ,
  1329 -.Pa ~/.ssh/id_ecdsa ,
  1769 -.Pa ~/.ssh/id_ed25519
  1330 -.Pa ~/.ssh/id_ed25519
  1770  and
  1331  and
  1771  .Pa ~/.ssh/id_rsa
  1332  .Pa ~/.ssh/id_rsa
  1772  for protocol version 2.
  1333  for protocol version 2.
  1773 @@ -898,8 +891,6 @@ Specifies the available KEX (Key Exchang
  1334 @@ -989,7 +981,6 @@ Specifies the available KEX (Key Exchang
  1774  Multiple algorithms must be comma-separated.
  1335  Multiple algorithms must be comma-separated.
  1775  The default is:
  1336  The default is:
  1776  .Bd -literal -offset indent
  1337  .Bd -literal -offset indent
  1777 [email protected],
  1338 [email protected],
  1778 -ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1339  ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1779  diffie-hellman-group-exchange-sha256,
  1340  diffie-hellman-group-exchange-sha256,
  1780  diffie-hellman-group-exchange-sha1,
       
  1781  diffie-hellman-group14-sha1,
  1341  diffie-hellman-group14-sha1,
  1782 diff -pur old/sshconnect.c new/sshconnect.c
  1342 diff -pur old/sshconnect.c new/sshconnect.c
  1783 --- old/sshconnect.c	2015-03-31 21:14:02.413909705 -0700
  1343 --- old/sshconnect.c	2015-03-16 22:49:20.000000000 -0700
  1784 +++ new/sshconnect.c	2015-04-01 04:56:41.997313652 -0700
  1344 +++ new/sshconnect.c	2015-05-12 06:57:55.878078115 -0700
  1785 @@ -1325,7 +1325,9 @@ show_other_keys(struct hostkeys *hostkey
  1345 @@ -1391,7 +1391,9 @@ show_other_keys(struct hostkeys *hostkey
  1786  		KEY_RSA,
  1346  		KEY_RSA,
  1787  		KEY_DSA,
  1347  		KEY_DSA,
  1788  		KEY_ECDSA,
  1348  		KEY_ECDSA,
  1789 +#ifndef WITHOUT_ED25519
  1349 +#ifndef WITHOUT_ED25519
  1790  		KEY_ED25519,
  1350  		KEY_ED25519,
  1791 +#endif /* WITHOUT_ED25519 */
  1351 +#endif /* WITHOUT_ED25519 */
  1792  		-1
  1352  		-1
  1793  	};
  1353  	};
  1794  	int i, ret = 0;
  1354  	int i, ret = 0;
  1795 diff -pur old/sshconnect2.c new/sshconnect2.c
  1355 diff -pur old/sshconnect2.c new/sshconnect2.c
  1796 --- old/sshconnect2.c	2015-03-31 21:14:02.440456459 -0700
  1356 --- old/sshconnect2.c	2015-05-12 06:57:55.751927078 -0700
  1797 +++ new/sshconnect2.c	2015-04-01 04:56:58.805755301 -0700
  1357 +++ new/sshconnect2.c	2015-05-12 07:03:03.597484825 -0700
  1798 @@ -246,7 +246,9 @@ ssh_kex2(char *host, struct sockaddr *ho
  1358 @@ -254,7 +254,9 @@ ssh_kex2(char *host, struct sockaddr *ho
  1799  	kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
       
  1800  	kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
       
  1801  	kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
  1359  	kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
       
  1360  # endif
       
  1361  #endif
  1802 +#ifndef WITHOUT_ED25519
  1362 +#ifndef WITHOUT_ED25519
  1803  	kex->kex[KEX_C25519_SHA256] = kexc25519_client;
  1363  	kex->kex[KEX_C25519_SHA256] = kexc25519_client;
  1804 +#endif /* WITHOUT_ED25519 */
  1364 +#endif /* WITHOUT_ED25519 */
  1805  #ifdef GSSAPI
  1365  #ifdef GSSAPI
  1806  	if (options.gss_keyex) {
  1366  	if (options.gss_keyex) {
  1807  		kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client;
  1367  		kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client;
  1808 diff -pur old/sshd.0 new/sshd.0
  1368 diff -pur old/sshd.0 new/sshd.0
  1809 --- old/sshd.0	2014-01-29 17:52:47.000000000 -0800
  1369 --- old/sshd.0	2015-03-17 21:26:35.000000000 -0700
  1810 +++ new/sshd.0	2015-04-02 08:09:18.391442884 -0700
  1370 +++ new/sshd.0	2015-05-12 07:46:43.700877984 -0700
  1811 @@ -82,8 +82,7 @@ DESCRIPTION
  1371 @@ -81,8 +81,7 @@ DESCRIPTION
  1812               be given if sshd is not run as root (as the normal host key files
  1372               be given if sshd is not run as root (as the normal host key files
  1813               are normally not readable by anyone but root).  The default is
  1373               are normally not readable by anyone but root).  The default is
  1814               /etc/ssh/ssh_host_key for protocol version 1, and
  1374               /etc/ssh/ssh_host_key for protocol version 1, and
  1815 -             /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_ecdsa_key.
  1375 -             /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_ecdsa_key.
  1816 -             /etc/ssh/ssh_host_ed25519_key and /etc/ssh/ssh_host_rsa_key for
  1376 -             /etc/ssh/ssh_host_ed25519_key and /etc/ssh/ssh_host_rsa_key for
  1817 +             /etc/ssh/ssh_host_dsa_key and /etc/ssh/ssh_host_rsa_key for
  1377 +             /etc/ssh/ssh_host_dsa_key and /etc/ssh/ssh_host_rsa_key for
  1818               protocol version 2.  It is possible to have multiple host key
  1378               protocol version 2.  It is possible to have multiple host key
  1819               files for the different protocol versions and host key
  1379               files for the different protocol versions and host key
  1820               algorithms.
  1380               algorithms.
  1821 @@ -148,7 +147,7 @@ DESCRIPTION
  1381 @@ -147,7 +146,7 @@ DESCRIPTION
  1822  AUTHENTICATION
  1382  AUTHENTICATION
  1823       The OpenSSH SSH daemon supports SSH protocols 1 and 2.  The default is to
  1383       The OpenSSH SSH daemon supports SSH protocols 1 and 2.  The default is to
  1824       use protocol 2 only, though this can be changed via the Protocol option
  1384       use protocol 2 only, though this can be changed via the Protocol option
  1825 -     in sshd_config(5).  Protocol 2 supports DSA, ECDSA, ED25519 and RSA keys;
  1385 -     in sshd_config(5).  Protocol 2 supports DSA, ECDSA, Ed25519 and RSA keys;
  1826 +     in sshd_config(5).  Protocol 2 supports DSA and RSA keys;
  1386 +     in sshd_config(5).  Protocol 2 supports DSA and RSA keys;
  1827       protocol 1 only supports RSA keys.  For both protocols, each host has a
  1387       protocol 1 only supports RSA keys.  For both protocols, each host has a
  1828       host-specific key, normally 2048 bits, used to identify the host.
  1388       host-specific key, normally 2048 bits, used to identify the host.
  1829  
  1389  
  1830 @@ -278,15 +277,13 @@ AUTHORIZED_KEYS FILE FORMAT
  1390 @@ -278,15 +277,13 @@ AUTHORIZED_KEYS FILE FORMAT
  1831       starts with a number).  The bits, exponent, modulus, and comment fields
  1391       starts with a number).  The bits, exponent, modulus, and comment fields
  1832       give the RSA key for protocol version 1; the comment field is not used
  1392       give the RSA key for protocol version 1; the comment field is not used
  1833       for anything (but may be convenient for the user to identify the key).
  1393       for anything (but may be convenient for the user to identify the key).
  1834 -     For protocol version 2 the keytype is ``ecdsa-sha2-nistp256'',
  1394 -     For protocol version 2 the keytype is M-bM-^@M-^\ecdsa-sha2-nistp256M-bM-^@M-^],
  1835 -     ``ecdsa-sha2-nistp384'', ``ecdsa-sha2-nistp521'', ``ssh-ed25519'',
  1395 -     M-bM-^@M-^\ecdsa-sha2-nistp384M-bM-^@M-^], M-bM-^@M-^\ecdsa-sha2-nistp521M-bM-^@M-^], M-bM-^@M-^\ssh-ed25519M-bM-^@M-^], M-bM-^@M-^\ssh-dssM-bM-^@M-^] or
  1836 -     ``ssh-dss'' or ``ssh-rsa''.
  1396 -     M-bM-^@M-^\ssh-rsaM-bM-^@M-^].
  1837 +     For protocol version 2 the keytype is ``ssh-dss'' or ``ssh-rsa''.
  1397 +     For protocol version 2 the keytype is M-bM-^@M-^\ssh-dssM-bM-^@M-^] or M-bM-^@M-^\ssh-rsaM-bM-^@M-^].
  1838  
  1398  
  1839       Note that lines in this file are usually several hundred bytes long
  1399       Note that lines in this file are usually several hundred bytes long
  1840       (because of the size of the public key encoding) up to a limit of 8
  1400       (because of the size of the public key encoding) up to a limit of 8
  1841       kilobytes, which permits DSA keys up to 8 kilobits and RSA keys up to 16
  1401       kilobytes, which permits DSA keys up to 8 kilobits and RSA keys up to 16
  1842       kilobits.  You don't want to type them in; instead, copy the
  1402       kilobits.  You don't want to type them in; instead, copy the
  1847       sshd enforces a minimum RSA key modulus size for protocol 1 and protocol
  1407       sshd enforces a minimum RSA key modulus size for protocol 1 and protocol
  1848 @@ -513,7 +510,7 @@ FILES
  1408 @@ -513,7 +510,7 @@ FILES
  1849               for the user, and not accessible by others.
  1409               for the user, and not accessible by others.
  1850  
  1410  
  1851       ~/.ssh/authorized_keys
  1411       ~/.ssh/authorized_keys
  1852 -             Lists the public keys (DSA, ECDSA, ED25519, RSA) that can be used
  1412 -             Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used
  1853 +             Lists the public keys (DSA, RSA) that can be used
  1413 +             Lists the public keys (DSA, RSA) that can be used
  1854               for logging in as this user.  The format of this file is
  1414               for logging in as this user.  The format of this file is
  1855               described above.  The content of the file is not highly
  1415               described above.  The content of the file is not highly
  1856               sensitive, but the recommended permissions are read/write for the
  1416               sensitive, but the recommended permissions are read/write for the
  1857 @@ -574,8 +571,6 @@ FILES
  1417 @@ -569,8 +566,6 @@ FILES
  1858  
  1418  
  1859       /etc/ssh/ssh_host_key
  1419       /etc/ssh/ssh_host_key
  1860       /etc/ssh/ssh_host_dsa_key
  1420       /etc/ssh/ssh_host_dsa_key
  1861 -     /etc/ssh/ssh_host_ecdsa_key
  1421 -     /etc/ssh/ssh_host_ecdsa_key
  1862 -     /etc/ssh/ssh_host_ed25519_key
  1422 -     /etc/ssh/ssh_host_ed25519_key
  1863       /etc/ssh/ssh_host_rsa_key
  1423       /etc/ssh/ssh_host_rsa_key
  1864               These files contain the private parts of the host keys.  These
  1424               These files contain the private parts of the host keys.  These
  1865               files should only be owned by root, readable only by root, and
  1425               files should only be owned by root, readable only by root, and
  1866 @@ -584,8 +579,6 @@ FILES
  1426 @@ -579,8 +574,6 @@ FILES
  1867  
  1427  
  1868       /etc/ssh/ssh_host_key.pub
  1428       /etc/ssh/ssh_host_key.pub
  1869       /etc/ssh/ssh_host_dsa_key.pub
  1429       /etc/ssh/ssh_host_dsa_key.pub
  1870 -     /etc/ssh/ssh_host_ecdsa_key.pub
  1430 -     /etc/ssh/ssh_host_ecdsa_key.pub
  1871 -     /etc/ssh/ssh_host_ed25519_key.pub
  1431 -     /etc/ssh/ssh_host_ed25519_key.pub
  1872       /etc/ssh/ssh_host_rsa_key.pub
  1432       /etc/ssh/ssh_host_rsa_key.pub
  1873               These files contain the public parts of the host keys.  These
  1433               These files contain the public parts of the host keys.  These
  1874               files should be world-readable but writable only by root.  Their
  1434               files should be world-readable but writable only by root.  Their
  1875 diff -pur old/sshd.8 new/sshd.8
  1435 diff -pur old/sshd.8 new/sshd.8
  1876 --- old/sshd.8	2015-03-31 21:14:02.389944452 -0700
  1436 --- old/sshd.8	2015-05-12 06:57:55.682941332 -0700
  1877 +++ new/sshd.8	2015-04-02 08:17:21.818430805 -0700
  1437 +++ new/sshd.8	2015-05-12 07:53:14.229250081 -0700
  1878 @@ -175,8 +175,6 @@ The default is
  1438 @@ -172,8 +172,6 @@ The default is
  1879  .Pa /etc/ssh/ssh_host_key
  1439  .Pa /etc/ssh/ssh_host_key
  1880  for protocol version 1, and
  1440  for protocol version 1, and
  1881  .Pa /etc/ssh/ssh_host_dsa_key ,
  1441  .Pa /etc/ssh/ssh_host_dsa_key ,
  1882 -.Pa /etc/ssh/ssh_host_ecdsa_key .
  1442 -.Pa /etc/ssh/ssh_host_ecdsa_key .
  1883 -.Pa /etc/ssh/ssh_host_ed25519_key
  1443 -.Pa /etc/ssh/ssh_host_ed25519_key
  1884  and
  1444  and
  1885  .Pa /etc/ssh/ssh_host_rsa_key
  1445  .Pa /etc/ssh/ssh_host_rsa_key
  1886  for protocol version 2.
  1446  for protocol version 2.
  1887 @@ -281,7 +279,7 @@ though this can be changed via the
  1447 @@ -278,7 +276,7 @@ though this can be changed via the
  1888  .Cm Protocol
  1448  .Cm Protocol
  1889  option in
  1449  option in
  1890  .Xr sshd_config 4 .
  1450  .Xr sshd_config 4 .
  1891 -Protocol 2 supports DSA, ECDSA, ED25519 and RSA keys;
  1451 -Protocol 2 supports DSA, ECDSA, Ed25519 and RSA keys;
  1892 +Protocol 2 supports DSA and RSA keys;
  1452 +Protocol 2 supports DSA and RSA keys;
  1893  protocol 1 only supports RSA keys.
  1453  protocol 1 only supports RSA keys.
  1894  For both protocols,
  1454  For both protocols,
  1895  each host has a host-specific key,
  1455  each host has a host-specific key,
  1896 @@ -492,10 +490,6 @@ protocol version 1; the
  1456 @@ -492,10 +490,6 @@ protocol version 1; the
  1915  file and edit it.
  1475  file and edit it.
  1916 @@ -808,7 +800,7 @@ secret, but the recommended permissions
  1476 @@ -808,7 +800,7 @@ secret, but the recommended permissions
  1917  and not accessible by others.
  1477  and not accessible by others.
  1918  .Pp
  1478  .Pp
  1919  .It Pa ~/.ssh/authorized_keys
  1479  .It Pa ~/.ssh/authorized_keys
  1920 -Lists the public keys (DSA, ECDSA, ED25519, RSA)
  1480 -Lists the public keys (DSA, ECDSA, Ed25519, RSA)
  1921 +Lists the public keys (DSA, RSA)
  1481 +Lists the public keys (DSA, RSA)
  1922  that can be used for logging in as this user.
  1482  that can be used for logging in as this user.
  1923  The format of this file is described above.
  1483  The format of this file is described above.
  1924  The content of the file is not highly sensitive, but the recommended
  1484  The content of the file is not highly sensitive, but the recommended
  1925 @@ -888,8 +880,6 @@ rlogin/rsh.
  1485 @@ -882,8 +874,6 @@ rlogin/rsh.
  1926  .Pp
  1486  .Pp
  1927  .It Pa /etc/ssh/ssh_host_key
  1487  .It Pa /etc/ssh/ssh_host_key
  1928  .It Pa /etc/ssh/ssh_host_dsa_key
  1488  .It Pa /etc/ssh/ssh_host_dsa_key
  1929 -.It Pa /etc/ssh/ssh_host_ecdsa_key
  1489 -.It Pa /etc/ssh/ssh_host_ecdsa_key
  1930 -.It Pa /etc/ssh/ssh_host_ed25519_key
  1490 -.It Pa /etc/ssh/ssh_host_ed25519_key
  1931  .It Pa /etc/ssh/ssh_host_rsa_key
  1491  .It Pa /etc/ssh/ssh_host_rsa_key
  1932  These files contain the private parts of the host keys.
  1492  These files contain the private parts of the host keys.
  1933  These files should only be owned by root, readable only by root, and not
  1493  These files should only be owned by root, readable only by root, and not
  1934 @@ -900,8 +890,6 @@ does not start if these files are group/
  1494 @@ -894,8 +884,6 @@ does not start if these files are group/
  1935  .Pp
  1495  .Pp
  1936  .It Pa /etc/ssh/ssh_host_key.pub
  1496  .It Pa /etc/ssh/ssh_host_key.pub
  1937  .It Pa /etc/ssh/ssh_host_dsa_key.pub
  1497  .It Pa /etc/ssh/ssh_host_dsa_key.pub
  1938 -.It Pa /etc/ssh/ssh_host_ecdsa_key.pub
  1498 -.It Pa /etc/ssh/ssh_host_ecdsa_key.pub
  1939 -.It Pa /etc/ssh/ssh_host_ed25519_key.pub
  1499 -.It Pa /etc/ssh/ssh_host_ed25519_key.pub
  1940  .It Pa /etc/ssh/ssh_host_rsa_key.pub
  1500  .It Pa /etc/ssh/ssh_host_rsa_key.pub
  1941  These files contain the public parts of the host keys.
  1501  These files contain the public parts of the host keys.
  1942  These files should be world-readable but writable only by
  1502  These files should be world-readable but writable only by
  1943 diff -pur old/sshd.c new/sshd.c
  1503 diff -pur old/sshd.c new/sshd.c
  1944 --- old/sshd.c	2015-03-31 21:14:02.441576765 -0700
  1504 --- old/sshd.c	2015-05-12 06:57:55.753246429 -0700
  1945 +++ new/sshd.c	2015-04-01 03:42:59.569147555 -0700
  1505 +++ new/sshd.c	2015-05-12 07:03:44.715843663 -0700
  1946 @@ -797,7 +797,9 @@ list_hostkey_types(void)
  1506 @@ -803,7 +803,9 @@ list_hostkey_types(void)
  1947  		case KEY_RSA:
  1507  		case KEY_RSA:
  1948  		case KEY_DSA:
  1508  		case KEY_DSA:
  1949  		case KEY_ECDSA:
  1509  		case KEY_ECDSA:
  1950 +#ifndef WITHOUT_ED25519
  1510 +#ifndef WITHOUT_ED25519
  1951  		case KEY_ED25519:
  1511  		case KEY_ED25519:
  1952 +#endif /* WITHOUT_ED25519 */
  1512 +#endif /* WITHOUT_ED25519 */
  1953  			if (buffer_len(&b) > 0)
  1513  			if (buffer_len(&b) > 0)
  1954  				buffer_append(&b, ",", 1);
  1514  				buffer_append(&b, ",", 1);
  1955  			p = key_ssh_name(key);
  1515  			p = key_ssh_name(key);
  1956 @@ -814,7 +816,9 @@ list_hostkey_types(void)
  1516 @@ -820,7 +822,9 @@ list_hostkey_types(void)
  1957  		case KEY_RSA_CERT:
  1517  		case KEY_RSA_CERT:
  1958  		case KEY_DSA_CERT:
  1518  		case KEY_DSA_CERT:
  1959  		case KEY_ECDSA_CERT:
  1519  		case KEY_ECDSA_CERT:
  1960 +#ifndef WITHOUT_ED25519
  1520 +#ifndef WITHOUT_ED25519
  1961  		case KEY_ED25519_CERT:
  1521  		case KEY_ED25519_CERT:
  1962 +#endif /* WITHOUT_ED25519 */
  1522 +#endif /* WITHOUT_ED25519 */
  1963  			if (buffer_len(&b) > 0)
  1523  			if (buffer_len(&b) > 0)
  1964  				buffer_append(&b, ",", 1);
  1524  				buffer_append(&b, ",", 1);
  1965  			p = key_ssh_name(key);
  1525  			p = key_ssh_name(key);
  1966 @@ -842,7 +846,9 @@ get_hostkey_by_type(int type, int need_p
  1526 @@ -848,7 +852,9 @@ get_hostkey_by_type(int type, int nid, i
  1967  		case KEY_RSA_CERT:
  1527  		case KEY_RSA_CERT:
  1968  		case KEY_DSA_CERT:
  1528  		case KEY_DSA_CERT:
  1969  		case KEY_ECDSA_CERT:
  1529  		case KEY_ECDSA_CERT:
  1970 +#ifndef WITHOUT_ED25519
  1530 +#ifndef WITHOUT_ED25519
  1971  		case KEY_ED25519_CERT:
  1531  		case KEY_ED25519_CERT:
  1972 +#endif /* WITHOUT_ED25519 */
  1532 +#endif /* WITHOUT_ED25519 */
  1973  			key = sensitive_data.host_certificates[i];
  1533  			key = sensitive_data.host_certificates[i];
  1974  			break;
  1534  			break;
  1975  		default:
  1535  		default:
  1976 @@ -1719,7 +1725,9 @@ main(int ac, char **av)
  1536 @@ -1798,7 +1804,9 @@ main(int ac, char **av)
  1977  		case KEY_RSA:
  1537  		case KEY_RSA:
  1978  		case KEY_DSA:
  1538  		case KEY_DSA:
  1979  		case KEY_ECDSA:
  1539  		case KEY_ECDSA:
  1980 +#ifndef WITHOUT_ED25519
  1540 +#ifndef WITHOUT_ED25519
  1981  		case KEY_ED25519:
  1541  		case KEY_ED25519:
  1982 +#endif /* WITHOUT_ED25519 */
  1542 +#endif /* WITHOUT_ED25519 */
  1983  			sensitive_data.have_ssh2_key = 1;
  1543  			if (have_agent || key != NULL)
       
  1544  				sensitive_data.have_ssh2_key = 1;
  1984  			break;
  1545  			break;
  1985  		}
  1546 @@ -2644,7 +2652,9 @@ do_ssh2_kex(void)
  1986 @@ -2546,7 +2554,9 @@ do_ssh2_kex(void)
       
  1987  	kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
       
  1988  	kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
       
  1989  	kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
  1547  	kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
       
  1548  # endif
       
  1549  #endif
  1990 +#ifndef WITHOUT_ED25519
  1550 +#ifndef WITHOUT_ED25519
  1991  	kex->kex[KEX_C25519_SHA256] = kexc25519_server;
  1551  	kex->kex[KEX_C25519_SHA256] = kexc25519_server;
  1992 +#endif /* WITHOUT_ED25519 */
  1552 +#endif /* WITHOUT_ED25519 */
  1993  #ifdef GSSAPI
  1553  #ifdef GSSAPI
  1994  	if (options.gss_keyex) {
  1554  	if (options.gss_keyex) {
  1995  		kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server;
  1555  		kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server;
  1996 diff -pur old/sshd_config.0 new/sshd_config.0
  1556 diff -pur old/sshd_config.0 new/sshd_config.0
  1997 --- old/sshd_config.0	2014-01-29 17:52:48.000000000 -0800
  1557 --- old/sshd_config.0	2015-03-17 21:26:36.000000000 -0700
  1998 +++ new/sshd_config.0	2015-04-02 08:09:53.957389224 -0700
  1558 +++ new/sshd_config.0	2015-05-12 07:47:28.488941581 -0700
  1999 @@ -332,12 +332,11 @@ DESCRIPTION
  1559 @@ -375,12 +375,11 @@ DESCRIPTION
  2000       HostKey
  1560       HostKey
  2001               Specifies a file containing a private host key used by SSH.  The
  1561               Specifies a file containing a private host key used by SSH.  The
  2002               default is /etc/ssh/ssh_host_key for protocol version 1, and
  1562               default is /etc/ssh/ssh_host_key for protocol version 1, and
  2003 -             /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_ecdsa_key,
  1563 -             /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_ecdsa_key,
  2004 -             /etc/ssh/ssh_host_ed25519_key and /etc/ssh/ssh_host_rsa_key for
  1564 -             /etc/ssh/ssh_host_ed25519_key and /etc/ssh/ssh_host_rsa_key for
  2005 +             /etc/ssh/ssh_host_dsa_key and /etc/ssh/ssh_host_rsa_key for
  1565 +             /etc/ssh/ssh_host_dsa_key and /etc/ssh/ssh_host_rsa_key for
  2006               protocol version 2.  Note that sshd(8) will refuse to use a file
  1566               protocol version 2.  Note that sshd(8) will refuse to use a file
  2007               if it is group/world-accessible.  It is possible to have multiple
  1567               if it is group/world-accessible.  It is possible to have multiple
  2008               host key files.  ``rsa1'' keys are used for version 1 and
  1568 -             host key files.  M-bM-^@M-^\rsa1M-bM-^@M-^] keys are used for version 1 and M-bM-^@M-^\dsaM-bM-^@M-^],
  2009 -             ``dsa'', ``ecdsa'', ``ed25519'' or ``rsa'' are used for version 2
  1569 -             M-bM-^@M-^\ecdsaM-bM-^@M-^], M-bM-^@M-^\ed25519M-bM-^@M-^] or M-bM-^@M-^\rsaM-bM-^@M-^] are used for version 2 of the SSH
  2010 +             ``dsa'' or ``rsa'' are used for version 2
  1570 +             host key files.  M-bM-^@M-^\rsa1M-bM-^@M-^] keys are used for version 1 and M-bM-^@M-^\dsaM-bM-^@M-^]
  2011               of the SSH protocol.  It is also possible to specify public host
  1571 +             or M-bM-^@M-^\rsaM-bM-^@M-^] are used for version 2 of the SSH
  2012               key files instead.  In this case operations on the private key
  1572               protocol.  It is also possible to specify public host key files
  2013               will be delegated to an ssh-agent(1).
  1573               instead.  In this case operations on the private key will be
  2014 @@ -399,8 +398,6 @@ DESCRIPTION
  1574               delegated to an ssh-agent(1).
  2015               Specifies the available KEX (Key Exchange) algorithms.  Multiple
  1575 @@ -448,7 +447,6 @@ DESCRIPTION
  2016               algorithms must be comma-separated.  The default is
  1576               algorithms must be comma-separated.  The supported algorithms
       
  1577               are:
       
  1578  
       
  1579 -                   [email protected]
       
  1580                     diffie-hellman-group1-sha1
       
  1581                     diffie-hellman-group14-sha1
       
  1582                     diffie-hellman-group-exchange-sha1
       
  1583 @@ -459,7 +457,6 @@ DESCRIPTION
       
  1584  
       
  1585               The default is:
  2017  
  1586  
  2018 -                   [email protected],
  1587 -                   [email protected],
  2019 -                   ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1588                     ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  2020                     diffie-hellman-group-exchange-sha256,
  1589                     diffie-hellman-group-exchange-sha256,
  2021                     diffie-hellman-group-exchange-sha1,
  1590                     diffie-hellman-group14-sha1
  2022                     diffie-hellman-group14-sha1,
       
  2023 diff -pur old/sshd_config.5 new/sshd_config.5
  1591 diff -pur old/sshd_config.5 new/sshd_config.5
  2024 --- old/sshd_config.5	2015-03-31 21:14:02.442624133 -0700
  1592 --- old/sshd_config.5	2015-05-12 06:57:55.754541097 -0700
  2025 +++ new/sshd_config.5	2015-04-02 08:16:29.655757790 -0700
  1593 +++ new/sshd_config.5	2015-05-12 07:52:26.170307089 -0700
  2026 @@ -546,8 +546,6 @@ The default is
  1594 @@ -628,8 +628,6 @@ The default is
  2027  .Pa /etc/ssh/ssh_host_key
  1595  .Pa /etc/ssh/ssh_host_key
  2028  for protocol version 1, and
  1596  for protocol version 1, and
  2029  .Pa /etc/ssh/ssh_host_dsa_key ,
  1597  .Pa /etc/ssh/ssh_host_dsa_key ,
  2030 -.Pa /etc/ssh/ssh_host_ecdsa_key ,
  1598 -.Pa /etc/ssh/ssh_host_ecdsa_key ,
  2031 -.Pa /etc/ssh/ssh_host_ed25519_key
  1599 -.Pa /etc/ssh/ssh_host_ed25519_key
  2032  and
  1600  and
  2033  .Pa /etc/ssh/ssh_host_rsa_key
  1601  .Pa /etc/ssh/ssh_host_rsa_key
  2034  for protocol version 2.
  1602  for protocol version 2.
  2035 @@ -558,8 +556,6 @@ It is possible to have multiple host key
  1603 @@ -640,8 +638,6 @@ It is possible to have multiple host key
  2036  .Dq rsa1
  1604  .Dq rsa1
  2037  keys are used for version 1 and
  1605  keys are used for version 1 and
  2038  .Dq dsa ,
  1606  .Dq dsa ,
  2039 -.Dq ecdsa ,
  1607 -.Dq ecdsa ,
  2040 -.Dq ed25519
  1608 -.Dq ed25519
  2041  or
  1609  or
  2042  .Dq rsa
  1610  .Dq rsa
  2043  are used for version 2 of the SSH protocol.
  1611  are used for version 2 of the SSH protocol.
  2044 @@ -669,8 +665,6 @@ Specifies the available KEX (Key Exchang
  1612 @@ -764,8 +760,6 @@ The supported algorithms are:
  2045  Multiple algorithms must be comma-separated.
  1613  .Pp
  2046  The default is
  1614  .Bl -item -compact -offset indent
       
  1615  .It
       
  1616 [email protected]
       
  1617 -.It
       
  1618  diffie-hellman-group1-sha1
       
  1619  .It
       
  1620  diffie-hellman-group14-sha1
       
  1621 @@ -783,7 +777,6 @@ ecdh-sha2-nistp521
       
  1622  .Pp
       
  1623  The default is:
  2047  .Bd -literal -offset indent
  1624  .Bd -literal -offset indent
  2048 [email protected],
  1625 [email protected],
  2049 -ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1626  ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  2050  diffie-hellman-group-exchange-sha256,
  1627  diffie-hellman-group-exchange-sha256,
  2051  diffie-hellman-group-exchange-sha1,
  1628  diffie-hellman-group14-sha1
  2052  diffie-hellman-group14-sha1,
  1629 diff -pur old/sshkey.c new/sshkey.c
  2053 diff -pur old/verify.c new/verify.c
  1630 --- old/sshkey.c	2015-05-12 06:57:55.756061267 -0700
  2054 --- old/verify.c	2014-01-16 17:43:44.000000000 -0800
  1631 +++ new/sshkey.c	2015-05-27 03:34:57.475875579 -0700
  2055 +++ new/verify.c	2015-04-01 03:43:49.962792178 -0700
  1632 @@ -85,9 +85,11 @@ struct keytype {
  2056 @@ -9,6 +9,8 @@
  1633  	int cert;
  2057  
  1634  };
  2058  #include "crypto_api.h"
  1635  static const struct keytype keytypes[] = {
  2059  
  1636 +#ifndef WITHOUT_ED25519
  2060 +#ifndef WITHOUT_ED25519
  1637  	{ "ssh-ed25519", "ED25519", KEY_ED25519, 0, 0 },
  2061 +
  1638  	{ "[email protected]", "ED25519-CERT",
  2062  int crypto_verify_32(const unsigned char *x,const unsigned char *y)
  1639  	    KEY_ED25519_CERT, 0, 1 },
  2063  {
  1640 +#endif /* WITHOUT_ED25519 */
  2064    unsigned int differentbits = 0;
  1641  #ifdef WITH_OPENSSL
  2065 @@ -47,3 +49,4 @@ int crypto_verify_32(const unsigned char
  1642  	{ NULL, "RSA1", KEY_RSA1, 0, 0 },
  2066    F(31)
  1643  	{ "ssh-rsa", "RSA", KEY_RSA, 0, 0 },
  2067    return (1 & ((differentbits - 1) >> 8)) - 1;
  1644 @@ -284,8 +286,10 @@ sshkey_size(const struct sshkey *k)
  2068  }
  1645  	case KEY_ECDSA_CERT:
  2069 +#endif /* WITHOUT_ED25519 */
  1646  		return sshkey_curve_nid_to_bits(k->ecdsa_nid);
       
  1647  #endif /* WITH_OPENSSL */
       
  1648 +#ifndef WITHOUT_ED25519
       
  1649  	case KEY_ED25519:
       
  1650  	case KEY_ED25519_CERT:
       
  1651 +#endif /* WITHOUT_ED25519 */
       
  1652  		return 256;	/* XXX */
       
  1653  	}
       
  1654  	return 0;
       
  1655 @@ -310,7 +314,9 @@ sshkey_type_is_valid_ca(int type)
       
  1656  	case KEY_RSA:
       
  1657  	case KEY_DSA:
       
  1658  	case KEY_ECDSA:
       
  1659 +#ifndef WITHOUT_ED25519
       
  1660  	case KEY_ED25519:
       
  1661 +#endif /* WITHOUT_ED25519 */
       
  1662  		return 1;
       
  1663  	default:
       
  1664  		return 0;
       
  1665 @@ -338,8 +344,10 @@ sshkey_type_plain(int type)
       
  1666  		return KEY_DSA;
       
  1667  	case KEY_ECDSA_CERT:
       
  1668  		return KEY_ECDSA;
       
  1669 +#ifndef WITHOUT_ED25519
       
  1670  	case KEY_ED25519_CERT:
       
  1671  		return KEY_ED25519;
       
  1672 +#endif /* WITHOUT_ED25519 */
       
  1673  	default:
       
  1674  		return type;
       
  1675  	}
       
  1676 @@ -492,8 +500,10 @@ sshkey_new(int type)
       
  1677  	k->dsa = NULL;
       
  1678  	k->rsa = NULL;
       
  1679  	k->cert = NULL;
       
  1680 +#ifndef WITHOUT_ED25519
       
  1681  	k->ed25519_sk = NULL;
       
  1682  	k->ed25519_pk = NULL;
       
  1683 +#endif /* WITHOUT_ED25519 */
       
  1684  	switch (k->type) {
       
  1685  #ifdef WITH_OPENSSL
       
  1686  	case KEY_RSA1:
       
  1687 @@ -530,10 +540,12 @@ sshkey_new(int type)
       
  1688  		/* Cannot do anything until we know the group */
       
  1689  		break;
       
  1690  #endif /* WITH_OPENSSL */
       
  1691 +#ifndef WITHOUT_ED25519
       
  1692  	case KEY_ED25519:
       
  1693  	case KEY_ED25519_CERT:
       
  1694  		/* no need to prealloc */
       
  1695  		break;
       
  1696 +#endif /* WITHOUT_ED25519 */
       
  1697  	case KEY_UNSPEC:
       
  1698  		break;
       
  1699  	default:
       
  1700 @@ -582,10 +594,12 @@ sshkey_add_private(struct sshkey *k)
       
  1701  		/* Cannot do anything until we know the group */
       
  1702  		break;
       
  1703  #endif /* WITH_OPENSSL */
       
  1704 +#ifndef WITHOUT_ED25519
       
  1705  	case KEY_ED25519:
       
  1706  	case KEY_ED25519_CERT:
       
  1707  		/* no need to prealloc */
       
  1708  		break;
       
  1709 +#endif /* WITHOUT_ED25519 */
       
  1710  	case KEY_UNSPEC:
       
  1711  		break;
       
  1712  	default:
       
  1713 @@ -639,6 +653,7 @@ sshkey_free(struct sshkey *k)
       
  1714  		break;
       
  1715  # endif /* OPENSSL_HAS_ECC */
       
  1716  #endif /* WITH_OPENSSL */
       
  1717 +#ifndef WITHOUT_ED25519
       
  1718  	case KEY_ED25519:
       
  1719  	case KEY_ED25519_CERT:
       
  1720  		if (k->ed25519_pk) {
       
  1721 @@ -652,6 +667,7 @@ sshkey_free(struct sshkey *k)
       
  1722  			k->ed25519_sk = NULL;
       
  1723  		}
       
  1724  		break;
       
  1725 +#endif /* WITHOUT_ED25519 */
       
  1726  	case KEY_UNSPEC:
       
  1727  		break;
       
  1728  	default:
       
  1729 @@ -731,10 +747,12 @@ sshkey_equal_public(const struct sshkey
       
  1730  		return 1;
       
  1731  # endif /* OPENSSL_HAS_ECC */
       
  1732  #endif /* WITH_OPENSSL */
       
  1733 +#ifndef WITHOUT_ED25519
       
  1734  	case KEY_ED25519:
       
  1735  	case KEY_ED25519_CERT:
       
  1736  		return a->ed25519_pk != NULL && b->ed25519_pk != NULL &&
       
  1737  		    memcmp(a->ed25519_pk, b->ed25519_pk, ED25519_PK_SZ) == 0;
       
  1738 +#endif /* WITHOUT_ED25519 */
       
  1739  	default:
       
  1740  		return 0;
       
  1741  	}
       
  1742 @@ -773,7 +791,9 @@ to_blob_buf(const struct sshkey *key, st
       
  1743  	case KEY_ECDSA_CERT:
       
  1744  	case KEY_RSA_CERT:
       
  1745  #endif /* WITH_OPENSSL */
       
  1746 +#ifndef WITHOUT_ED25519
       
  1747  	case KEY_ED25519_CERT:
       
  1748 +#endif /* WITHOUT_ED25519 */
       
  1749  		/* Use the existing blob */
       
  1750  		/* XXX modified flag? */
       
  1751  		if ((ret = sshbuf_putb(b, key->cert->certblob)) != 0)
       
  1752 @@ -810,6 +830,7 @@ to_blob_buf(const struct sshkey *key, st
       
  1753  			return ret;
       
  1754  		break;
       
  1755  #endif /* WITH_OPENSSL */
       
  1756 +#ifndef WITHOUT_ED25519
       
  1757  	case KEY_ED25519:
       
  1758  		if (key->ed25519_pk == NULL)
       
  1759  			return SSH_ERR_INVALID_ARGUMENT;
       
  1760 @@ -818,6 +839,7 @@ to_blob_buf(const struct sshkey *key, st
       
  1761  		    key->ed25519_pk, ED25519_PK_SZ)) != 0)
       
  1762  			return ret;
       
  1763  		break;
       
  1764 +#endif /* WITHOUT_ED25519 */
       
  1765  	default:
       
  1766  		return SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1767  	}
       
  1768 @@ -1291,13 +1313,17 @@ sshkey_read(struct sshkey *ret, char **c
       
  1769  	case KEY_RSA:
       
  1770  	case KEY_DSA:
       
  1771  	case KEY_ECDSA:
       
  1772 +#ifndef WITHOUT_ED25519
       
  1773  	case KEY_ED25519:
       
  1774 +#endif /* WITHOUT_ED25519 */
       
  1775  	case KEY_DSA_CERT_V00:
       
  1776  	case KEY_RSA_CERT_V00:
       
  1777  	case KEY_DSA_CERT:
       
  1778  	case KEY_ECDSA_CERT:
       
  1779  	case KEY_RSA_CERT:
       
  1780 +#ifndef WITHOUT_ED25519
       
  1781  	case KEY_ED25519_CERT:
       
  1782 +#endif /* WITHOUT_ED25519 */
       
  1783  		space = strchr(cp, ' ');
       
  1784  		if (space == NULL)
       
  1785  			return SSH_ERR_INVALID_FORMAT;
       
  1786 @@ -1389,6 +1415,7 @@ sshkey_read(struct sshkey *ret, char **c
       
  1787  		}
       
  1788  # endif /* OPENSSL_HAS_ECC */
       
  1789  #endif /* WITH_OPENSSL */
       
  1790 +#ifndef WITHOUT_ED25519
       
  1791  		if (sshkey_type_plain(ret->type) == KEY_ED25519) {
       
  1792  			free(ret->ed25519_pk);
       
  1793  			ret->ed25519_pk = k->ed25519_pk;
       
  1794 @@ -1397,6 +1424,7 @@ sshkey_read(struct sshkey *ret, char **c
       
  1795  			/* XXX */
       
  1796  #endif
       
  1797  		}
       
  1798 +#endif /* WITHOUT_ED25519 */
       
  1799  		retval = 0;
       
  1800  /*XXXX*/
       
  1801  		sshkey_free(k);
       
  1802 @@ -1460,8 +1488,10 @@ sshkey_write(const struct sshkey *key, F
       
  1803  	case KEY_RSA_CERT_V00:
       
  1804  	case KEY_RSA_CERT:
       
  1805  #endif /* WITH_OPENSSL */
       
  1806 +#ifndef WITHOUT_ED25519
       
  1807  	case KEY_ED25519:
       
  1808  	case KEY_ED25519_CERT:
       
  1809 +#endif /* WITHOUT_ED25519 */
       
  1810  		if ((bb = sshbuf_new()) == NULL) {
       
  1811  			ret = SSH_ERR_ALLOC_FAIL;
       
  1812  			goto out;
       
  1813 @@ -1671,7 +1701,8 @@ sshkey_generate(int type, u_int bits, st
       
  1814  	if ((k = sshkey_new(KEY_UNSPEC)) == NULL)
       
  1815  		return SSH_ERR_ALLOC_FAIL;
       
  1816  	switch (type) {
       
  1817 -	case KEY_ED25519:
       
  1818 +#ifndef WITHOUT_ED25519
       
  1819 +		case KEY_ED25519:
       
  1820  		if ((k->ed25519_pk = malloc(ED25519_PK_SZ)) == NULL ||
       
  1821  		    (k->ed25519_sk = malloc(ED25519_SK_SZ)) == NULL) {
       
  1822  			ret = SSH_ERR_ALLOC_FAIL;
       
  1823 @@ -1680,6 +1711,7 @@ sshkey_generate(int type, u_int bits, st
       
  1824  		crypto_sign_ed25519_keypair(k->ed25519_pk, k->ed25519_sk);
       
  1825  		ret = 0;
       
  1826  		break;
       
  1827 +#endif /* WITHOUT_ED25519 */
       
  1828  #ifdef WITH_OPENSSL
       
  1829  	case KEY_DSA:
       
  1830  		ret = dsa_generate_private_key(bits, &k->dsa);
       
  1831 @@ -1817,6 +1849,7 @@ sshkey_from_private(const struct sshkey
       
  1832  		}
       
  1833  		break;
       
  1834  #endif /* WITH_OPENSSL */
       
  1835 +#ifndef WITHOUT_ED25519
       
  1836  	case KEY_ED25519:
       
  1837  	case KEY_ED25519_CERT:
       
  1838  		if ((n = sshkey_new(k->type)) == NULL)
       
  1839 @@ -1829,6 +1862,7 @@ sshkey_from_private(const struct sshkey
       
  1840  			memcpy(n->ed25519_pk, k->ed25519_pk, ED25519_PK_SZ);
       
  1841  		}
       
  1842  		break;
       
  1843 +#endif /* WITHOUT_ED25519 */
       
  1844  	default:
       
  1845  		return SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1846  	}
       
  1847 @@ -2100,6 +2134,7 @@ sshkey_from_blob_internal(struct sshbuf
       
  1848  		break;
       
  1849  # endif /* OPENSSL_HAS_ECC */
       
  1850  #endif /* WITH_OPENSSL */
       
  1851 +#ifndef WITHOUT_ED25519
       
  1852  	case KEY_ED25519_CERT:
       
  1853  		/* Skip nonce */
       
  1854  		if (sshbuf_get_string_direct(b, NULL, NULL) != 0) {
       
  1855 @@ -2121,6 +2156,7 @@ sshkey_from_blob_internal(struct sshbuf
       
  1856  		key->ed25519_pk = pk;
       
  1857  		pk = NULL;
       
  1858  		break;
       
  1859 +#endif /* WITHOUT_ED25519 */
       
  1860  	case KEY_UNSPEC:
       
  1861  		if ((key = sshkey_new(type)) == NULL) {
       
  1862  			ret = SSH_ERR_ALLOC_FAIL;
       
  1863 @@ -2215,9 +2251,11 @@ sshkey_sign(const struct sshkey *key,
       
  1864  	case KEY_RSA:
       
  1865  		return ssh_rsa_sign(key, sigp, lenp, data, datalen, compat);
       
  1866  #endif /* WITH_OPENSSL */
       
  1867 +#ifndef WITHOUT_ED25519
       
  1868  	case KEY_ED25519:
       
  1869  	case KEY_ED25519_CERT:
       
  1870  		return ssh_ed25519_sign(key, sigp, lenp, data, datalen, compat);
       
  1871 +#endif /* WITHOUT_ED25519 */
       
  1872  	default:
       
  1873  		return SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1874  	}
       
  1875 @@ -2249,9 +2287,11 @@ sshkey_verify(const struct sshkey *key,
       
  1876  	case KEY_RSA:
       
  1877  		return ssh_rsa_verify(key, sig, siglen, data, dlen, compat);
       
  1878  #endif /* WITH_OPENSSL */
       
  1879 +#ifndef WITHOUT_ED25519
       
  1880  	case KEY_ED25519:
       
  1881  	case KEY_ED25519_CERT:
       
  1882  		return ssh_ed25519_verify(key, sig, siglen, data, dlen, compat);
       
  1883 +#endif /* WITHOUT_ED25519 */
       
  1884  	default:
       
  1885  		return SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1886  	}
       
  1887 @@ -2275,8 +2315,10 @@ sshkey_demote(const struct sshkey *k, st
       
  1888  	pk->dsa = NULL;
       
  1889  	pk->ecdsa = NULL;
       
  1890  	pk->rsa = NULL;
       
  1891 +#ifndef WITHOUT_ED25519
       
  1892  	pk->ed25519_pk = NULL;
       
  1893  	pk->ed25519_sk = NULL;
       
  1894 +#endif /* WITHOUT_ED25519 */
       
  1895  
       
  1896  	switch (k->type) {
       
  1897  #ifdef WITH_OPENSSL
       
  1898 @@ -2328,6 +2370,7 @@ sshkey_demote(const struct sshkey *k, st
       
  1899  		break;
       
  1900  # endif /* OPENSSL_HAS_ECC */
       
  1901  #endif /* WITH_OPENSSL */
       
  1902 +#ifndef WITHOUT_ED25519
       
  1903  	case KEY_ED25519_CERT:
       
  1904  		if ((ret = sshkey_cert_copy(k, pk)) != 0)
       
  1905  			goto fail;
       
  1906 @@ -2341,6 +2384,7 @@ sshkey_demote(const struct sshkey *k, st
       
  1907  			memcpy(pk->ed25519_pk, k->ed25519_pk, ED25519_PK_SZ);
       
  1908  		}
       
  1909  		break;
       
  1910 +#endif /* WITHOUT_ED25519 */
       
  1911  	default:
       
  1912  		ret = SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1913   fail:
       
  1914 @@ -2371,11 +2415,13 @@ sshkey_to_certified(struct sshkey *k, in
       
  1915  		newtype = KEY_ECDSA_CERT;
       
  1916  		break;
       
  1917  #endif /* WITH_OPENSSL */
       
  1918 +#ifndef WITHOUT_ED25519
       
  1919  	case KEY_ED25519:
       
  1920  		if (legacy)
       
  1921  			return SSH_ERR_INVALID_ARGUMENT;
       
  1922  		newtype = KEY_ED25519_CERT;
       
  1923  		break;
       
  1924 +#endif /* WITHOUT_ED25519 */
       
  1925  	default:
       
  1926  		return SSH_ERR_INVALID_ARGUMENT;
       
  1927  	}
       
  1928 @@ -2458,11 +2504,13 @@ sshkey_certify(struct sshkey *k, struct
       
  1929  			goto out;
       
  1930  		break;
       
  1931  #endif /* WITH_OPENSSL */
       
  1932 +#ifndef WITHOUT_ED25519
       
  1933  	case KEY_ED25519_CERT:
       
  1934  		if ((ret = sshbuf_put_string(cert,
       
  1935  		    k->ed25519_pk, ED25519_PK_SZ)) != 0)
       
  1936  			goto out;
       
  1937  		break;
       
  1938 +#endif /* WITHOUT_ED25519 */
       
  1939  	default:
       
  1940  		ret = SSH_ERR_INVALID_ARGUMENT;
       
  1941  		goto out;
       
  1942 @@ -2657,6 +2705,7 @@ sshkey_private_serialize(const struct ss
       
  1943  		break;
       
  1944  # endif /* OPENSSL_HAS_ECC */
       
  1945  #endif /* WITH_OPENSSL */
       
  1946 +#ifndef WITHOUT_ED25519
       
  1947  	case KEY_ED25519:
       
  1948  		if ((r = sshbuf_put_string(b, key->ed25519_pk,
       
  1949  		    ED25519_PK_SZ)) != 0 ||
       
  1950 @@ -2676,6 +2725,7 @@ sshkey_private_serialize(const struct ss
       
  1951  		    ED25519_SK_SZ)) != 0)
       
  1952  			goto out;
       
  1953  		break;
       
  1954 +#endif /* WITHOUT_ED25519 */
       
  1955  	default:
       
  1956  		r = SSH_ERR_INVALID_ARGUMENT;
       
  1957  		goto out;
       
  1958 @@ -2802,6 +2852,7 @@ sshkey_private_deserialize(struct sshbuf
       
  1959  			goto out;
       
  1960  		break;
       
  1961  #endif /* WITH_OPENSSL */
       
  1962 +#ifndef WITHOUT_ED25519
       
  1963  	case KEY_ED25519:
       
  1964  		if ((k = sshkey_new_private(type)) == NULL) {
       
  1965  			r = SSH_ERR_ALLOC_FAIL;
       
  1966 @@ -2832,6 +2883,7 @@ sshkey_private_deserialize(struct sshbuf
       
  1967  		k->ed25519_sk = ed25519_sk;
       
  1968  		ed25519_pk = ed25519_sk = NULL;
       
  1969  		break;
       
  1970 +#endif /* WITHOUT_ED25519 */
       
  1971  	default:
       
  1972  		r = SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1973  		goto out;
       
  1974 @@ -3591,9 +3643,11 @@ sshkey_private_to_fileblob(struct sshkey
       
  1975  		return sshkey_private_pem_to_blob(key, blob,
       
  1976  		    passphrase, comment);
       
  1977  #endif /* WITH_OPENSSL */
       
  1978 +#ifndef WITHOUT_ED25519
       
  1979  	case KEY_ED25519:
       
  1980  		return sshkey_private_to_blob2(key, blob, passphrase,
       
  1981  		    comment, new_format_cipher, new_format_rounds);
       
  1982 +#endif /* WITHOUT_ED25519 */
       
  1983  	default:
       
  1984  		return SSH_ERR_KEY_TYPE_UNKNOWN;
       
  1985  	}
       
  1986 @@ -3899,9 +3953,11 @@ sshkey_parse_private_fileblob_type(struc
       
  1987  		return sshkey_parse_private_pem_fileblob(blob, type,
       
  1988  		    passphrase, keyp);
       
  1989  #endif /* WITH_OPENSSL */
       
  1990 +#ifndef WITHOUT_ED25519
       
  1991  	case KEY_ED25519:
       
  1992  		return sshkey_parse_private2(blob, type, passphrase,
       
  1993  		    keyp, commentp);
       
  1994 +#endif /* WITHOUT_ED25519 */
       
  1995  	case KEY_UNSPEC:
       
  1996  		if ((r = sshkey_parse_private2(blob, type, passphrase, keyp,
       
  1997  		    commentp)) == 0)
       
  1998 diff -pur old/sshkey.h new/sshkey.h
       
  1999 --- old/sshkey.h	2015-05-12 06:57:55.756485788 -0700
       
  2000 +++ new/sshkey.h	2015-05-12 06:57:55.885805405 -0700
       
  2001 @@ -57,11 +57,15 @@ enum sshkey_types {
       
  2002  	KEY_RSA,
       
  2003  	KEY_DSA,
       
  2004  	KEY_ECDSA,
       
  2005 +#ifndef WITHOUT_ED25519
       
  2006  	KEY_ED25519,
       
  2007 +#endif /* WITHOUT_ED25519 */
       
  2008  	KEY_RSA_CERT,
       
  2009  	KEY_DSA_CERT,
       
  2010  	KEY_ECDSA_CERT,
       
  2011 +#ifndef WITHOUT_ED25519
       
  2012  	KEY_ED25519_CERT,
       
  2013 +#endif /* WITHOUT_ED25519 */
       
  2014  	KEY_RSA_CERT_V00,
       
  2015  	KEY_DSA_CERT_V00,
       
  2016  	KEY_NULL,
       
  2017 @@ -106,13 +110,17 @@ struct sshkey {
       
  2018  	DSA	*dsa;
       
  2019  	int	 ecdsa_nid;	/* NID of curve */
       
  2020  	EC_KEY	*ecdsa;
       
  2021 +#ifndef WITHOUT_ED25519
       
  2022  	u_char	*ed25519_sk;
       
  2023  	u_char	*ed25519_pk;
       
  2024 +#endif /* WITHOUT_ED25519 */
       
  2025  	struct sshkey_cert *cert;
       
  2026  };
       
  2027  
       
  2028 +#ifndef WITHOUT_ED25519
       
  2029  #define	ED25519_SK_SZ	crypto_sign_ed25519_SECRETKEYBYTES
       
  2030  #define	ED25519_PK_SZ	crypto_sign_ed25519_PUBLICKEYBYTES
       
  2031 +#endif /* WITHOUT_ED25519 */
       
  2032  
       
  2033  struct sshkey	*sshkey_new(int);
       
  2034  int		 sshkey_add_private(struct sshkey *);
       
  2035 @@ -210,11 +218,13 @@ int ssh_ecdsa_sign(const struct sshkey *
       
  2036  int ssh_ecdsa_verify(const struct sshkey *key,
       
  2037      const u_char *signature, size_t signaturelen,
       
  2038      const u_char *data, size_t datalen, u_int compat);
       
  2039 +#ifndef WITHOUT_ED25519
       
  2040  int ssh_ed25519_sign(const struct sshkey *key, u_char **sigp, size_t *lenp,
       
  2041      const u_char *data, size_t datalen, u_int compat);
       
  2042  int ssh_ed25519_verify(const struct sshkey *key,
       
  2043      const u_char *signature, size_t signaturelen,
       
  2044      const u_char *data, size_t datalen, u_int compat);
       
  2045 +#endif /* WITHOUT_ED25519 */
       
  2046  #endif
       
  2047  
       
  2048  #if !defined(WITH_OPENSSL)