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