Blame doc/cha-auth.texi

Packit Service 4684c1
@node Authentication methods
Packit Service 4684c1
@chapter Authentication methods
Packit Service 4684c1
@cindex authentication methods
Packit Service 4684c1
Packit Service 4684c1
The initial key exchange of the TLS protocol performs authentication
Packit Service 4684c1
of the peers. In typical scenarios the server is authenticated to
Packit Service 4684c1
the client, and optionally the client to the server.
Packit Service 4684c1
Packit Service 4684c1
While many associate TLS with X.509 certificates and public key
Packit Service 4684c1
authentication, the protocol supports various authentication methods,
Packit Service 4684c1
including pre-shared keys, and passwords. In this chapter a description
Packit Service 4684c1
of the existing authentication methods is provided, as well as some
Packit Service 4684c1
guidance on which use-cases each method can be used at.
Packit Service 4684c1
Packit Service 4684c1
@menu
Packit Service 4684c1
* Certificate authentication::
Packit Service 4684c1
* More on certificate authentication::
Packit Service 4684c1
* Shared-key and anonymous authentication::
Packit Service 4684c1
* Selecting an appropriate authentication method::
Packit Service 4684c1
@end menu
Packit Service 4684c1
Packit Service 4684c1
@include cha-cert-auth.texi
Packit Service 4684c1
Packit Service 4684c1
@include cha-cert-auth2.texi
Packit Service 4684c1
Packit Service 4684c1
@include cha-shared-key.texi
Packit Service 4684c1
Packit Service 4684c1
@node Selecting an appropriate authentication method
Packit Service 4684c1
@section Selecting an appropriate authentication method
Packit Service 4684c1
Packit Service 4684c1
This section provides some guidance on how to use the available authentication
Packit Service 4684c1
methods in @acronym{GnuTLS} in various scenarios.
Packit Service 4684c1
Packit Service 4684c1
@subsection Two peers with an out-of-band channel
Packit Service 4684c1
Packit Service 4684c1
Let's consider two peers who need to communicate over an untrusted channel
Packit Service 4684c1
(the Internet), but have an out-of-band channel available. The latter
Packit Service 4684c1
channel is considered safe from eavesdropping and message modification and thus
Packit Service 4684c1
can be used for an initial bootstrapping of the protocol. The options 
Packit Service 4684c1
available are:
Packit Service 4684c1
@itemize
Packit Service 4684c1
@item Pre-shared keys (see @ref{PSK authentication}). The server and a
Packit Service 4684c1
client communicate a shared randomly generated key over the trusted
Packit Service 4684c1
channel and use it to negotiate further sessions over the untrusted channel.
Packit Service 4684c1
Packit Service 4684c1
@item Passwords (see @ref{SRP authentication}). The client communicates
Packit Service 4684c1
to the server its username and password of choice and uses it to
Packit Service 4684c1
negotiate further sessions over the untrusted channel.
Packit Service 4684c1
Packit Service 4684c1
@item Public keys (see @ref{Certificate authentication}). The client 
Packit Service 4684c1
and the server exchange their public keys (or fingerprints of them)
Packit Service 4684c1
over the trusted channel. 
Packit Service 4684c1
On future sessions over the untrusted channel they verify the key
Packit Service 4684c1
being the same (similar to @ref{Verifying a certificate using trust on first use
Packit Service 4684c1
authentication}).
Packit Service 4684c1
@end itemize
Packit Service 4684c1
Packit Service 4684c1
Provided that the out-of-band channel is trusted all of the above provide
Packit Service 4684c1
a similar level of protection. An out-of-band channel may be the initial
Packit Service 4684c1
bootstrapping of a user's PC in a corporate environment, in-person
Packit Service 4684c1
communication, communication over an alternative network (e.g. the phone
Packit Service 4684c1
network), etc.
Packit Service 4684c1
Packit Service 4684c1
@subsection Two peers without an out-of-band channel
Packit Service 4684c1
Packit Service 4684c1
When an out-of-band channel is not available a peer cannot be reliably
Packit Service 4684c1
authenticated. What can be done, however, is to allow some form of
Packit Service 4684c1
registration of users connecting for the first time and ensure that their
Packit Service 4684c1
keys remain the same after that initial connection. This is termed
Packit Service 4684c1
key continuity or trust on first use (TOFU).
Packit Service 4684c1
Packit Service 4684c1
The available option is to use public key authentication (see @ref{Certificate authentication}). 
Packit Service 4684c1
The client and the server store each other's public keys (or fingerprints of them)
Packit Service 4684c1
and associate them with their identity.
Packit Service 4684c1
On future sessions over the untrusted channel they verify the keys
Packit Service 4684c1
being the same (see @ref{Verifying a certificate using trust on first use
Packit Service 4684c1
authentication}).
Packit Service 4684c1
Packit Service 4684c1
To mitigate the uncertainty of the information exchanged in the first 
Packit Service 4684c1
connection other channels over the Internet may be used, e.g., @acronym{DNSSEC}
Packit Service 4684c1
(see @ref{Verifying a certificate using DANE}).
Packit Service 4684c1
Packit Service 4684c1
@subsection Two peers and a trusted third party
Packit Service 4684c1
Packit Service 4684c1
When a trusted third party is available (or a certificate authority) 
Packit Service 4684c1
the most suitable option is to use 
Packit Service 4684c1
certificate authentication (see @ref{Certificate authentication}). 
Packit Service 4684c1
The client and the server obtain certificates that associate their identity
Packit Service 4684c1
and public keys using a digital signature by the trusted party and use 
Packit Service 4684c1
them to on the subsequent communications with each other. 
Packit Service 4684c1
Each party verifies the peer's certificate using the trusted third party's 
Packit Service 4684c1
signature. The parameters of the third party's signature are present
Packit Service 4684c1
in its certificate which must be available to all communicating parties.
Packit Service 4684c1
Packit Service 4684c1
While the above is the typical authentication method for servers in the
Packit Service 4684c1
Internet by using the commercial CAs, the users that act as clients in the
Packit Service 4684c1
protocol rarely possess such certificates. In that case a hybrid method
Packit Service 4684c1
can be used where the server is authenticated by the client using the
Packit Service 4684c1
commercial CAs and the client is authenticated based on some information
Packit Service 4684c1
the client provided over the initial server-authenticated channel. The
Packit Service 4684c1
available options are:
Packit Service 4684c1
@itemize
Packit Service 4684c1
@item Passwords (see @ref{SRP authentication}). The client communicates
Packit Service 4684c1
to the server its username and password of choice on the initial
Packit Service 4684c1
server-authenticated connection and uses it to negotiate further sessions. 
Packit Service 4684c1
This is possible because the SRP protocol allows for the server to be 
Packit Service 4684c1
authenticated using a certificate and the client using the
Packit Service 4684c1
password.
Packit Service 4684c1
Packit Service 4684c1
@item Public keys (see @ref{Certificate authentication}). The client 
Packit Service 4684c1
sends its public key to the server (or a fingerprint of it) over the
Packit Service 4684c1
initial server-authenticated connection. 
Packit Service 4684c1
On future sessions the client verifies the server using the third party
Packit Service 4684c1
certificate and the server verifies that the client's public key remained 
Packit Service 4684c1
the same (see @ref{Verifying a certificate using trust on first use
Packit Service 4684c1
authentication}).
Packit Service 4684c1
@end itemize
Packit Service 4684c1