From 10dd3321f37175b0adb4c8a31371419d45bf94d0 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Fri, 8 Sep 2017 18:16:24 +0200 Subject: ssh: Doc modified after comments --- lib/ssh/doc/src/configure_algos.xml | 73 +++++++++++-------------------------- lib/ssh/doc/src/ssh.xml | 39 +++++++++++++++----- 2 files changed, 52 insertions(+), 60 deletions(-) (limited to 'lib/ssh') diff --git a/lib/ssh/doc/src/configure_algos.xml b/lib/ssh/doc/src/configure_algos.xml index ebd128c097..dd60324851 100644 --- a/lib/ssh/doc/src/configure_algos.xml +++ b/lib/ssh/doc/src/configure_algos.xml @@ -35,11 +35,11 @@
Introduction -

To fully understand how to configure the algorithms, we must understand partly both how the ssh protocol - works and how the OTP SSH app handles the corresponding items

+

To fully understand how to configure the algorithms, it is essential to have a basic understanding of the SSH protocol + and how OTP SSH app handles the corresponding items

-

The first subsection will give a short background about the ssh protocol while later sections describes - the implementation and provides many examples

+

The first subsection will give a short background of the SSH protocol while later sections describes + the implementation and provides some examples

Basics of the ssh protocol's algorithms handling @@ -77,7 +77,7 @@ cipher -

Symetric cipher algorithm used for the message encryption. This algorithm will use the key calculated +

Symetric cipher algorithm used for the payload encryption. This algorithm will use the key calculated in the kex phase (together with other info) to genereate the actual key used. Examples are tripple-DES '3des-cbc' and one of many AES variants 'aes192-ctr'.

@@ -115,7 +115,7 @@

Due to this, it impossible to list in documentation what algorithms that are available in a certain installation.

-

There is an important commands to list the actual algorithms and their ordering: +

There is an important command to list the actual algorithms and their ordering: ssh:default_algorithms/0.

0> ssh:default_algorithms(). @@ -143,8 +143,8 @@ {server2client,[none,'zlib@openssh.com',zlib]}]}] -

To change this listing, there are two options which can be used in - ssh:default_algorithms/2,3,4 +

To change the algorithm list, there are two options which can be used in + ssh:connect/2,3,4 and ssh:daemon/2,3. The options could of course be used in all other functions that initiates connections.

@@ -160,8 +160,9 @@

Here follows a series of examples ranging from simple to more complex.

-

The experimental function ssh:chk_algos_opts(Opts) mangles the options preferred_algorithms - and modify_algorithms as ssh:dameon, ssh:connect and others does.

+

To forsee the effect of an option there is an experimental function ssh:chk_algos_opts(Opts). + It mangles the options preferred_algorithms + and modify_algorithms in the same way as ssh:dameon, ssh:connect and their friends does.

Example 1 @@ -292,11 +293,12 @@
Modifying the default set: modify_algorithms -

The option preferred_algorithms is complicated to use for adding or removing single algorithms. One has - to first list them with ssh:default_algorithms() and then do substitutions in the lists. A situation - when it might be useful to add an algorithm is when one need to use a supported but disabled one. An example - is the kex 'diffie-hellman-group1-sha1' which nowadays is very unsecure and therefore disabled. It is +

A situation where it might be useful to add an algorithm is when one need to use a supported but disabled one. + An example is the 'diffie-hellman-group1-sha1' which nowadays is very unsecure and therefore disabled. It is however still supported and might be used.

+ +

The option preferred_algorithms may be complicated to use for adding or removing single algorithms. + First one has to list them with ssh:default_algorithms() and then do changes in the lists.

To facilitate addition or removal of algorithms the option modify_algorithms is available. See the Reference Manual for details.

@@ -352,8 +354,8 @@
Example 6 -

In next example, we also move the 'ecdh-sha2-nistp521' to the end in the kex - list, that is, append.

+

In this example, we in put the 'diffie-hellman-group1-sha1' first and also move the + 'ecdh-sha2-nistp521' to the end in the kex list, that is, append it.

6> ssh:chk_algos_opts( [{modify_algorithms, @@ -377,46 +379,15 @@ ..... ] -

Note that the appended algorithm is removed from its original place and then appended.

+

Note that the appended algorithm is removed from its original place and then appended to the same list.

Example 7 -

In next example, we also move the 'ecdh-sha2-nistp521' to the end in the kex - list, that is, append.

- -7> ssh:chk_algos_opts( - [{modify_algorithms, - [{prepend, - [{kex, ['diffie-hellman-group1-sha1']} - ]}, - {append, - [{kex, ['ecdh-sha2-nistp521']} - ]} - ] - } - ]). -[{kex,['diffie-hellman-group1-sha1','ecdh-sha2-nistp384', - 'ecdh-sha2-nistp256','diffie-hellman-group-exchange-sha256', - 'diffie-hellman-group16-sha512', - 'diffie-hellman-group18-sha512', - 'diffie-hellman-group14-sha256', - 'diffie-hellman-group14-sha1', - 'diffie-hellman-group-exchange-sha1','ecdh-sha2-nistp521']}, - {public_key,['ecdsa-sha2-nistp384','ecdsa-sha2-nistp521', - ..... -] - -

Note that the appended algorithm first is removed from its original place and then appended.

-
- - -
- Example 8

In this example, we use both options (preferred_algorithms and modify_algorithms) and also try to prepend an unsupported algorithm. Any unsupported algorithm is quietly removed.

-8> ssh:chk_algos_opts( +7> ssh:chk_algos_opts( [{preferred_algorithms, [{cipher,['aes128-ctr']}, {mac,['hmac-sha2-256']}, @@ -446,8 +417,8 @@ {server2client,[none]}]}] -

It is of course questionable why anyone would like to use the both options together, but it is possible - if the needed.

+

It is of course questionable why anyone would like to use the both these options together, + but it is possible if an unforeseen need should arise.

diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml index 48553bf503..d9516fff12 100644 --- a/lib/ssh/doc/src/ssh.xml +++ b/lib/ssh/doc/src/ssh.xml @@ -292,18 +292,39 @@

Modifies the list of algorithms to use in the algorithm negotiation. The modifications are - applied after the option preferred_algorithms is applied (if existing)

-

The possible modifications are to:

+ applied after the option preferred_algorithms (if existing) is applied.

+

The algoritm for modifications works like this:

-

Append or prepend supported but not enabled algorithm(s) to the list of - algorithms.

If the wanted algorithms already are in the list of algorithms, they will first - be removed and then appended or prepended. -

+ +

Input is the modify_algs_list() and a set of algorithms A + obtained from the preferred_algorithms option if existing, or else from the + ssh:default_algorithms/0. +

+
+ +

The head of the modify_algs_list() modifies A giving the result A'.

+

The possible modifications are:

+ + +

Append or prepend supported but not enabled algorithm(s) to the list of + algorithms. If the wanted algorithms already are in A they will first + be removed and then appended or prepended, +

+
+ +

Remove (rm) one or more algorithms from A. +

+
+
+
+ +

Repeat the modification step with the tail of modify_algs_list() and the resulting + A'. +

-

Remove (rm) one or more algorithms from the list of algorithms.

-

If an unsupported algorithm is in the list, it will be silently ignored

- +

If an unsupported algorithm is in the modify_algs_list(), it will be silently ignored

+

If there are more than one modify_algorithms options, the result is undefined.

Here is an example of this option:

{modify_algorithms, -- cgit v1.2.3