Blame doc/cha-auth.texi

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