summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--doc/Makefile.am4
-rw-r--r--doc/cha-auth.texi102
-rw-r--r--doc/cha-bib.texi8
-rw-r--r--doc/cha-cert-auth.texi189
-rw-r--r--doc/cha-ciphersuites.texi34
-rw-r--r--doc/cha-errors.texi11
-rw-r--r--doc/cha-functions.texi74
-rw-r--r--doc/cha-gtls-app.texi66
-rw-r--r--doc/cha-internals.texi2
-rw-r--r--doc/cha-intro-tls.texi192
-rw-r--r--doc/cha-library.texi69
-rw-r--r--doc/cha-preface.texi244
-rw-r--r--doc/cha-programs.texi345
-rw-r--r--doc/cha-support.texi216
-rw-r--r--doc/cha-tls-app.texi2
-rw-r--r--doc/errcodes.c105
-rw-r--r--doc/examples/ex-client1.c2
-rw-r--r--doc/examples/ex-pkcs11-list.c4
-rw-r--r--doc/examples/ex-serv-anon.c2
-rw-r--r--doc/gnutls.texi10
-rw-r--r--doc/latex/Makefile.am105
-rw-r--r--doc/latex/cover.tex.in59
-rw-r--r--doc/latex/fdl.tex563
-rw-r--r--doc/latex/gnutls.bib289
-rw-r--r--doc/latex/gnutls.tex79
-rw-r--r--doc/latex/macros.tex45
-rw-r--r--doc/printlist.c94
-rwxr-xr-xdoc/scripts/mytexi2latex263
-rwxr-xr-xdoc/scripts/sort1.pl21
-rw-r--r--doc/signatures.texi151
31 files changed, 2349 insertions, 1003 deletions
diff --git a/configure.ac b/configure.ac
index 3e8a7ff862..14d15fbeba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -378,6 +378,8 @@ AC_CONFIG_FILES([
doc/credentials/srp/Makefile
doc/credentials/x509/Makefile
doc/cyclo/Makefile
+ doc/latex/Makefile
+ doc/latex/cover.tex
doc/doxygen/Doxyfile
doc/examples/Makefile
doc/manpages/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 183986a460..e54e5a337e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -24,7 +24,7 @@ EXTRA_DIST = TODO certtool.cfg gnutls.ps gnutls.pdf gnutls.html \
doxygen/Doxyfile.in doxygen/Doxyfile.orig texinfo.css \
gnutls-guile.pdf gnutls-guile.html
-SUBDIRS = examples cyclo scripts manpages credentials
+SUBDIRS = examples cyclo scripts manpages credentials latex
if ENABLE_GTK_DOC
SUBDIRS += reference
endif
@@ -35,7 +35,7 @@ gnutls_TEXINFOS = gnutls.texi fdl-1.3.texi lgpl-2.1.texi gpl-3.0.texi \
cha-ciphersuites.texi cha-copying.texi cha-functions.texi \
cha-gtls-app.texi cha-internals.texi cha-intro-tls.texi \
cha-library.texi cha-preface.texi cha-programs.texi \
- cha-tls-app.texi
+ cha-tls-app.texi cha-errors.texi cha-support.texi
# Examples.
gnutls_TEXINFOS += examples/ex-client1.c examples/ex-client2.c \
diff --git a/doc/cha-auth.texi b/doc/cha-auth.texi
index 9336ab5834..9a9bb38598 100644
--- a/doc/cha-auth.texi
+++ b/doc/cha-auth.texi
@@ -35,7 +35,7 @@ are:
@acronym{X.509} certificates contain the public parameters, of a
public key algorithm, and an authority's signature, which proves the
-authenticity of the parameters. @xref{The X.509 trust model}, for
+authenticity of the parameters. See @ref{The X.509 trust model}, for
more information on @acronym{X.509} protocols.
@subsection Authentication Using @acronym{OpenPGP} Keys
@@ -47,9 +47,8 @@ whether a signer is trusted the key is considered trusted or not.
@acronym{GnuTLS}'s @acronym{OpenPGP} authentication implementation is
based on the @xcite{TLSPGP} proposal.
-@xref{The OpenPGP trust model}, for more information about the
-@acronym{OpenPGP} trust model. For a more detailed introduction to
-@acronym{OpenPGP} and @acronym{GnuPG} see @xcite{GPGH}.
+More information on the @acronym{OpenPGP} trusted model is provided in @ref{The OpenPGP trust model}.
+For a more detailed introduction to @acronym{OpenPGP} and @acronym{GnuPG} see @xcite{GPGH}.
@subsection Using Certificate Authentication
@@ -62,8 +61,8 @@ certificate and private key pair. A client may or may not have such a
pair. The certificate and key pair should be loaded, before any
@acronym{TLS} session is initialized, in a certificate credentials
structure. This should be done by using
-@ref{gnutls_certificate_set_x509_key_file} or
-@ref{gnutls_certificate_set_openpgp_key_file} depending on the
+@funcref{gnutls_certificate_set_x509_key_file} or
+@funcref{gnutls_certificate_set_openpgp_key_file} depending on the
certificate type. In the @acronym{X.509} case, the functions will
also accept and use a certificate list that leads to a trusted
authority. The certificate list must be ordered in such way that every
@@ -77,26 +76,26 @@ callback can be set using the functions:
@itemize
-@item @ref{gnutls_certificate_server_set_retrieve_function}
+@item @funcref{gnutls_certificate_server_set_retrieve_function}
-@item @ref{gnutls_certificate_client_set_retrieve_function}
+@item @funcref{gnutls_certificate_client_set_retrieve_function}
@end itemize
Clients and servers that will select certificates using callback
functions should select a certificate according the peer's signature
algorithm preferences. To get those preferences use
-@ref{gnutls_sign_algorithm_get_requested}.
+@funcref{gnutls_sign_algorithm_get_requested}.
Certificate verification is possible by loading the trusted
authorities into the credentials structure by using
-@ref{gnutls_certificate_set_x509_trust_file} or
-@ref{gnutls_certificate_set_openpgp_keyring_file} for openpgp
+@funcref{gnutls_certificate_set_x509_trust_file} or
+@funcref{gnutls_certificate_set_openpgp_keyring_file} for openpgp
keys. Note however that the peer's certificate is not automatically
-verified, you should call @ref{gnutls_certificate_verify_peers2},
+verified, you should call @funcref{gnutls_certificate_verify_peers2},
after a successful handshake, to verify the signatures of the
certificate. An alternative way, which reports a more detailed
-verification output, is to use @ref{gnutls_certificate_get_peers} to
+verification output, is to use @funcref{gnutls_certificate_get_peers} to
obtain the raw certificate of the peer and verify it using the
functions discussed in @ref{The X.509 trust model}.
@@ -211,7 +210,7 @@ and the server using a certificate.
The advantage of @acronym{SRP} authentication, over other proposed
secure password authentication schemes, is that @acronym{SRP} does not
require the server to hold the user's password. This kind of
-protection is similar to the one used traditionally in the @emph{UNIX}
+protection is similar to the one used traditionally in the @acronym{UNIX}
@file{/etc/passwd} file, where the contents of this file did not cause
harm to the system security if they were revealed. The @acronym{SRP}
needs instead of the plain password something called a verifier, which
@@ -223,8 +222,8 @@ the system's users passwords with the @acronym{SRP} password
files. That way @acronym{SRP} authentication could be used for all the
system's users.
-The implementation in @acronym{GnuTLS} is based on paper
-@xcite{TLSSRP}. The supported @acronym{SRP} key exchange methods are:
+The implementation in @acronym{GnuTLS} is based on @xcite{TLSSRP}.
+The supported @acronym{SRP} key exchange methods are:
@table @code
@@ -243,9 +242,9 @@ authenticated using a certificate with RSA parameters.
If clients supporting @acronym{SRP} know the username and password
before the connection, should initialize the client credentials and
-call the function @ref{gnutls_srp_set_client_credentials}.
+call the function @funcref{gnutls_srp_set_client_credentials}.
Alternatively they could specify a callback function by using the
-function @ref{gnutls_srp_set_client_credentials_function}. This has
+function @funcref{gnutls_srp_set_client_credentials_function}. This has
the advantage that allows probing the server for @acronym{SRP}
support. In that case the callback function will be called twice per
handshake. The first time is before the ciphersuite is negotiated,
@@ -260,27 +259,27 @@ In server side the default behaviour of @acronym{GnuTLS} is to read
the usernames and @acronym{SRP} verifiers from password files. These
password files are the ones used by the @emph{Stanford srp libraries}
and can be specified using the
-@ref{gnutls_srp_set_server_credentials_file}. If a different
+@funcref{gnutls_srp_set_server_credentials_file}. If a different
password file format is to be used, then the function
-@ref{gnutls_srp_set_server_credentials_function}, should be called,
+@funcref{gnutls_srp_set_server_credentials_function}, should be called,
in order to set an appropriate callback.
Some helper functions such as
@itemize
-@item @ref{gnutls_srp_verifier}
+@item @funcref{gnutls_srp_verifier}
-@item @ref{gnutls_srp_base64_encode}
+@item @funcref{gnutls_srp_base64_encode}
-@item @ref{gnutls_srp_base64_decode}
+@item @funcref{gnutls_srp_base64_decode}
@end itemize
are included in @acronym{GnuTLS}, and can be used to generate and
maintain @acronym{SRP} verifiers and password files. A program to
manipulate the required parameters for @acronym{SRP} authentication is
-also included. @xref{srptool}, for more information.
+also included. See @ref{srptool}, for more information.
@node Authentication using PSK
@@ -292,8 +291,8 @@ usernames and binary keys. This protocol avoids making use of public
key infrastructure and expensive calculations, thus it is suitable for
constraint clients.
-The implementation in @acronym{GnuTLS} is based on paper
-@xcite{TLSPSK}. The supported @acronym{PSK} key exchange methods are:
+The implementation in @acronym{GnuTLS} is based on @xcite{TLSPSK}.
+The supported @acronym{PSK} key exchange methods are:
@table @code
@@ -308,9 +307,9 @@ exchange. This method offers perfect forward secrecy.
Clients supporting @acronym{PSK} should supply the username and key
before the connection to the client credentials by calling the
-function @ref{gnutls_psk_set_client_credentials}. Alternatively they
+function @funcref{gnutls_psk_set_client_credentials}. Alternatively they
could specify a callback function by using the function
-@ref{gnutls_psk_set_client_credentials_function}. This has the
+@funcref{gnutls_psk_set_client_credentials_function}. This has the
advantage that the callback will be called only if @acronym{PSK} has
been negotiated.
@@ -318,24 +317,24 @@ In server side the default behaviour of @acronym{GnuTLS} is to read
the usernames and @acronym{PSK} keys from a password file. The
password file should contain usernames and keys in hexadecimal
format. The name of the password file can be stored to the credentials
-structure by calling @ref{gnutls_psk_set_server_credentials_file}. If
+structure by calling @funcref{gnutls_psk_set_server_credentials_file}. If
a different password file format is to be used, then the function
-@ref{gnutls_psk_set_server_credentials_function}, should be used
+@funcref{gnutls_psk_set_server_credentials_function}, should be used
instead.
The server can help the client chose a suitable username and password,
by sending a hint. In the server, specify the hint by calling
-@ref{gnutls_psk_set_server_credentials_hint}. The client can retrieve
+@funcref{gnutls_psk_set_server_credentials_hint}. The client can retrieve
the hint, for example in the callback function, using
-@ref{gnutls_psk_client_get_hint}.
+@funcref{gnutls_psk_client_get_hint}.
Some helper functions such as:
@itemize
-@item @ref{gnutls_hex_encode}
+@item @funcref{gnutls_hex_encode}
-@item @ref{gnutls_hex_decode}
+@item @funcref{gnutls_hex_decode}
@end itemize
@@ -349,41 +348,38 @@ maintain @acronym{PSK} keys.
In @acronym{GnuTLS} every key exchange method is associated with a
credentials type. So in order to enable to enable a specific method,
the corresponding credentials type should be initialized and set using
-@ref{gnutls_credentials_set}. A mapping is shown below.
+@funcref{gnutls_credentials_set}. A mapping is shown below.
Key exchange algorithms and the corresponding credential types:
-@multitable @columnfractions .3 .3 .3
+@multitable @columnfractions .4 .25 .25
@headitem Key exchange @tab Client credentials @tab Server credentials
-@item @code{KX_RSA}
-@item @code{KX_DHE_RSA}
-@item @code{KX_DHE_DSS}
-@item @code{KX_ECDHE_RSA}
-@item @code{KX_ECDHE_ECDSA}
-@item @code{KX_RSA_EXPORT}
+@item @code{KX_RSA},
+@code{KX_DHE_RSA},
+@code{KX_DHE_DSS},
+@code{KX_ECDHE_RSA},
+@code{KX_ECDHE_ECDSA},
+@code{KX_RSA_EXPORT}
@tab @code{CRD_CERTIFICATE}
@tab @code{CRD_CERTIFICATE}
-@item @code{KX_SRP_RSA}
+@item @code{KX_SRP_RSA}, @code{KX_SRP_DSS}
@tab @code{CRD_SRP}
-@tab @code{CRD_SRP}
-@item @code{KX_SRP_DSS}
-@tab
@tab @code{CRD_CERTIFICATE}
@item @code{KX_SRP}
@tab @code{CRD_SRP}
@tab @code{CRD_SRP}
-@item @code{KX_ANON_DH}
-@item @code{KX_ANON_ECDH}
+@item @code{KX_ANON_DH},
+@code{KX_ANON_ECDH}
@tab @code{CRD_ANON}
@tab @code{CRD_ANON}
-@item @code{KX_PSK}
-@item @code{KX_DHE_PSK}
+@item @code{KX_PSK},
+@code{KX_DHE_PSK}, @code{KX_ECDHE_PSK}
@tab @code{CRD_PSK}
@tab @code{CRD_PSK}
@@ -396,15 +392,15 @@ Several parameters such as the ones used for Diffie-Hellman
authentication are stored within the credentials structures, so all
sessions can access them. Those parameters are stored in structures
such as @code{gnutls_dh_params_t} and @code{gnutls_rsa_params_t}, and
-functions like @ref{gnutls_certificate_set_dh_params} and
-@ref{gnutls_certificate_set_rsa_export_params} can be used to
+functions like @funcref{gnutls_certificate_set_dh_params} and
+@funcref{gnutls_certificate_set_rsa_export_params} can be used to
associate those parameters with the given credentials structure.
Since those parameters need to be renewed from time to time and a
global structure such as the credentials, may not be easy to modify
since it is accessible by all sessions, an alternative interface is
available using a callback function. This can be set using the
-@ref{gnutls_certificate_set_params_function}. An example is shown
+@funcref{gnutls_certificate_set_params_function}. An example is shown
below.
@example
diff --git a/doc/cha-bib.texi b/doc/cha-bib.texi
index a197a8ff7a..893819c36a 100644
--- a/doc/cha-bib.texi
+++ b/doc/cha-bib.texi
@@ -31,6 +31,14 @@ January 1999, Available from
Tim Dierks and Eric Rescorla, "The TLS Protocol Version 1.1", Match
2006, Available from @url{http://www.ietf.org/rfc/rfc4346.txt}.
+@item @anchor{RFC4347}[RFC4347]
+Eric Rescorla and Nagendra Modadugu, "Datagram Transport Layer Security", April
+2006, Available from @url{http://www.ietf.org/rfc/rfc4347.txt}.
+
+@item @anchor{RFC5246}[RFC5246]
+Tim Dierks and Eric Rescorla, "The TLS Protocol Version 1.2", August
+2008, Available from @url{http://www.ietf.org/rfc/rfc5246.txt}.
+
@item @anchor{RFC2440}[RFC2440]
Jon Callas, Lutz Donnerhacke, Hal Finney and Rodney Thayer, "OpenPGP
Message Format", November 1998, Available from
diff --git a/doc/cha-cert-auth.texi b/doc/cha-cert-auth.texi
index b51a3edacc..2342618d2d 100644
--- a/doc/cha-cert-auth.texi
+++ b/doc/cha-cert-auth.texi
@@ -1,12 +1,11 @@
@node More on certificate authentication
@chapter More on Certificate Authentication
-@anchor{Certificate Authentication}
@cindex Certificate authentication
@menu
* The X.509 trust model::
* The OpenPGP trust model::
-* PKCS #11 tokens::
+* Hardware tokens::
* Abstract key types::
* Digital signatures::
@end menu
@@ -25,15 +24,14 @@ certificates as well, following a hierarchical model.
One needs to trust one or more CAs for his secure communications. In
that case only the certificates issued by the trusted authorities are
-acceptable. See the figure above for a typical example. The API for
-handling @acronym{X.509} certificates is described at section
-@ref{sec:x509api}. Some examples are listed below.
+acceptable. The framework is illustrated on the figure above.
+Detailed examples are listed below.
@menu
* X.509 certificates::
* Verifying X.509 certificate paths::
-* PKCS #10 certificate requests::
-* PKCS #12 structures::
+* Certificate requests::
+* PKCS 12 structures::
@end menu
@node X.509 certificates
@@ -67,7 +65,7 @@ The extensions are fields only present in version 3 certificates.
The certificate's @emph{subject or issuer name} is not just a single
string. It is a Distinguished name and in the @acronym{ASN.1}
-notation is a sequence of several object IDs with their corresponding
+notation is a sequence of several object identifiers with their corresponding
values. Some of available OIDs to be used in an @acronym{X.509}
distinguished name are defined in @file{gnutls/x509.h}.
@@ -130,6 +128,7 @@ section @ref{ex:x509-info}.
@node Verifying X.509 certificate paths
@subsection Verifying @acronym{X.509} Certificate Paths
@cindex Verifying certificate paths
+@tindex gnutls_certificate_verify_flags
Verifying certificate paths is important in @acronym{X.509}
authentication. For this purpose the following functions are
@@ -137,29 +136,29 @@ provided.
@table @code
-@item @ref{gnutls_x509_trust_list_init}:
+@item @funcref{gnutls_x509_trust_list_init}:
A function to initialize a list that will hold trusted
certificate authorities and certificate revocation lists.
-@item @ref{gnutls_x509_trust_list_deinit}:
+@item @funcref{gnutls_x509_trust_list_deinit}:
Deinitializes the list.
-@item @ref{gnutls_x509_trust_list_add_cas}:
+@item @funcref{gnutls_x509_trust_list_add_cas}:
Adds certificate authorities to the list.
-@item @ref{gnutls_x509_trust_list_add_named_crt}:
+@item @funcref{gnutls_x509_trust_list_add_named_crt}:
Adds trusted certificates for an entity identified
by a name.
-@item @ref{gnutls_x509_trust_list_add_crls}:
+@item @funcref{gnutls_x509_trust_list_add_crls}:
Adds certificate revocation lists.
-@item @ref{gnutls_x509_trust_list_verify_crt}:
+@item @funcref{gnutls_x509_trust_list_verify_crt}:
Verifies a certificate chain using the previously setup trusted
list. A callback can be specified that will provide information
about the verification procedure (and detailed reasons of failure).
-@item @ref{gnutls_x509_trust_list_verify_named_crt}:
+@item @funcref{gnutls_x509_trust_list_verify_named_crt}:
Does verification of the certificate by looking for a matching one
in the named certificates. A callback can be specified that will provide information
about the verification procedure (and detailed reasons of failure).
@@ -171,7 +170,7 @@ authorities and certificate revocation lists, and output
a bitwise OR of elements of the @code{gnutls_certificate_status_t}
enumeration. It is also possible to have a set of certificates that
are trusted for a particular server but not to authorize other certificates.
-This purpose is served by the functions @ref{gnutls_x509_trust_list_add_named_crt} and @ref{gnutls_x509_trust_list_verify_named_crt}.
+This purpose is served by the functions @funcref{gnutls_x509_trust_list_add_named_crt} and @funcref{gnutls_x509_trust_list_verify_named_crt}.
A detailed description of these elements can be found
in figure below. An example of these functions in use can be found
in @ref{ex:verify2}.
@@ -179,9 +178,9 @@ in @ref{ex:verify2}.
When operating in the context of a TLS session, the trusted certificate
authority list has been set via the
-@ref{gnutls_certificate_set_x509_trust_file} and @ref{gnutls_certificate_set_x509_crl_file},
+@funcref{gnutls_certificate_set_x509_trust_file} and @funcref{gnutls_certificate_set_x509_crl_file},
thus it is not required to setup a trusted list as above.
-Convenience functions such as @ref{gnutls_certificate_verify_peers2}
+Convenience functions such as @funcref{gnutls_certificate_verify_peers2}
are equivalent and will verify the peer's certificate chain
in a TLS session.
@@ -203,7 +202,6 @@ The certificate's signer was not a CA. This may happen if
this was a version 1 certificate, which is common with some CAs, or
a version 3 certificate without the basic constrains extension.
-@anchor{GNUTLS_CERT_INSECURE_ALGORITHM}
@item GNUTLS_CERT_INSECURE_ALGORITHM:
The certificate was signed using an insecure algorithm such as MD2 or
MD5. These algorithms have been broken and should not be trusted.
@@ -211,16 +209,14 @@ MD5. These algorithms have been broken and should not be trusted.
@end table
There is also to possibility to pass some input to the verification
-functions in the form of flags. For @ref{gnutls_x509_trust_list_verify_crt} the
+functions in the form of flags. For @funcref{gnutls_x509_trust_list_verify_crt} the
flags are passed straightforward, but
-@ref{gnutls_certificate_verify_peers2} depends on the flags set by
-calling @ref{gnutls_certificate_set_verify_flags}. All the available
+@funcref{gnutls_certificate_verify_peers2} depends on the flags set by
+calling @funcref{gnutls_certificate_set_verify_flags}. All the available
flags are part of the enumeration
-@ref{gnutls_certificate_verify_flags} and are explained in the table
+@code{gnutls_certificate_verify_flags} and are explained in the table
below.
-@anchor{gnutls_certificate_verify_flags}
-@tindex gnutls_certificate_verify_flags
@table @code
@item GNUTLS_VERIFY_DISABLE_CA_SIGN:
If set a signer does not have to be a certificate authority. This
@@ -267,7 +263,7 @@ about the peer's identity. It is required to verify if the
certificate's owner is the one you expect. For more information
consult @xcite{RFC2818} and section @ref{ex:verify} for an example.
-@node PKCS #10 certificate requests
+@node Certificate requests
@subsection @acronym{PKCS} #10 Certificate Requests
@cindex Certificate requests
@cindex @acronym{PKCS} #10
@@ -277,13 +273,13 @@ an applicant of a certificate service. It usually contains a private
key, a distinguished name and secondary data such as a challenge
password. @acronym{GnuTLS} supports the requests defined in
@acronym{PKCS} #10 @xcite{RFC2986}. Other certificate request's format
-such as PKIX's @xcite{RFC4211} are not currently supported.
+are not currently supported.
In @acronym{GnuTLS} the @acronym{PKCS} #10 structures are handled
using the @code{gnutls_x509_crq_t} type. An example of a certificate
request generation can be found at section @ref{ex:crq}.
-@node PKCS #12 structures
+@node PKCS 12 structures
@subsection @acronym{PKCS} #12 Structures
@cindex @acronym{PKCS} #12
@@ -349,7 +345,7 @@ GPGME (@url{http://www.gnupg.org/related_software/gpgme/}) is
recommended.
There is one verification function in @acronym{GnuTLS}, the
-@ref{gnutls_openpgp_crt_verify_ring}. This checks an
+@funcref{gnutls_openpgp_crt_verify_ring}. This checks an
@acronym{OpenPGP} key against a given set of public keys (keyring) and
returns the key status. The key verification status is the same as in
@acronym{X.509} certificates, although the meaning and interpretation
@@ -376,14 +372,15 @@ MD5. These algorithms have been broken and should not be trusted.
@end table
-@node PKCS #11 tokens
-@section @acronym{PKCS #11} tokens
-@anchor{sec:pkcs11}
-@cindex @acronym{PKCS #11} tokens
+@node Hardware tokens
+@section Hardware tokens
+@cindex PKCS #11 tokens
+@cindex Hardware tokens
@subsection Introduction
-This section copes with the @acronym{PKCS #11} @xcite{PKCS11} support in @acronym{GnuTLS}.
-@acronym{PKCS #11} is plugin API allowing applications to access cryptographic
+This section copes with hardware token support in @acronym{GnuTLS} using
+@acronym{PKCS} #11 @xcite{PKCS11}.
+@acronym{PKCS} #11 is plugin API allowing applications to access cryptographic
operations on a token, as well as to objects residing on the token. A token can
be a real hardware token such as a smart card, or it can be a software component
such as @acronym{Gnome Keyring}. The objects residing on such token can be
@@ -398,7 +395,7 @@ shared cryptographic keys and certificates in a uniform way, as in the following
@center @image{pkcs11-vision,8cm}
@subsection Initialization
-To allow all the @acronym{GnuTLS} applications to access @acronym{PKCS #11} tokens
+To allow all the @acronym{GnuTLS} applications to access @acronym{PKCS} #11 tokens
it is adviceable to use @code{/etc/pkcs11/modules/mymodule.conf}. This file has the following
format:
@@ -413,26 +410,26 @@ the user to insert the token. All the initialization functions are below.
@itemize
-@item @ref{gnutls_pkcs11_init}: Global initialization
+@item @funcref{gnutls_pkcs11_init}: Global initialization
-@item @ref{gnutls_pkcs11_deinit}: Global deinitialization
+@item @funcref{gnutls_pkcs11_deinit}: Global deinitialization
-@item @ref{gnutls_pkcs11_set_token_function}: Sets the token insertion function
+@item @funcref{gnutls_pkcs11_set_token_function}: Sets the token insertion function
-@item @ref{gnutls_pkcs11_set_pin_function}: Sets the PIN request function
+@item @funcref{gnutls_pkcs11_set_pin_function}: Sets the PIN request function
-@item @ref{gnutls_pkcs11_add_provider}: Adds an additional @acronym{PKCS #11} provider
+@item @funcref{gnutls_pkcs11_add_provider}: Adds an additional @acronym{PKCS} #11 provider
@end itemize
-Note that due to limitations of @acronym{PKCS #11} there are issues when multiple libraries
+Note that due to limitations of @acronym{PKCS} #11 there are issues when multiple libraries
are sharing a module. To avoid this problem GnuTLS uses p11-kit@footnote{http://p11-glue.freedesktop.org/}
that provides a middleware to control access to resources over the
multiple users.
@subsection Reading Objects
-All @acronym{PKCS #11} objects are referenced by @acronym{GnuTLS} functions by
+All @acronym{PKCS} #11 objects are referenced by @acronym{GnuTLS} functions by
URLs as described in @code{draft-pechanec-pkcs11uri-03}. For example a public
key on a smart card may be referenced as:
@@ -451,25 +448,25 @@ pkcs11:token=Nikos;serial=307521161601031;model=PKCS%2315;manufacturer=EnterSafe
Objects can be accessed with the following functions
@itemize
-@item @ref{gnutls_pkcs11_obj_init}: Initializes an object
+@item @funcref{gnutls_pkcs11_obj_init}: Initializes an object
-@item @ref{gnutls_pkcs11_obj_import_url}: To import an object from a url
+@item @funcref{gnutls_pkcs11_obj_import_url}: To import an object from a url
-@item @ref{gnutls_pkcs11_obj_export_url}: To export the URL of the object
+@item @funcref{gnutls_pkcs11_obj_export_url}: To export the URL of the object
-@item @ref{gnutls_pkcs11_obj_deinit}: To deinitialize an object
+@item @funcref{gnutls_pkcs11_obj_deinit}: To deinitialize an object
-@item @ref{gnutls_pkcs11_obj_export}: To export data associated with object
+@item @funcref{gnutls_pkcs11_obj_export}: To export data associated with object
-@item @ref{gnutls_pkcs11_obj_get_info}: To obtain information about an object
+@item @funcref{gnutls_pkcs11_obj_get_info}: To obtain information about an object
-@item @ref{gnutls_pkcs11_obj_list_import_url}: To mass load of objects
+@item @funcref{gnutls_pkcs11_obj_list_import_url}: To mass load of objects
-@item @ref{gnutls_x509_crt_import_pkcs11}: Import a certificate object
+@item @funcref{gnutls_x509_crt_import_pkcs11}: Import a certificate object
-@item @ref{gnutls_x509_crt_import_pkcs11_url}: Helper function to directly import a URL into a certificate
+@item @funcref{gnutls_x509_crt_import_pkcs11_url}: Helper function to directly import a URL into a certificate
-@item @ref{gnutls_x509_crt_list_import_pkcs11}: Mass import of certificates
+@item @funcref{gnutls_x509_crt_list_import_pkcs11}: Mass import of certificates
@end itemize
@@ -477,27 +474,27 @@ Objects can be accessed with the following functions
Functions that relate to token handling are shown below
@itemize
-@item @ref{gnutls_pkcs11_token_init}: Initializes a token
+@item @funcref{gnutls_pkcs11_token_init}: Initializes a token
-@item @ref{gnutls_pkcs11_token_set_pin}: Sets the token user's PIN
+@item @funcref{gnutls_pkcs11_token_set_pin}: Sets the token user's PIN
-@item @ref{gnutls_pkcs11_token_get_url}: Returns the URL of a token
+@item @funcref{gnutls_pkcs11_token_get_url}: Returns the URL of a token
-@item @ref{gnutls_pkcs11_token_get_info}: Obtain information about a token
+@item @funcref{gnutls_pkcs11_token_get_info}: Obtain information about a token
-@item @ref{gnutls_pkcs11_token_get_flags}: Returns flags about a token (i.e. hardware or software)
+@item @funcref{gnutls_pkcs11_token_get_flags}: Returns flags about a token (i.e. hardware or software)
@end itemize
The following example will list all tokens.
-@verbatim
+@example
int i;
char* url;
gnutls_global_init();
for (i=0;;i++)
- {
+ @{
ret = gnutls_pkcs11_token_get_url(i, &url);
if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
break;
@@ -507,9 +504,9 @@ for (i=0;;i++)
fprintf(stdout, "Token[%d]: URL: %s\n", i, url);
gnutls_free(url);
- }
+ @}
gnutls_global_deinit();
-@end verbatim
+@end example
The next one will list all certificates in a token, that have a corresponding
@@ -523,68 +520,68 @@ to a token. This can be achieved with the following functions
@itemize
-@item @ref{gnutls_pkcs11_delete_url}: To delete an object
+@item @funcref{gnutls_pkcs11_delete_url}: To delete an object
-@item @ref{gnutls_pkcs11_copy_x509_privkey}: To copy a private key to a token
+@item @funcref{gnutls_pkcs11_copy_x509_privkey}: To copy a private key to a token
-@item @ref{gnutls_pkcs11_copy_x509_crt}: To copy a certificate to a token
+@item @funcref{gnutls_pkcs11_copy_x509_crt}: To copy a certificate to a token
@end itemize
-@subsection Using a @acronym{PKCS #11} token with TLS
+@subsection Using a @acronym{PKCS} #11 token with TLS
-It is possible to use a @acronym{PKCS #11} token to a TLS
+It is possible to use a @acronym{PKCS} #11 token to a TLS
session, as shown in @ref{ex:pkcs11-client}. In addition
the following functions can be used to load PKCS #11 key and
certificates.
@itemize
-@item @ref{gnutls_certificate_set_x509_trust_file}: If given a PKCS #11 URL will load the trusted certificates from it.
+@item @funcref{gnutls_certificate_set_x509_trust_file}: If given a PKCS #11 URL will load the trusted certificates from it.
-@item @ref{gnutls_certificate_set_x509_key_file}: Will also load PKCS #11 URLs for keys and certificates.
+@item @funcref{gnutls_certificate_set_x509_key_file}: Will also load PKCS #11 URLs for keys and certificates.
@end itemize
@node Abstract key types
@section Abstract key types
-@anchor{sec:abstract}
@cindex Abstract types
Since there are many forms of a public or private keys supported by @acronym{GnuTLS} such as
-@acronym{X.509}, @acronym{OpenPGP}, or @acronym{PKCS #11} it is desirable to allow common operations
+@acronym{X.509}, @acronym{OpenPGP}, or @acronym{PKCS} #11 it is desirable to allow common operations
on them. For these reasons the abstract @code{gnutls_privkey_t} and @code{gnutls_pubkey_t} were
introduced in @code{gnutls/abstract.h} header. Those types are initialized using a specific type of key and then can be used to
perform operations in an abstract way. For example in order for someone to sign an X.509 certificate
with a key that resides in a smart he has to follow the steps below:
-@verbatim
+@example
#inlude <gnutls/abstract.h>
#inlude <gnutls/pkcs11.h>
void sign_cert( gnutls_x509_crt_t to_be_signed)
-{
+@{
gnutls_pkcs11_privkey_t ca_key;
gnutls_x509_crt_t ca_cert;
gnutls_privkey_t abs_key;
- /* load the PKCS #11 key and certificates */
- gnutls_pkcs11_privkey_init(&ca_key);
- gnutls_pkcs11_privkey_import_url(ca_key, key_url);
+ /* load the PKCS #11 key and certificates */
+ gnutls_pkcs11_privkey_init(&ca_key);
+ gnutls_pkcs11_privkey_import_url(ca_key, key_url);
- gnutls_x509_crt_init(&ca_cert);
- gnutls_x509_crt_import_pkcs11_url(&ca_cert, cert_url);
+ gnutls_x509_crt_init(&ca_cert);
+ gnutls_x509_crt_import_pkcs11_url(&ca_cert, cert_url);
- /* initialize the abstract key */
- gnutls_privkey_init(&abs_key);
- gnutls_privkey_import_pkcs11(abs_key, ca_key);
+ /* initialize the abstract key */
+ gnutls_privkey_init(&abs_key);
+ gnutls_privkey_import_pkcs11(abs_key, ca_key);
- /* sign the certificate to be signed */
- gnutls_x509_crt_privkey_sign(to_be_signed, ca_cert, ca_key, GNUTLS_DIG_SHA1, 0);
-}
-@end verbatim
+ /* sign the certificate to be signed */
+ gnutls_x509_crt_privkey_sign(to_be_signed, ca_cert, ca_key,
+ GNUTLS_DIG_SHA1, 0);
+@}
+@end example
@node Digital signatures
@@ -655,8 +652,8 @@ for creating them.
@subsection Trading Security for Interoperability
If you connect to a server and use GnuTLS' functions to verify the
-certificate chain, and get a @ref{GNUTLS_CERT_INSECURE_ALGORITHM}
-validation error (@pxref{Verifying X.509 certificate paths}), it means
+certificate chain, and get a @code{GNUTLS_CERT_INSECURE_ALGORITHM}
+validation error (see @ref{Verifying X.509 certificate paths}), it means
that somewhere in the certificate chain there is a certificate signed
using @code{RSA-MD2} or @code{RSA-MD5}. These two digital signature
algorithms are considered broken, so GnuTLS fail when attempting to
@@ -673,22 +670,22 @@ colliding signatures (collision resistance); you cannot generate a
certificate that has the same signature as an already existing
signature (2nd preimage resistance).
-If you are using @ref{gnutls_certificate_verify_peers2} to verify the
+If you are using @funcref{gnutls_certificate_verify_peers2} to verify the
certificate chain, you can call
-@ref{gnutls_certificate_set_verify_flags} with the
+@funcref{gnutls_certificate_set_verify_flags} with the
@code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2} or
@code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5} flag, as in:
-@example
+@smallexample
gnutls_certificate_set_verify_flags (x509cred,
GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5);
-@end example
+@end smallexample
This will tell the verifier algorithm to enable @code{RSA-MD5} when
verifying the certificates.
-If you are using @ref{gnutls_x509_crt_verify} or
-@ref{gnutls_x509_crt_list_verify}, you can pass the
+If you are using @funcref{gnutls_x509_crt_verify} or
+@funcref{gnutls_x509_crt_list_verify}, you can pass the
@code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5} parameter directly in the
@code{flags} parameter.
@@ -696,10 +693,10 @@ If you are using these flags, it may also be a good idea to warn the
user when verification failure occur for this reason. The simplest is
to not use the flags by default, and only fall back to using them
after warning the user. If you wish to inspect the certificate chain
-yourself, you can use @ref{gnutls_certificate_get_peers} to extract
+yourself, you can use @funcref{gnutls_certificate_get_peers} to extract
the raw server's certificate chain, then use
-@ref{gnutls_x509_crt_import} to parse each of the certificates, and
-then use @ref{gnutls_x509_crt_get_signature_algorithm} to find out the
+@funcref{gnutls_x509_crt_import} to parse each of the certificates, and
+then use @funcref{gnutls_x509_crt_get_signature_algorithm} to find out the
signing algorithm used for each certificate. If any of the
intermediary certificates are using @code{GNUTLS_SIGN_RSA_MD2} or
@code{GNUTLS_SIGN_RSA_MD5}, you could present a warning.
diff --git a/doc/cha-ciphersuites.texi b/doc/cha-ciphersuites.texi
index df908658c7..916c2abae1 100644
--- a/doc/cha-ciphersuites.texi
+++ b/doc/cha-ciphersuites.texi
@@ -5,37 +5,3 @@
@include algorithms.texi
-Some additional information regarding some of the algorithms:
-
-@table @code
-@item RSA
-RSA is public key cryptosystem designed by Ronald Rivest, Adi Shamir
-and Leonard Adleman. It can be used with any hash functions.
-
-@item DSA
-DSA is the USA's Digital Signature Standard. It may use the SHA
-family of hash algorithms.
-
-@item ECDSA
-ECDSA is the elliptic curve counter-part of DSA.
-
-@item MD2
-MD2 is a cryptographic hash algorithm designed by Ron Rivest. It is
-optimized for 8-bit processors. Outputs 128 bits of data. There are
-several known weaknesses of this algorithm and it should not be used.
-
-@item MD5
-MD5 is a cryptographic hash algorithm designed by Ron Rivest. Outputs
-128 bits of data. It is considered to be broken.
-
-@item SHA-1
-SHA is a cryptographic hash algorithm designed by NSA. Outputs 160
-bits of data. It is also considered to be broken, though no practical
-attacks have been found.
-
-@item RMD160
-RIPEMD is a cryptographic hash algorithm developed in the framework of
-the EU project RIPE. Outputs 160 bits of data.
-
-@end table
-
diff --git a/doc/cha-errors.texi b/doc/cha-errors.texi
new file mode 100644
index 0000000000..84d23361eb
--- /dev/null
+++ b/doc/cha-errors.texi
@@ -0,0 +1,11 @@
+@node Error codes
+@appendix Error Codes and Descriptions
+@cindex Error codes
+
+The error codes used throughout the library are described below. The
+return code @code{GNUTLS_E_SUCCESS} indicate successful operation, and
+is guaranteed to have the value 0, so you can use it in logical
+expressions.
+
+@include error_codes.texi
+
diff --git a/doc/cha-functions.texi b/doc/cha-functions.texi
index a818800db2..56e36fca01 100644
--- a/doc/cha-functions.texi
+++ b/doc/cha-functions.texi
@@ -4,11 +4,9 @@
@menu
* Core functions::
-* X.509 certificate functions::
+* X509 certificate functions::
* GnuTLS-extra functions::
* OpenPGP functions::
-* TLS Inner Application (TLS/IA) functions::
-* Error codes and descriptions::
@end menu
@node Core functions
@@ -19,9 +17,8 @@ The prototypes for the following functions lie in
@include gnutls-api.texi
-@node X.509 certificate functions
+@node X509 certificate functions
@section @acronym{X.509} Certificate Functions
-@anchor{sec:x509api}
@cindex @acronym{X.509} Functions
The following functions are to be used for @acronym{X.509} certificate handling.
@@ -42,7 +39,6 @@ lie in @file{gnutls/extra.h}.
@node OpenPGP functions
@section @acronym{OpenPGP} Functions
@cindex @acronym{OpenPGP} functions
-@anchor{sec:openpgpapi}
The following functions are to be used for @acronym{OpenPGP}
certificate handling. Their prototypes lie in
@@ -50,69 +46,3 @@ certificate handling. Their prototypes lie in
@include pgp-api.texi
-@node TLS Inner Application (TLS/IA) functions
-@section @acronym{TLS} Inner Application (@acronym{TLS/IA}) Functions
-@cindex @acronym{TLS} Inner Application (@acronym{TLS/IA}) functions
-@cindex Inner Application (@acronym{TLS/IA}) functions
-
-The following functions are used for @acronym{TLS} Inner Application
-(@acronym{TLS/IA}). Their prototypes lie in @file{gnutls/extra.h}.
-You need to link with @file{libgnutls-extra} to be able to use these
-functions (@pxref{GnuTLS-extra functions}).
-
-The typical control flow in an TLS/IA client (that would not require
-an Application Phase for resumed sessions) would be similar to the
-following:
-
-@example
-int client_avp (gnuls_session_t *session, void *ptr,
- const char *last, size_t lastlen,
- char **new, size_t *newlen)
-@{
-...
-@}
-...
-int main ()
-@{
- gnutls_ia_client_credentials_t iacred;
-...
- gnutls_init (&session, GNUTLS_CLIENT);
-...
- /* Enable TLS/IA. */
- gnutls_ia_allocate_client_credentials(&iacred);
- gnutls_ia_set_client_avp_function(iacred, client_avp);
- gnutls_credentials_set (session, GNUTLS_CRD_IA, iacred);
-...
- ret = gnutls_handshake (session);
- // Error handling...
-...
- if (gnutls_ia_handshake_p (session))
- @{
- ret = gnutls_ia_handshake (session);
- // Error handling...
-...
-@end example
-
-See below for detailed descriptions of all the functions used above.
-
-The function @code{client_avp} would have to be implemented by your
-application. The function is responsible for handling the AVP data.
-See @code{gnutls_ia_set_client_avp_function} below for more
-information on how that function should be implemented.
-
-The control flow in a typical server is similar to the above, use
-@code{gnutls_ia_server_credentials_t} instead of
-@code{gnutls_ia_client_credentials_t}, and replace the call to the
-client functions with the corresponding server functions.
-
-@node Error codes and descriptions
-@section Error Codes and Descriptions
-@anchor{Error Codes}
-@cindex Error codes
-
-The error codes used throughout the library are described below. The
-return code @code{GNUTLS_E_SUCCESS} indicate successful operation, and
-is guaranteed to have the value 0, so you can use it in logical
-expressions.
-
-@include error_codes.texi
diff --git a/doc/cha-gtls-app.texi b/doc/cha-gtls-app.texi
index c61d3f5c9f..632b70ea6a 100644
--- a/doc/cha-gtls-app.texi
+++ b/doc/cha-gtls-app.texi
@@ -42,13 +42,13 @@ programs.
@subsection Initialization
GnuTLS must be initialized before it can be used. The library is
-initialized by calling @ref{gnutls_global_init}. The resources
+initialized by calling @funcref{gnutls_global_init}. The resources
allocated by the initialization process can be released if the
application no longer has a need to call GnuTLS functions, this is
-done by calling @ref{gnutls_global_deinit}.
+done by calling @funcref{gnutls_global_deinit}.
The extra functionality of the @acronym{GnuTLS-extra} library is
-available after calling @ref{gnutls_global_init_extra}.
+available after calling @funcref{gnutls_global_init_extra}.
In order to take advantage of the internationalisation features in
GnuTLS, such as translated error messages, the application must set
@@ -62,21 +62,21 @@ indeed one which fits all requirements. Even with binary
compatibility new features may have been introduced but due to problem
with the dynamic linker an old version is actually used. So you may
want to check that the version is okay right after program startup.
-See the function @ref{gnutls_check_version}.
+See the function @funcref{gnutls_check_version}.
@node Debugging and auditing
@subsection Debugging and auditing
In many cases things may not go as expected and further information,
to assist debugging, from @acronym{GnuTLS} is desired.
-Those are the cases where the @ref{gnutls_global_set_log_level} and
-@ref{gnutls_global_set_log_function} are to be used. Those will print
+Those are the cases where the @funcref{gnutls_global_set_log_level} and
+@funcref{gnutls_global_set_log_function} are to be used. Those will print
verbose information on the @acronym{GnuTLS} functions internal flow.
When debugging is not required, important issues, such as detected
attacks on the protocol still need to be logged. This is provided
-by @ref{gnutls_global_set_audit_log_function}, that uses a logging
+by @funcref{gnutls_global_set_audit_log_function}, that uses a logging
function that accepts the detected error message and the corresponding
TLS session. The session information might be used to derive IP addresses
or other information about the peer involved.
@@ -99,9 +99,9 @@ to be added to the compiler invocation at compile time are output by
the @option{--cflags} option to @command{pkg-config gnutls}. The
following example shows how it can be used at the command line:
-@example
+@smallexample
gcc -c foo.c `pkg-config gnutls --cflags`
-@end example
+@end smallexample
Adding the output of @samp{pkg-config gnutls --cflags} to the
compilers command line will ensure that the compiler can find the
@@ -117,16 +117,16 @@ required to link the program with the libarary (for instance, the
@samp{-ltasn1} option). The example shows how to link @file{foo.o}
with the library to a program @command{foo}.
-@example
+@smallexample
gcc -o foo foo.o `pkg-config gnutls --libs`
-@end example
+@end smallexample
Of course you can also combine both examples to a single command by
specifying both options to @command{pkg-config}:
-@example
+@smallexample
gcc -o foo foo.c `pkg-config gnutls --cflags --libs`
-@end example
+@end smallexample
@node Client examples
@@ -145,7 +145,7 @@ implemented by another example.
* Verifying peer's certificate::
* Using a callback to select the certificate to use::
* Verifying a certificate::
-* Client using a PKCS #11 token with TLS::
+* Client using a PKCS 11 token with TLS::
* Client with Resume capability example::
* Simple client example with SRP authentication::
* Simple client example in C++::
@@ -192,7 +192,7 @@ Most of the times it is desirable to know the security properties of
the current established session. This includes the underlying ciphers
and the protocols involved. That is the purpose of the following
function. Note that this function will print meaningful values only
-if called after a successful @ref{gnutls_handshake}.
+if called after a successful @funcref{gnutls_handshake}.
@verbatiminclude examples/ex-session-info.c
@@ -228,7 +228,7 @@ functions to verify a given certificate list.
@verbatiminclude examples/ex-verify.c
-@node Client using a PKCS #11 token with TLS
+@node Client using a PKCS 11 token with TLS
@subsection Using a @acronym{PKCS #11} token with TLS
@anchor{ex:pkcs11-client}
@@ -302,7 +302,7 @@ This example is a very simple echo server which supports
@cindex @acronym{OpenPGP} Server
The following example is an echo server which supports
-@acronym{@acronym{OpenPGP}} key authentication. You can easily combine
+@acronym{OpenPGP} key authentication. You can easily combine
this functionality ---that is have a server that supports both
@acronym{X.509} and @acronym{OpenPGP} certificates--- but we separated
them to keep these examples as simple as possible.
@@ -333,7 +333,7 @@ used to serve the example client for anonymous authentication.
* Checking for an alert::
* X.509 certificate parsing example::
* Certificate request generation::
-* PKCS #12 structure generation::
+* PKCS 12 structure generation::
@end menu
@node Checking for an alert
@@ -364,7 +364,7 @@ which should return a signed certificate.
@verbatiminclude examples/ex-crq.c
-@node PKCS #12 structure generation
+@node PKCS 12 structure generation
@subsection @acronym{PKCS} #12 Structure Generation
@anchor{ex:pkcs12}
@@ -393,18 +393,18 @@ Several TLS ciphersuites require additional parameters that
need to be generated or provided by the application. The
Diffie-Hellman based ciphersuites (ANON-DH or DHE), require
the group information to be provided. This information can be either
-be generated on the fly using @ref{gnutls_dh_params_generate2}
-or imported from some pregenerated value using @ref{gnutls_dh_params_import_pkcs3}.
+be generated on the fly using @funcref{gnutls_dh_params_generate2}
+or imported from some pregenerated value using @funcref{gnutls_dh_params_import_pkcs3}.
The parameters can be used in a session by calling
-@ref{gnutls_certificate_set_dh_params} or
-@ref{gnutls_anon_set_server_dh_params} for anonymous sessions.
+@funcref{gnutls_certificate_set_dh_params} or
+@funcref{gnutls_anon_set_server_dh_params} for anonymous sessions.
Due to the time-consuming calculations required for the generation
of Diffie-Hellman parameters we suggest against performing generation
of them within an application. The @code{certtool} tool can be used to
generate or export known safe values that can be stored in code
or in a configuration file to provide the ability to replace. We also
-recommend the usage of @ref{gnutls_sec_param_to_pk_bits} to determine
+recommend the usage of @funcref{gnutls_sec_param_to_pk_bits} to determine
the bit size of the parameters to be generated.
The ciphersuites that involve the RSA-EXPORT key exchange require
@@ -417,13 +417,13 @@ following functions can be used for these parameters.
@itemize
-@item @ref{gnutls_rsa_params_generate2}
+@item @funcref{gnutls_rsa_params_generate2}
-@item @ref{gnutls_certificate_set_rsa_export_params}
+@item @funcref{gnutls_certificate_set_rsa_export_params}
-@item @ref{gnutls_rsa_params_import_pkcs1}
+@item @funcref{gnutls_rsa_params_import_pkcs1}
-@item @ref{gnutls_rsa_params_export_pkcs1}
+@item @funcref{gnutls_rsa_params_export_pkcs1}
@end itemize
@@ -434,14 +434,14 @@ following functions can be used for these parameters.
@cindex Exporting Keying Material
The TLS PRF can be used by other protocols to derive data. The API to
-use is @ref{gnutls_prf}. The function needs to be provided with the
+use is @funcref{gnutls_prf}. The function needs to be provided with the
label in the parameter @code{label}, and the extra data to mix in the
@code{extra} parameter. Depending on whether you want to mix in the
client or server random data first, you can set the
@code{server_random_first} parameter.
For example, after establishing a TLS session using
-@ref{gnutls_handshake}, you can invoke the TLS PRF with this call:
+@funcref{gnutls_handshake}, you can invoke the TLS PRF with this call:
@smallexample
#define MYLABEL "EXPORTER-FOO"
@@ -452,7 +452,7 @@ rc = gnutls_prf (session, strlen (MYLABEL), MYLABEL, 0,
@end smallexample
If you don't want to mix in the client/server random, there is a more
-low-level TLS PRF interface called @ref{gnutls_prf_raw}.
+low-level TLS PRF interface called @funcref{gnutls_prf_raw}.
@node Channel Bindings
@subsection Channel Bindings
@@ -466,7 +466,7 @@ situations. The unique strings is a ``channel bindings''. For
background and more discussion see @xcite{RFC5056}.
You can extract a channel bindings using the
-@ref{gnutls_session_channel_binding} function. Currently only the
+@funcref{gnutls_session_channel_binding} function. Currently only the
@code{GNUTLS_CB_TLS_UNIQUE} type is supported, which corresponds to
the @code{tls-unique} channel bindings for TLS defined in
@xcite{RFC5929}.
@@ -476,7 +476,7 @@ Note that it must be run after a successful TLS handshake.
@smallexample
@{
- gnutls_datum cb;
+ gnutls_datum_t cb;
int rc;
rc = gnutls_session_channel_binding (session,
diff --git a/doc/cha-internals.texi b/doc/cha-internals.texi
index 478f168215..29bc25c572 100644
--- a/doc/cha-internals.texi
+++ b/doc/cha-internals.texi
@@ -40,7 +40,7 @@ figure.
Also the way the input is processed varies per ciphersuite. Several
implementations of the internal handlers are available and
-@ref{gnutls_handshake} only multiplexes the input to the appropriate
+@funcref{gnutls_handshake} only multiplexes the input to the appropriate
handler. For example a @acronym{PSK} ciphersuite has a different
implementation of the @code{process_client_key_exchange} than a
certificate ciphersuite.
diff --git a/doc/cha-intro-tls.texi b/doc/cha-intro-tls.texi
index 23dbeb2250..d8dc5bc3a9 100644
--- a/doc/cha-intro-tls.texi
+++ b/doc/cha-intro-tls.texi
@@ -8,22 +8,19 @@ by @acronym{IETF}@footnote{IETF, or Internet Engineering Task Force,
is a large open international community of network designers,
operators, vendors, and researchers concerned with the evolution of
the Internet architecture and the smooth operation of the Internet.
-It is open to any interested individual.}, described in @acronym{RFC}
-4346 and also in @xcite{RESCORLA}. The protocol provides
+It is open to any interested individual.}, described in @xcite{RFC5246}.
+The protocol provides
confidentiality, and authentication layers over any reliable transport
layer. The description, below, refers to @acronym{TLS} 1.0 but also
-applies to @acronym{TLS} 1.2 @xcite{RFC4346} and @acronym{SSL} 3.0,
+applies to @acronym{TLS} 1.2 @xcite{RFC5246} and @acronym{SSL} 3.0,
since the differences of these protocols are not major.
-The @acronym{DTLS} protocol, or ``Datagram @acronym{TLS}'' is a
+The @acronym{DTLS} protocol, or ``Datagram @acronym{TLS}'' @xcite{RFC4347} is a
protocol with identical goals as @acronym{TLS}, but can operate
under unreliable transport layers, such as @acronym{UDP}. The
discussions below apply to this protocol as well, except when
noted otherwise.
-Older protocols such as @acronym{SSL} 2.0 are not discussed nor implemented in
-@acronym{GnuTLS} since they are not considered secure today.
-
@menu
* TLS layers::
* The transport layer::
@@ -44,15 +41,14 @@ Protocol, the Handshake Protocol and the Alert Protocol. The Record
Protocol is to serve all other protocols and is above the transport
layer. The Record protocol offers symmetric encryption, data
authenticity, and optionally compression.
-
The Alert protocol offers some signaling to the other protocols. It
can help informing the peer for the cause of failures and other error
conditions. @xref{The Alert Protocol}, for more information. The
alert protocol is above the record protocol.
The Handshake protocol is responsible for the security parameters'
-negotiation, the initial key exchange and authentication. @xref{The
-Handshake Protocol}, for more information about the handshake
+negotiation, the initial key exchange and authentication.
+@xref{The Handshake Protocol}, for more information about the handshake
protocol. The protocol layering in TLS is shown in the figure below.
@center @image{gnutls-layers,12cm}
@@ -67,12 +63,12 @@ functions is provided and their purpose is to load to @acronym{GnuTLS} the
required callbacks to access the transport layer.
@itemize
-@item @ref{gnutls_transport_set_push_function}
-@item @ref{gnutls_transport_set_vec_push_function}
-@item @ref{gnutls_transport_set_pull_timeout_function} (for @acronym{DTLS} only)
-@item @ref{gnutls_transport_set_pull_function}
-@item @ref{gnutls_transport_set_ptr}
-@item @ref{gnutls_transport_set_errno}
+@item @funcref{gnutls_transport_set_push_function}
+@item @funcref{gnutls_transport_set_vec_push_function}
+@item @funcref{gnutls_transport_set_pull_timeout_function} (for @acronym{DTLS} only)
+@item @funcref{gnutls_transport_set_pull_function}
+@item @funcref{gnutls_transport_set_ptr}
+@item @funcref{gnutls_transport_set_errno}
@end itemize
These functions accept a callback function as a parameter. The
@@ -98,7 +94,7 @@ since signals do not interrupt @acronym{GnuTLS}' functions.
timers and waiting for peer's messages during the handshake process,
@acronym{GnuTLS} will block and might be interrupted by signals. The
blocking operation of @acronym{GnuTLS} during @acronym{DTLS} handshake
-can be changed using the appropriate flags in @ref{gnutls_init}.
+can be changed using the appropriate flags in @funcref{gnutls_init}.
By default, if the transport functions are not set, @acronym{GnuTLS}
will use the Berkeley Sockets functions.
@@ -113,18 +109,18 @@ The following functions are available:
@table @asis
-@item @ref{gnutls_record_send}:
+@item @funcref{gnutls_record_send}:
To send a record packet with application data.
-@item @ref{gnutls_record_recv}:
+@item @funcref{gnutls_record_recv}:
To receive a record packet with application data.
-@item @ref{gnutls_record_recv_seq}:
+@item @funcref{gnutls_record_recv_seq}:
To receive a record packet with application data as well
as the sequence number of that. This is useful in @acronym{DTLS}
where packets might be lost or received out of order.
-@item @ref{gnutls_record_get_direction}:
+@item @funcref{gnutls_record_get_direction}:
To get the direction of the last interrupted function call.
@end table
@@ -134,7 +130,7 @@ or send data. In @acronym{DTLS} however, due to re-transmission
timers used in the handshake out-of-order handshake data might
be received for some time (maximum 60 seconds) after the handshake
process is finished. For this reason programs using @acronym{DTLS}
-should call @ref{gnutls_record_recv} or @ref{gnutls_record_recv_seq}
+should call @funcref{gnutls_record_recv} or @funcref{gnutls_record_recv_seq}
for every packet received by the peer, even if no data were
expected.
@@ -174,28 +170,28 @@ data size.
Supported cipher algorithms:
@table @code
-@item 3DES_CBC
-@code{3DES_CBC} is the DES block cipher algorithm used with triple
+@item 3DES_CBC:
+This is the DES block cipher algorithm used with triple
encryption (EDE). Has 64 bits block size and is used in CBC mode.
-@item ARCFOUR_128
-ARCFOUR is a fast stream cipher.
+@item ARCFOUR_128:
+A fast stream cipher.
-@item ARCFOUR_40
-This is the ARCFOUR cipher that is fed with a 40 bit key,
+@item ARCFOUR_40:
+This is the ARCFOUR cipher fed with a 40 bit key,
which is considered weak.
-@item AES_CBC
+@item AES_CBC:
AES or RIJNDAEL is the block cipher algorithm that replaces the old
DES algorithm. Has 128 bits block size and is used in CBC mode.
-@item AES_GCM
+@item AES_GCM:
This is the AES algorithm in the authenticated encryption GCM mode.
This mode combines message authentication and encryption and can
be extremely fast on CPUs that support hardware acceleration.
-@item CAMELLIA_CBC
-CAMELLIA is an 128-bit block cipher developed by Mitsubish and NTT. It
+@item CAMELLIA_CBC:
+This is an 128-bit block cipher developed by Mitsubish and NTT. It
is one of the approved ciphers of the European NESSIE and Japanese
CRYPTREC projects.
@@ -205,19 +201,19 @@ CRYPTREC projects.
Supported MAC algorithms:
@table @code
-@item MAC_MD5
-MD5 is a cryptographic hash algorithm designed by Ron Rivest. Outputs
+@item MAC_MD5:
+This is a cryptographic hash algorithm designed by Ron Rivest. Outputs
128 bits of data.
-@item MAC_SHA
-SHA is a cryptographic hash algorithm designed by NSA. Outputs 160
+@item MAC_SHA1:
+A cryptographic hash algorithm designed by NSA. Outputs 160
bits of data.
-@item MAC_SHA256
-SHA256 is a cryptographic hash algorithm designed by NSA. Outputs 256
+@item MAC_SHA256:
+A cryptographic hash algorithm designed by NSA. Outputs 256
bits of data.
-@item MAC_AEAD
+@item MAC_AEAD:
This indicates that an authenticated encryption algorithm, such as
GCM, is in use.
@@ -229,29 +225,21 @@ GCM, is in use.
The TLS record layer also supports compression. The algorithms
implemented in @acronym{GnuTLS} can be found in the table below.
-All the algorithms except for DEFLATE which is
-referenced in @xcite{RFC3749}, should be considered as
-@acronym{GnuTLS}' extensions@footnote{You should use
-@ref{gnutls_handshake_set_private_extensions} to enable private
-extensions.}, and should be advertised only when the peer is known to
-have a compliant client, to avoid interoperability problems.
-
The included algorithms perform really good when text, or other
compressible data are to be transfered, but offer nothing on already
compressed data, such as compressed images, zipped archives etc.
These compression algorithms, may be useful in high bandwidth TLS
-tunnels, and in cases where network usage has to be minimized. As a
-drawback, compression increases latency.
+tunnels, and in cases where network usage has to be minimized. It
+should be noted however that compression increases latency.
The record layer compression in @acronym{GnuTLS} is implemented based
-on the proposal @xcite{RFC3749}.
-The supported compression algorithms are:
+on the proposal @xcite{RFC3749}. The supported algorithms are:
@table @code
-@item DEFLATE
+@item DEFLATE:
Zlib compression, using the deflate algorithm.
-@item NULL
+@item NULL:
No compression.
@end table
@@ -290,7 +278,7 @@ see the archives of the TLS Working Group mailing list and the paper
@cindex Bad record MAC
The TLS protocol allows for random padding of records, to make it more
-difficult to perform analysis on the length of exchanged messages (RFC 5246 6.2.3.2).
+difficult to perform analysis on the length of exchanged messages (see @xcite{RFC5246} section 6.2.3.2).
GnuTLS appears to be one of few implementation that take advantage of this text,
and pad records by a random length.
@@ -305,19 +293,19 @@ record MAC', or both, on the GnuTLS server side.
GnuTLS implements a work around for this problem. However, it has to
be enabled specifically. It can be enabled by using
-@ref{gnutls_record_disable_padding}, or @ref{gnutls_priority_set} with
+@funcref{gnutls_record_disable_padding}, or @funcref{gnutls_priority_set} with
the @code{%COMPAT} priority string.
If you implement an application that have a configuration file, we
recommend that you make it possible for users or administrators to
specify a GnuTLS protocol priority string, which is used by your
-application via @ref{gnutls_priority_set}. To allow the best
+application via @funcref{gnutls_priority_set}. To allow the best
flexibility, make it possible to have a different priority string for
different incoming IP addresses.
-To enable the workaround in the @code{gnutls-cli} client or the
-@code{gnutls-serv} server, for testing of other implementations, use
-the following parameter: @code{--priority "NORMAL:%COMPAT"}.
+To enable the workaround in the @command{gnutls-cli} client or the
+@command{gnutls-serv} server, for testing of other implementations, use
+the following parameter: @option{--priority "NORMAL:%COMPAT"}.
@node The TLS Alert Protocol
@@ -329,8 +317,8 @@ The Alert protocol is there to allow signals to be sent between peers.
These signals are mostly used to inform the peer about the cause of a
protocol failure. Some of these signals are used internally by the
protocol and the application protocol does not have to cope with them
-(see @code{GNUTLS_A_CLOSE_NOTIFY}), and others refer to the
-application protocol solely (see @code{GNUTLS_A_USER_CANCELLED}). An
+(e.g. @code{GNUTLS_A_CLOSE_NOTIFY}), and others refer to the
+application protocol solely (e.g. @code{GNUTLS_A_USER_CANCELLED}). An
alert signal includes a level indication which may be either fatal or
warning. Fatal alerts always terminate the current connection, and
prevent future renegotiations using the current session ID.
@@ -341,16 +329,16 @@ for the alert information not to leak to a possible attacker, via
public log files etc.
@table @asis
-@item @ref{gnutls_alert_send}:
+@item @funcref{gnutls_alert_send}:
To send an alert signal.
-@item @ref{gnutls_error_to_alert}:
+@item @funcref{gnutls_error_to_alert}:
To map a gnutls error number to an alert signal.
-@item @ref{gnutls_alert_get}:
+@item @funcref{gnutls_alert_get}:
Returns the last received alert.
-@item @ref{gnutls_alert_get_name}:
+@item @funcref{gnutls_alert_get_name}:
Returns the name, in a character array, of the given alert.
@end table
@@ -367,25 +355,25 @@ has to set up the required parameters. Available functions to control
the handshake protocol include:
@table @asis
-@item @ref{gnutls_priority_init}:
+@item @funcref{gnutls_priority_init}:
To initialize a priority set of ciphers.
-@item @ref{gnutls_priority_deinit}:
+@item @funcref{gnutls_priority_deinit}:
To deinitialize a priority set of ciphers.
-@item @ref{gnutls_priority_set}:
+@item @funcref{gnutls_priority_set}:
To associate a priority set with a @acronym{TLS} session.
-@item @ref{gnutls_priority_set_direct}:
+@item @funcref{gnutls_priority_set_direct}:
To directly associate a session with a given priority string.
-@item @ref{gnutls_credentials_set}:
+@item @funcref{gnutls_credentials_set}:
To set the appropriate credentials structures.
-@item @ref{gnutls_certificate_server_set_request}:
+@item @funcref{gnutls_certificate_server_set_request}:
To set whether client certificate is required or not.
-@item @ref{gnutls_handshake}:
+@item @funcref{gnutls_handshake}:
To initiate the handshake.
@end table
@@ -596,19 +584,19 @@ will allow V1 CAs in chains.
In the case of ciphersuites that use certificate authentication, the
authentication of the client is optional in @acronym{TLS}. A server
may request a certificate from the client --- using the
-@ref{gnutls_certificate_server_set_request} function. If a certificate
+@funcref{gnutls_certificate_server_set_request} function. If a certificate
is to be requested from the client during the handshake, the server
will send a certificate request message that contains a list of
acceptable certificate signers. In @acronym{GnuTLS} the certificate
signers list is constructed using the trusted Certificate Authorities
by the server. That is the ones set using
@itemize
-@item @ref{gnutls_certificate_set_x509_trust_file}
-@item @ref{gnutls_certificate_set_x509_trust_mem}
+@item @funcref{gnutls_certificate_set_x509_trust_file}
+@item @funcref{gnutls_certificate_set_x509_trust_mem}
@end itemize
-Sending of the names of the CAs can be controlled using
-@ref{gnutls_certificate_send_x509_rdn_sequence}. The client, then, may
+Sending of the names of the certificate authorities can be controlled using the function
+@funcref{gnutls_certificate_send_x509_rdn_sequence}. The client, then, may
send a certificate, signed by one of the server's acceptable signers.
@node Resuming Sessions
@@ -616,14 +604,14 @@ send a certificate, signed by one of the server's acceptable signers.
@anchor{resume}
@cindex Resuming sessions
-The @ref{gnutls_handshake} function, is expensive since a lot of
+The @funcref{gnutls_handshake} function, is expensive since a lot of
calculations are performed. In order to support many fast connections
to the same server a client may use session resuming. @strong{Session
resuming} is a feature of the @acronym{TLS} protocol which allows a
client to connect to a server, after a successful handshake, without
the expensive calculations. This is achieved by using the previously
established keys. @acronym{GnuTLS} supports this feature, and the
-example (@pxref{ex:resume-client}) illustrates a typical use of it.
+example in @ref{ex:resume-client} illustrates a typical use of it.
Keep in mind that sessions are expired after some time, for security
reasons, thus it may be normal for a server not to resume a session
@@ -637,16 +625,16 @@ The resuming capability, mostly in the server side, is one of the
problems of a thread-safe TLS implementations. The problem is that all
threads must share information in order to be able to resume
sessions. The gnutls approach is, in case of a client, to leave all
-the burden of resuming to the client. I.e., copy and keep the
+the burden of resuming to the client. That is, copy and keep the
necessary parameters. See the functions:
@itemize
-@item @ref{gnutls_session_get_data}
+@item @funcref{gnutls_session_get_data}
-@item @ref{gnutls_session_get_id}
+@item @funcref{gnutls_session_get_id}
-@item @ref{gnutls_session_set_data}
+@item @funcref{gnutls_session_set_data}
@end itemize
@@ -656,19 +644,19 @@ registered with:
@itemize
-@item @ref{gnutls_db_set_remove_function}
+@item @funcref{gnutls_db_set_remove_function}
-@item @ref{gnutls_db_set_store_function}
+@item @funcref{gnutls_db_set_store_function}
-@item @ref{gnutls_db_set_retrieve_function}
+@item @funcref{gnutls_db_set_retrieve_function}
-@item @ref{gnutls_db_set_ptr}
+@item @funcref{gnutls_db_set_ptr}
@end itemize
It might also be useful to be able to check for expired sessions in
order to remove them, and save space. The function
-@ref{gnutls_db_check_entry} is provided for that reason.
+@funcref{gnutls_db_check_entry} is provided for that reason.
@node Interoperability
@subsection Interoperability
@@ -689,9 +677,9 @@ is required. Thus we allow enabling compatibility with broken peers using
priority strings (see @ref{Priority Strings}). An example priority string that
is known to provide wide compatibility even with broken peers
is shown below:
-@example
+@verbatim
NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0:+VERS-SSL3.0:%COMPAT
-@end example
+@end verbatim
This priority string will only enable SSL 3.0 and TLS 1.0 as protocols and
will disable, via the @code{%COMPAT} keyword, several @acronym{TLS} protocol
options that are known to cause compatibility problems.
@@ -720,9 +708,11 @@ and they will be discussed in the subsections that follow.
This extension allows a @acronym{TLS} implementation to negotiate a
smaller value for record packet maximum length. This extension may be
-useful to clients with constrained capabilities. See the
-@ref{gnutls_record_set_max_size} and the
-@ref{gnutls_record_get_max_size} functions.
+useful to clients with constrained capabilities. See the functions:
+@itemize
+@item @funcref{gnutls_record_set_max_size}
+@item @funcref{gnutls_record_get_max_size}
+@end itemize
@subsection Server Name Indication
@anchor{serverind}
@@ -737,7 +727,7 @@ connects to, when the handshake procedure begins. For that reason the
This extension solves that problem within the @acronym{TLS} protocol,
and allows a client to send the HTTP hostname before the handshake
begins within the first handshake packet. The functions
-@ref{gnutls_server_name_set} and @ref{gnutls_server_name_get} can be
+@funcref{gnutls_server_name_set} and @funcref{gnutls_server_name_get} can be
used to enable this extension, or to retrieve the name sent by a
client.
@@ -753,9 +743,9 @@ extension implements this idea, and it is documented in
RFC 5077 @xcite{TLSTKT}.
Clients can enable support for TLS tickets with
-@ref{gnutls_session_ticket_enable_client} and servers use
-@ref{gnutls_session_ticket_key_generate} to generate a key and
-@ref{gnutls_session_ticket_enable_server} to enable the extension.
+@funcref{gnutls_session_ticket_enable_client} and servers use
+@funcref{gnutls_session_ticket_key_generate} to generate a key and
+@funcref{gnutls_session_ticket_enable_server} to enable the extension.
Clients resume sessions using the ticket using the normal session
resume functions, @ref{resume}.
@@ -824,7 +814,7 @@ renegotiation extension from servers (see below on the
To modify the default behaviour, we have introduced some new priority
strings. The priority strings can be used by applications
-(@pxref{gnutls_priority_set}) and end users (e.g., @code{--priority}
+(@funcref{gnutls_priority_set}) and end users (e.g., @code{--priority}
parameter to @code{gnutls-cli} and @code{gnutls-serv}).
The @code{%UNSAFE_RENEGOTIATION} priority string permits
@@ -856,7 +846,7 @@ The default values if the flags above are not specified are:
@end table
For applications we have introduced a new API related to safe
-renegotiation. The @ref{gnutls_safe_renegotiation_status} function is
+renegotiation. The @funcref{gnutls_safe_renegotiation_status} function is
used to check if the extension has been negotiated on a session, and
can be used both by clients and servers.
@@ -877,7 +867,7 @@ authentication.
@item Security bits
@tab RSA, DH and SRP parameter size
@tab ECC key size
-@tab @code{gnutls_sec_param_t}
+@tab Security parameter
@tab Description
@item 64
@@ -938,9 +928,9 @@ key algorithm is required, use of the following functions is
recommended:
@itemize
-@item @ref{gnutls_pk_bits_to_sec_param}
+@item @funcref{gnutls_pk_bits_to_sec_param}
-@item @ref{gnutls_sec_param_to_pk_bits}
+@item @funcref{gnutls_sec_param_to_pk_bits}
@end itemize
Those functions will convert a human understandable security parameter
diff --git a/doc/cha-library.texi b/doc/cha-library.texi
index f556369ec0..5f738e1b7d 100644
--- a/doc/cha-library.texi
+++ b/doc/cha-library.texi
@@ -7,8 +7,8 @@ privacy over insecure lines, and were designed to prevent
eavesdropping, tampering, or message forgery.
Technically @acronym{GnuTLS} is a portable ANSI C based library which
-implements the protocols ranging from SSL 3.0 to TLS 1.2 (@xref{Introduction to
-TLS}, for a more detailed description of the protocols), accompanied
+implements the protocols ranging from SSL 3.0 to TLS 1.2 (see @ref{Introduction to TLS},
+for a detailed description of the protocols), accompanied
with the required framework for authentication and public key
infrastructure. Important features of the @acronym{GnuTLS} library
include:
@@ -17,6 +17,8 @@ include:
@item Support for TLS 1.2, TLS 1.1, TLS 1.0 and SSL 3.0 protocols.
+@item Support for Datagram TLS 1.0.
+
@item Support for both @acronym{X.509} and @acronym{OpenPGP} certificates.
@item Support for handling and verification of certificates.
@@ -25,16 +27,12 @@ include:
@item Support for @acronym{PSK} for TLS authentication.
-@item Support for TLS Extension mechanism.
+@item Support for TLS safe renegotiation.
-@item Support for TLS Compression Methods.
+@item Support for @acronym{PKCS} #11 tokens.
@end itemize
-Additionally @acronym{GnuTLS} provides a limited emulation API for the
-widely used OpenSSL@footnote{@url{http://www.openssl.org/}} library,
-to ease integration with existing applications.
-
@acronym{GnuTLS} consists of three independent parts, namely the ``TLS
protocol part'', the ``Certificate part'', and the ``Cryptographic
backend'' part. The `TLS protocol part' is the actual protocol
@@ -42,21 +40,14 @@ implementation, and is entirely implemented within the
@acronym{GnuTLS} library. The `Certificate part' consists of the
certificate parsing, and verification functions which is partially
implemented in the @acronym{GnuTLS} library. The
-@acronym{Libtasn1}@footnote{@url{ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/libtasn1/}},
+libtasn1@footnote{@url{ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/libtasn1/}},
a library which offers @acronym{ASN.1} parsing capabilities, is used
-for the @acronym{X.509} certificate parsing functions. A smaller
-version of
-@acronym{OpenCDK}@footnote{@url{ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/opencdk/}}
-is used for the @acronym{OpenPGP} key support in @acronym{GnuTLS}.
-The ``Cryptographic backend'' is provided by the
-@acronym{Libgcrypt}@footnote{@url{ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/}}
-library@footnote{On current versions of GnuTLS it is possible to
-override the default crypto backend. Check @pxref{Cryptographic
-Backend} for details}.
-
+for the @acronym{X.509} certificate parsing functions.
+The ``Cryptographic backend'' is provided by nettle@footnote{@url{http://www.lysator.liu.se/~nisse/nettle/}}
+library.
In order to ease integration in embedded systems, parts of the
@acronym{GnuTLS} library can be disabled at compile time. That way a
-small library, with the required features, can be generated.
+smaller library, with the required features, can be generated.
@menu
* General Idea::
@@ -71,7 +62,7 @@ small library, with the required features, can be generated.
A brief description of how @acronym{GnuTLS} works internally is shown
at the figure below. This section may be easier to understand after
-having seen the examples (@pxref{examples}).
+having seen the examples at @ref{examples}.
@center @image{gnutls-internals,12cm}
@@ -85,7 +76,7 @@ the global structure and is called after the program has permanently
finished using @acronym{GnuTLS}.
The credentials structure is used by some authentication methods, such
-as certificate authentication (@pxref{Certificate Authentication}). A
+as certificate authentication. A
credentials structure may contain certificates, private keys,
temporary parameters for Diffie-Hellman or RSA key exchange, and other
stuff that may be shared between several TLS sessions.
@@ -105,7 +96,7 @@ peer. Every session has a unique session ID shared with the peer.
Since TLS sessions can be resumed, servers would probably need a
database backend to hold the session's parameters. Every
@acronym{GnuTLS} session after a successful handshake calls the
-appropriate backend function (@xref{resume}, for information on
+appropriate backend function (see @ref{resume}, for information on
initialization) to store the newly negotiated session. The session
database is examined by the server just after having received the
client hello@footnote{The first message in a @acronym{TLS} handshake},
@@ -126,15 +117,16 @@ and receives will be disallowed. An example of a fatal error code is
@code{GNUTLS_E_DECRYPTION_FAILED}. Non-fatal errors may warn about
something, i.e., a warning alert was received, or indicate the some
action has to be taken. This is the case with the error code
-@code{GNUTLS_E_REHANDSHAKE} returned by @ref{gnutls_record_recv}.
+@code{GNUTLS_E_REHANDSHAKE} returned by @funcref{gnutls_record_recv}.
This error code indicates that the server requests a re-handshake. The
client may ignore this request, or may reply with an alert. You can
test if an error code is a fatal one by using the
-@ref{gnutls_error_is_fatal}.
+@funcref{gnutls_error_is_fatal}.
If any non fatal errors, that require an action, are to be returned by
a function, these error codes will be documented in the function's
-reference. @xref{Error Codes}, for all the error codes.
+reference. See @ref{Error codes}, for a description of the available
+error codes.
@node Memory handling
@section Memory Handling
@@ -144,7 +136,7 @@ differently, depending on the sensitivity of the data they
contain. However for performance reasons, the default memory functions
do not overwrite sensitive data from memory, nor protect such objects
from being written to the swap. In order to change the default
-behavior the @ref{gnutls_global_set_mem_functions} function is
+behavior the @funcref{gnutls_global_set_mem_functions} function is
available which can be used to set other memory handlers than the
defaults.
@@ -159,21 +151,19 @@ information.
Although the @acronym{GnuTLS} library is thread safe by design, some
parts of the cryptographic backend, such as the random generator, are not.
-Applications can either call @ref{gnutls_global_init} which will use the default
+Applications can either call @funcref{gnutls_global_init} which will use the default
operating system provided locks (i.e. @code{pthreads} on GNU/Linux and
@code{CriticalSection} on Windows), or specify manualy the locking system using
-the function @ref{gnutls_global_set_mutex} before calling @ref{gnutls_global_init}.
+the function @funcref{gnutls_global_set_mutex} before calling @funcref{gnutls_global_init}.
Setting manually mutexes is recommended
only to applications that have full control of the underlying libraries. If this
is not the case, the use of the operating system defaults is suggested.
There are helper macros to help you properly initialize the libraries.
-Examples are shown below.
+Examples are shown in the following paragraphs.
-@itemize
-
-@item Native threads
+@subsection Native threads
@example
#include <gnutls.h>
@@ -183,7 +173,7 @@ int main()
@}
@end example
-@item Other thread packages
+@subsection Other thread packages
@example
int main()
@@ -193,7 +183,6 @@ int main()
gnutls_global_init();
@}
@end example
-@end itemize
@node Callback functions
@section Callback Functions
@@ -209,21 +198,21 @@ data to the transport layer.
@itemize
-@item @ref{gnutls_transport_set_push_function}
+@item @funcref{gnutls_transport_set_push_function}
-@item @ref{gnutls_transport_set_pull_function}
+@item @funcref{gnutls_transport_set_pull_function}
@end itemize
Other callback functions such as the one set by
-@ref{gnutls_srp_set_server_credentials_function}, may require more
+@funcref{gnutls_srp_set_server_credentials_function}, may require more
complicated input, including data to be allocated. These callbacks
should allocate and free memory using the functions shown below.
@itemize
-@item @ref{gnutls_malloc}
+@item @funcref{gnutls_malloc}
-@item @ref{gnutls_free}
+@item @funcref{gnutls_free}
@end itemize
diff --git a/doc/cha-preface.texi b/doc/cha-preface.texi
index 68a7c828f1..20ea7f8765 100644
--- a/doc/cha-preface.texi
+++ b/doc/cha-preface.texi
@@ -1,17 +1,18 @@
@node Preface
@chapter Preface
-This document tries to demonstrate and explain the @acronym{GnuTLS}
+This document demonstrates and explains the @acronym{GnuTLS}
library API. A brief introduction to the protocols and the technology
-involved, is also included so that an application programmer can
+involved is also included so that an application programmer can
better understand the @acronym{GnuTLS} purpose and actual offerings.
Even if @acronym{GnuTLS} is a typical library software, it operates
-over several security and cryptographic protocols, which require the
-programmer to make careful and correct usage of them, otherwise he
-risks to offer just a false sense of security. Security and the
-network security terms are very general terms even for computer
-software thus cannot be easily restricted to a single cryptographic
-library. For that reason, do not consider a program secure just
+over several security and cryptographic protocols which require the
+programmer to make careful and correct usage of them. Otherwise it
+is likely to only obtain a false sense of security.
+The terms of Security and
+network security terms are very general even if restricted to computer
+software, and cannot be offered by a single cryptographic
+library. For that reason, do not consider any program secure just
because it uses @acronym{GnuTLS}; there are several ways to compromise
a program or a communication line and @acronym{GnuTLS} only helps with
some of them.
@@ -21,234 +22,7 @@ programming and PKI knowlegde is assumed in most of it. A good
introduction to networking can be found in @xcite{STEVENS} and for
Public Key Infrastructure in @xcite{GUTPKI}.
-@anchor{Availability}
-
Updated versions of the @acronym{GnuTLS} software and this document
will be available from @url{http://www.gnutls.org/} and
@url{http://www.gnu.org/software/gnutls/}.
-@menu
-* Getting help::
-* Commercial Support::
-* Downloading and Installing::
-* Bug Reports::
-* Contributing::
-@end menu
-
-@node Getting help
-@section Getting Help
-
-A mailing list where users may help each other exists, and you can
-reach it by sending e-mail to @email{help-gnutls@@gnu.org}. Archives
-of the mailing list discussions, and an interface to manage
-subscriptions, is available through the World Wide Web at
-@url{http://lists.gnu.org/mailman/listinfo/help-gnutls}.
-
-A mailing list for developers are also available, see
-@url{http://www.gnu.org/software/gnutls/lists.html}.
-
-Bug reports should be sent to @email{bug-gnutls@@gnu.org}, see
-@xref{Bug Reports}.
-
-@node Commercial Support
-@section Commercial Support
-
-Commercial support is available for users of GnuTLS. The kind of
-support that can be purchased may include:
-
-@itemize
-
-@item Implement new features.
-Such as a new TLS extension.
-
-@item Port GnuTLS to new platforms.
-This could include porting to an embedded platforms that may need
-memory or size optimization.
-
-@item Integrating TLS as a security environment in your existing project.
-
-@item System design of components related to TLS.
-
-@end itemize
-
-If you are interested, please write to:
-
-@verbatim
-Simon Josefsson Datakonsult
-Hagagatan 24
-113 47 Stockholm
-Sweden
-
-E-mail: simon@josefsson.org
-@end verbatim
-
-If your company provides support related to GnuTLS and would like to
-be mentioned here, contact the author (@pxref{Bug Reports}).
-
-@node Downloading and Installing
-@section Downloading and Installing
-@cindex Installation
-@cindex Download
-
-GnuTLS is available for download from the following URL:
-
-@url{http://www.gnutls.org/download.html}
-
-The latest version is stored in a file, e.g.,
-@samp{gnutls-@value{VERSION}.tar.gz} where the @samp{@value{VERSION}}
-value is the highest version number in the directory.
-
-GnuTLS uses a Linux-like development cycle: even minor version numbers
-indicate a stable release and a odd minor version number indicates a
-development release. For example, GnuTLS 1.6.3 denote a stable
-release since 6 is even, and GnuTLS 1.7.11 denote a development
-release since 7 is odd.
-
-GnuTLS depends on Libgcrypt,
-and you will need to install Libgcrypt
-before installing GnuTLS. Libgcrypt is available from
-@url{ftp://ftp.gnupg.org/gcrypt/libgcrypt}. Libgcrypt needs another
-library, libgpg-error, and you need to install libgpg-error before
-installing Libgcrypt. Libgpg-error is available from
-@url{ftp://ftp.gnupg.org/gcrypt/libgpg-error}.
-
-Don't forget to verify the cryptographic signature after downloading
-source code packages.
-
-The package is then extracted, configured and built like many other
-packages that use Autoconf. For detailed information on configuring
-and building it, refer to the @file{INSTALL} file that is part of the
-distribution archive. Typically you invoke @code{./configure} and
-then @code{make check install}. There are a number of compile-time
-parameters, as discussed below.
-
-The compression library (libz) is an optional dependency.
-You can get libz from @url{http://www.zlib.net/}.
-
-The X.509 part of GnuTLS needs ASN.1 functionality, from a library
-called libtasn1. A copy of libtasn1 is included in GnuTLS. If you
-want to install it separately (e.g., to make it possibly to use
-libtasn1 in other programs), you can get it from
-@url{http://www.gnu.org/software/gnutls/download.html}.
-
-The OpenPGP part of GnuTLS uses a stripped down version of OpenCDK for
-parsing OpenPGP packets. It is included GnuTLS. Use parameter
-@code{--disable-openpgp-authentication} to disable the OpenPGP
-functionality in GnuTLS. Unfortunately, we didn't have resources to
-maintain the code in a separate library.
-
-A few @code{configure} options may be relevant, summarized in the
-table.
-
-@table @code
-
-@item --disable-srp-authentication
-@itemx --disable-psk-authentication
-@itemx --disable-anon-authentication
-@itemx --disable-extra-pki
-@itemx --disable-openpgp-authentication
-@itemx --disable-openssl-compatibility
-Disable or enable particular features. Generally not recommended.
-
-@end table
-
-For the complete list, refer to the output from @code{configure
---help}.
-
-@node Bug Reports
-@section Bug Reports
-@cindex Reporting Bugs
-
-If you think you have found a bug in GnuTLS, please investigate it and
-report it.
-
-@itemize @bullet
-
-@item Please make sure that the bug is really in GnuTLS, and
-preferably also check that it hasn't already been fixed in the latest
-version.
-
-@item You have to send us a test case that makes it possible for us to
-reproduce the bug.
-
-@item You also have to explain what is wrong; if you get a crash, or
-if the results printed are not good and in that case, in what way.
-Make sure that the bug report includes all information you would need
-to fix this kind of bug for someone else.
-
-@end itemize
-
-Please make an effort to produce a self-contained report, with
-something definite that can be tested or debugged. Vague queries or
-piecemeal messages are difficult to act on and don't help the
-development effort.
-
-If your bug report is good, we will do our best to help you to get a
-corrected version of the software; if the bug report is poor, we won't
-do anything about it (apart from asking you to send better bug
-reports).
-
-If you think something in this manual is unclear, or downright
-incorrect, or if the language needs to be improved, please also send a
-note.
-
-Send your bug report to:
-
-@center @samp{bug-gnutls@@gnu.org}
-
-@node Contributing
-@section Contributing
-@cindex Contributing
-@cindex Hacking
-
-If you want to submit a patch for inclusion -- from solve a typo you
-discovered, up to adding support for a new feature -- you should
-submit it as a bug report (@pxref{Bug Reports}). There are some
-things that you can do to increase the chances for it to be included
-in the official package.
-
-Unless your patch is very small (say, under 10 lines) we require that
-you assign the copyright of your work to the Free Software Foundation.
-This is to protect the freedom of the project. If you have not
-already signed papers, we will send you the necessary information when
-you submit your contribution.
-
-For contributions that doesn't consist of actual programming code, the
-only guidelines are common sense. Use it.
-
-For code contributions, a number of style guides will help you:
-
-@itemize @bullet
-
-@item Coding Style.
-Follow the GNU Standards document.
-@c (@pxref{top, GNU Coding Standards,,standards}).
-
-If you normally code using another coding standard, there is no
-problem, but you should use @samp{indent} to reformat the code
-@c (@pxref{top, GNU Indent,, indent})
-before submitting your work.
-
-@item Use the unified diff format @samp{diff -u}.
-
-@item Return errors.
-No reason whatsoever should abort the execution of the library. Even
-memory allocation errors, e.g. when malloc return NULL, should work
-although result in an error code.
-
-@item Design with thread safety in mind.
-Don't use global variables. Don't even write to per-handle global
-variables unless the documented behaviour of the function you write is
-to write to the per-handle global variable.
-
-@item Avoid using the C math library.
-It causes problems for embedded implementations, and in most
-situations it is very easy to avoid using it.
-
-@item Document your functions.
-Use comments before each function headers, that, if properly
-formatted, are extracted into Texinfo manuals and GTK-DOC web pages.
-
-@item Supply a ChangeLog and NEWS entries, where appropriate.
-
-@end itemize
diff --git a/doc/cha-programs.texi b/doc/cha-programs.texi
index 528deefeea..e8f7e62503 100644
--- a/doc/cha-programs.texi
+++ b/doc/cha-programs.texi
@@ -22,225 +22,235 @@ application. The applications are discussed in this chapter.
This is a program to generate @acronym{X.509} certificates, certificate
requests, CRLs and private keys.
-@verbatim
+@example
Certtool help
Usage: certtool [options]
- -s, --generate-self-signed
+ -s, --generate-self-signed
Generate a self-signed certificate.
- -c, --generate-certificate
+ -c, --generate-certificate
Generate a signed certificate.
--generate-proxy Generate a proxy certificate.
--generate-crl Generate a CRL.
- -u, --update-certificate
+ -u, --update-certificate
Update a signed certificate.
-p, --generate-privkey Generate a private key.
- -q, --generate-request Generate a PKCS #10 certificate
+ -q, --generate-request Generate a PKCS #10 certificate
request.
- -e, --verify-chain Verify a PEM encoded certificate chain.
- The last certificate in the chain must
+ -e, --verify-chain Verify a PEM encoded certificate chain.
+ The last certificate in the chain must
be a self signed one.
+ --verify Verify a PEM encoded certificate chain.
+ CA certificates must be loaded with
+ --load-ca-certificate.
--verify-crl Verify a CRL.
- --generate-dh-params Generate PKCS #3 encoded Diffie-Hellman
+ --generate-dh-params Generate PKCS #3 encoded Diffie-Hellman
parameters.
- --get-dh-params Get the included PKCS #3 encoded Diffie
- Hellman parameters.
+ --get-dh-params Get the included PKCS #3 encoded
+ Diffie-Hellman parameters.
--load-privkey FILE Private key file to use.
+ --load-pubkey FILE Private key file to use.
--load-request FILE Certificate request file to use.
- --load-certificate FILE
+ --load-certificate FILE
Certificate file to use.
- --load-ca-privkey FILE Certificate authority's private key
+ --load-ca-privkey FILE Certificate authority's private key
file to use.
- --load-ca-certificate FILE
- Certificate authority's certificate
+ --load-ca-certificate FILE
+ Certificate authority's certificate
file to use.
--password PASSWORD Password to use.
-i, --certificate-info Print information on a certificate.
+ --certificate-pubkey Print certificate public key.
+ --pgp-certificate-info Print information on a OpenPGP
+ certificate.
+ --pgp-ring-info Print information on a keyring
+ structure.
-l, --crl-info Print information on a CRL.
- --p12-info Print information on a PKCS #12
+ --crq-info Print information on a Certificate
+ Request.
+ --no-crq-extensions Do not use extensions in certificate
+ requests.
+ --p12-info Print information on a PKCS #12
structure.
- --p7-info Print information on a PKCS #7
+ --p7-info Print information on a PKCS #7
structure.
--smime-to-p7 Convert S/MIME to PKCS #7 structure.
-k, --key-info Print information on a private key.
- --fix-key Regenerate the parameters in a private
+ --pgp-key-info Print information on a OpenPGP private
+ key.
+ --pubkey-info Print information on a public key.
+ --fix-key Regenerate the parameters in a private
key.
+ --v1 Generate an X.509 version 1 certificate
+ (no extensions).
--to-p12 Generate a PKCS #12 structure.
+ --to-p8 Generate a PKCS #8 key structure.
-8, --pkcs8 Use PKCS #8 format for private keys.
--dsa Use DSA keys.
- --hash STR Hash algorithm to use for signing
- (MD5,SHA1,RMD160).
+ --ecc Use ECC (ECDSA) keys.
+ --hash STR Hash algorithm to use for signing
+ (MD5,SHA1,RMD160,SHA256,SHA384,SHA512).
--export-ciphers Use weak encryption algorithms.
- --inder Use DER format for input certificates
+ --inder Use DER format for input certificates
and private keys.
- --outder Use DER format for output certificates
+ --inraw Use RAW/DER format for input
+ certificates and private keys.
+ --outder Use DER format for output certificates
and private keys.
- --bits BITS specify the number of bits for key
+ --outraw Use RAW/DER format for output
+ certificates and private keys.
+ --bits BITS specify the number of bits for key
generation.
+ --sec-param PARAM specify the security level
+ [low|normal|high|ultra].
+ --disable-quick-random Use /dev/random for key generationg,
+ thus increasing the quality of
+ randomness used.
--outfile FILE Output file.
--infile FILE Input file.
- --template FILE Template file to use for non
+ --template FILE Template file to use for non
interactive operation.
+ --pkcs-cipher CIPHER Cipher to use for pkcs operations
+ (3des,3des-pkcs12,aes-128,aes-192,aes-25
+ 6,rc2-40,arcfour).
-d, --debug LEVEL specify the debug level. Default is 1.
-h, --help shows this help text
-v, --version shows the program's version
-@end verbatim
+@end example
The program can be used interactively or non interactively by
specifying the @code{--template} command line option. See below for an
example of a template file.
-How to use certtool interactively:
-
-@itemize
-@item
+@subsection Diffie-Hellman parameter generation
To generate parameters for Diffie-Hellman key exchange, use the command:
-@example
+@smallexample
$ certtool --generate-dh-params --outfile dh.pem
-@end example
-
-@item
-To generate parameters for the RSA-EXPORT key exchange, use the command:
-@example
-$ certtool --generate-privkey --bits 512 --outfile rsa.pem
-@end example
-
-@end itemize
+@end smallexample
-@itemize
+@subsection Self-signed certificate generation
-@item
To create a self signed certificate, use the command:
-@example
+@smallexample
$ certtool --generate-privkey --outfile ca-key.pem
$ certtool --generate-self-signed --load-privkey ca-key.pem \
--outfile ca-cert.pem
-@end example
+@end smallexample
Note that a self-signed certificate usually belongs to a certificate
authority, that signs other certificates.
-@item
+@subsection Private key generation
To create a private key (RSA by default), run:
-@example
+@smallexample
$ certtool --generate-privkey --outfile key.pem
-@end example
+@end smallexample
To create a DSA private key, run:
-@example
+@smallexample
$ certtool --dsa --generate-privkey --outfile key-dsa.pem
-@end example
+@end smallexample
-@item
+@subsection Certificate generation
To generate a certificate using the private key, use the command:
-@example
+@smallexample
$ certtool --generate-certificate --load-privkey key.pem \
--outfile cert.pem --load-ca-certificate ca-cert.pem \
--load-ca-privkey ca-key.pem
-@end example
+@end smallexample
-@item
-To create a certificate request (needed when the certificate is issued by
-another party), run:
+Alternatively you may create a certificate request, which is needed
+when the certificate will be signed by a third party authority.
-@example
+@smallexample
$ certtool --generate-request --load-privkey key.pem \
--outfile request.pem
-@end example
+@end smallexample
-@item
To generate a certificate using the previous request, use the command:
-@example
+@smallexample
$ certtool --generate-certificate --load-request request.pem \
--outfile cert.pem \
--load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem
-@end example
+@end smallexample
-@item
+@subsection Certificate information
To view the certificate information, use:
-@example
+@smallexample
$ certtool --certificate-info --infile cert.pem
-@end example
+@end smallexample
-@item
+@subsection @acronym{PKCS} #12 structure generation
To generate a @acronym{PKCS} #12 structure using the previous key and
certificate, use the command:
-@example
+@smallexample
$ certtool --load-certificate cert.pem --load-privkey key.pem \
--to-p12 --outder --outfile key.p12
-@end example
+@end smallexample
Some tools (reportedly web browsers) have problems with that file
because it does not contain the CA certificate for the certificate.
To work around that problem in the tool, you can use the
-@samp{--load-ca-certificate} parameter as follows:
+--load-ca-certificate parameter as follows:
-@example
+@smallexample
$ certtool --load-ca-certificate ca.pem \
--load-certificate cert.pem --load-privkey key.pem \
--to-p12 --outder --outfile key.p12
-@end example
+@end smallexample
-@item
+@subsection Proxy certificate generation
Proxy certificate can be used to delegate your credential to a
temporary, typically short-lived, certificate. To create one from the
previously created certificate, first create a temporary key and then
generate a proxy certificate for it, using the commands:
-@example
+@smallexample
$ certtool --generate-privkey > proxy-key.pem
$ certtool --generate-proxy --load-ca-privkey key.pem \
--load-privkey proxy-key.pem --load-certificate cert.pem \
--outfile proxy-cert.pem
-@end example
+@end smallexample
-@item
+@subsection Certificate Revocation List generation
To create an empty Certificate Revocation List (CRL) do:
-@example
-$ certtool --generate-crl --load-ca-privkey x509-ca-key.pem --load-ca-certificate x509-ca.pem
-@end example
+@smallexample
+$ certtool --generate-crl --load-ca-privkey x509-ca-key.pem \
+ --load-ca-certificate x509-ca.pem
+@end smallexample
To create a CRL that contains some revoked certificates, place the
certificates in a file and use @code{--load-certificate} as follows:
-@example
+@smallexample
$ certtool --generate-crl --load-ca-privkey x509-ca-key.pem \
--load-ca-certificate x509-ca.pem --load-certificate revoked-certs.pem
-@end example
+@end smallexample
-@item
To verify a Certificate Revocation List (CRL) do:
-@example
+@smallexample
$ certtool --verify-crl --load-ca-certificate x509-ca.pem < crl.pem
-@end example
-
-@end itemize
-
-Certtool's template file format:
+@end smallexample
-@itemize
-@item
-Firstly create a file named 'cert.cfg' that contains the information
-about the certificate. An example file is listed below.
-@item
-Then execute:
+@subsection Certtool's template file format:
+A template file can be used to avoid the interactive questions of
+certtool. Initially create a file named 'cert.cfg' that contains the information
+about the certificate. The template can be used as below:
-@example
+@smallexample
$ certtool --generate-certificate cert.pem --load-privkey key.pem \
--template cert.cfg \
--load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem
-@end example
-
-@end itemize
+@end smallexample
An example certtool template file:
@@ -347,7 +357,7 @@ Simple client program to set up a TLS connection to some other
computer. It sets up a TLS connection and forwards data from the
standard input to the secured socket and vice versa.
-@verbatim
+@example
GnuTLS test client
Usage: gnutls-cli [options] hostname
@@ -399,7 +409,7 @@ Usage: gnutls-cli [options] hostname
algorithms and modes.
-h, --help prints this help
-v, --version prints the program's version number
-@end verbatim
+@end example
To connect to a server using PSK authentication, you may use something
like:
@@ -441,12 +451,7 @@ Enter password:
If the server supports several cipher suites, you may need to force it
to chose PSK by using a cipher priority parameter such as
-@code{--priority NORMAL:+PSK:-RSA:-DHE-RSA:-DHE-PSK}.
-
-@cindex Netconf
-Instead of using the Netconf-way to derive the PSK key from a
-password, you can also give the PSK username and key directly on the
-command line:
+@option{--priority NORMAL:+PSK:-RSA:-DHE-RSA:-DHE-PSK}.
@smallexample
$ ./gnutls-cli -p 5556 localhost --pskusername psk_identity \
@@ -479,7 +484,7 @@ It's purpose is to connect onto a @acronym{TLS} server, perform some
tests and print the server's capabilities. If called with the `-v'
parameter a more checks will be performed. An example output is:
-@smallexample
+@example
crystal:/cvs/gnutls/src$ ./gnutls-cli-debug localhost -p 5556
Resolving 'localhost'...
Connecting to '127.0.0.1:5556'...
@@ -493,7 +498,6 @@ Checking whether we need to disable TLS 1.0... N/A
Checking whether the server ignores the RSA PMS version... no
Checking whether the server can accept Hello Extensions... yes
Checking whether the server can accept cipher suites not in SSL 3.0 spec... yes
-Checking whether the server can accept a bogus TLS record version in the client hello... yes
Checking for certificate information... N/A
Checking for trusted CAs... N/A
Checking whether the server understands TLS closure alerts... yes
@@ -514,7 +518,7 @@ Checking for ZLIB compression support (TLS extension)... yes
Checking for max record size (TLS extension)... yes
Checking for SRP authentication support (TLS extension)... yes
Checking for OpenPGP authentication support (TLS extension)... no
-@end smallexample
+@end example
@node Invoking gnutls-serv
@section Invoking gnutls-serv
@@ -522,7 +526,7 @@ Checking for OpenPGP authentication support (TLS extension)... no
Simple server program that listens to incoming TLS connections.
-@verbatim
+@example
GnuTLS test server
Usage: gnutls-serv [options]
@@ -572,7 +576,7 @@ Usage: gnutls-serv [options]
algorithms and modes.
-h, --help prints this help
-v, --version prints the program's version number
-@end verbatim
+@end example
@subsection Setting Up a Test HTTPS Server
@cindex HTTPS server
@@ -584,16 +588,16 @@ use @code{gnutls-serv} as a simple HTTPS server.
The most basic server can be started as:
-@example
+@smallexample
gnutls-serv --http
-@end example
+@end smallexample
It will only support anonymous ciphersuites, which many TLS clients
refuse to use.
The next step is to add support for X.509. First we generate a CA:
-@example
+@smallexample
$ certtool --generate-privkey > x509-ca-key.pem
$ echo 'cn = GnuTLS test CA' > ca.tmpl
$ echo 'ca' >> ca.tmpl
@@ -601,7 +605,7 @@ $ echo 'cert_signing_key' >> ca.tmpl
$ certtool --generate-self-signed --load-privkey x509-ca-key.pem \
--template ca.tmpl --outfile x509-ca.pem
...
-@end example
+@end smallexample
Then generate a server certificate. Remember to change the dns_name
value to the name of your server host, or skip that command to avoid
@@ -640,15 +644,15 @@ To be able to import the client key/certificate into some
applications, you will need to convert them into a PKCS#12 structure.
This also encrypts the security sensitive key with a password.
-@example
+@smallexample
$ certtool --to-p12 --load-ca-certificate x509-ca.pem \
--load-privkey x509-client-key.pem --load-certificate x509-client.pem \
--outder --outfile x509-client.p12
-@end example
+@end smallexample
For icing, we'll create a proxy certificate for the client too.
-@example
+@smallexample
$ certtool --generate-privkey > x509-proxy-key.pem
$ echo 'cn = GnuTLS test client proxy' > proxy.tmpl
$ certtool --generate-proxy --load-privkey x509-proxy-key.pem \
@@ -656,16 +660,16 @@ $ certtool --generate-proxy --load-privkey x509-proxy-key.pem \
--load-certificate x509-client.pem --template proxy.tmpl \
--outfile x509-proxy.pem
...
-@end example
+@end smallexample
Then start the server again:
-@example
+@smallexample
$ gnutls-serv --http \
--x509cafile x509-ca.pem \
--x509keyfile x509-server-key.pem \
--x509certfile x509-server.pem
-@end example
+@end smallexample
Try connecting to the server using your web browser. Note that the
server listens to port 5556 by default.
@@ -674,73 +678,73 @@ While you are at it, to allow connections using DSA, you can also
create a DSA key and certificate for the server. These credentials
will be used in the final example below.
-@example
+@smallexample
$ certtool --generate-privkey --dsa > x509-server-key-dsa.pem
$ certtool --generate-certificate --load-privkey x509-server-key-dsa.pem \
--load-ca-certificate x509-ca.pem --load-ca-privkey x509-ca-key.pem \
--template server.tmpl --outfile x509-server-dsa.pem
...
-@end example
+@end smallexample
The next step is to create OpenPGP credentials for the server.
-@example
+@smallexample
gpg --gen-key
...enter whatever details you want, use 'test.gnutls.org' as name...
-@end example
+@end smallexample
Make a note of the OpenPGP key identifier of the newly generated key,
here it was @code{5D1D14D8}. You will need to export the key for
GnuTLS to be able to use it.
-@example
+@smallexample
gpg -a --export 5D1D14D8 > openpgp-server.txt
gpg --export 5D1D14D8 > openpgp-server.bin
gpg --export-secret-keys 5D1D14D8 > openpgp-server-key.bin
gpg -a --export-secret-keys 5D1D14D8 > openpgp-server-key.txt
-@end example
+@end smallexample
Let's start the server with support for OpenPGP credentials:
-@example
+@smallexample
gnutls-serv --http \
--pgpkeyfile openpgp-server-key.txt \
--pgpcertfile openpgp-server.txt
-@end example
+@end smallexample
The next step is to add support for SRP authentication.
-@example
+@smallexample
srptool --create-conf srp-tpasswd.conf
srptool --passwd-conf srp-tpasswd.conf --username jas --passwd srp-passwd.txt
Enter password: [TYPE "foo"]
-@end example
+@end smallexample
Start the server with SRP support:
-@example
+@smallexample
gnutls-serv --http \
--srppasswdconf srp-tpasswd.conf \
--srppasswd srp-passwd.txt
-@end example
+@end smallexample
Let's also add support for PSK.
-@example
+@smallexample
$ psktool --passwd psk-passwd.txt
-@end example
+@end smallexample
Start the server with PSK support:
-@example
+@smallexample
gnutls-serv --http \
--pskpasswd psk-passwd.txt
-@end example
+@end smallexample
Finally, we start the server with all the earlier parameters and you
get this command:
-@example
+@smallexample
gnutls-serv --http \
--x509cafile x509-ca.pem \
--x509keyfile x509-server-key.pem \
@@ -752,7 +756,7 @@ gnutls-serv --http \
--srppasswdconf srp-tpasswd.conf \
--srppasswd srp-passwd.txt \
--pskpasswd psk-passwd.txt
-@end example
+@end smallexample
@menu
* Example server PSK connection::
@@ -763,8 +767,8 @@ gnutls-serv --http \
@cindex PSK server
To set up a PSK server with @code{gnutls-serv} you need to create PSK
-password file (@pxref{Invoking psktool}). In the example below, I
-type @code{password} at the prompt.
+password file. This is illustrated in the example below, where a password
+is provided at the prompt.
@smallexample
$ ./psktool -u psk_identity -p psks.txt
@@ -785,8 +789,8 @@ Set static Diffie-Hellman parameters, consider --dhparams.
Echo Server ready. Listening to port '5556'.
@end smallexample
-You can now connect to the server using a PSK client (@pxref{Example
-client PSK connection}).
+You can now connect to the server using a PSK client as in @ref{Example
+client PSK connection}.
@node Invoking psktool
@section Invoking psktool
@@ -794,7 +798,7 @@ client PSK connection}).
This is a program to manage @acronym{PSK} username and keys.
-@verbatim
+@smallexample
PSKtool help
Usage : psktool [options]
-u, --username username
@@ -803,7 +807,7 @@ Usage : psktool [options]
-s, --keysize SIZE specify the key size in bytes.
-v, --version prints the program's version number
-h, --help shows this help text
-@end verbatim
+@end smallexample
Normally the file will generate random keys for the indicated username.
@@ -822,38 +826,31 @@ Traditionally @emph{libsrp} used two files. One called @code{tpasswd}
which holds usernames and verifiers, and @code{tpasswd.conf} which
holds generators and primes.
-How to use srptool:
-
-@itemize
+@subsection How to use srptool
-@item
To create tpasswd.conf which holds the g and n values for
@acronym{SRP} protocol (generator and a large prime), run:
-@example
+@smallexample
$ srptool --create-conf /etc/tpasswd.conf
-@end example
+@end smallexample
-@item
This command will create /etc/tpasswd and will add user 'test' (you
will also be prompted for a password). Verifiers are stored by
default in the way libsrp expects.
-@example
+@smallexample
$ srptool --passwd /etc/tpasswd \
--passwd-conf /etc/tpasswd.conf -u test
-@end example
+@end smallexample
-@item
This command will check against a password. If the password matches
the one in /etc/tpasswd you will get an ok.
-@example
+@smallexample
$ srptool --passwd /etc/tpasswd \
--passwd-conf /etc/tpasswd.conf --verify -u test
-@end example
-
-@end itemize
+@end smallexample
@node Invoking p11tool
@section Invoking p11tool
@@ -864,9 +861,9 @@ The @file{p11tool} is a program that helps with accessing tokens
and security modules that support the PKCS #11 API. It requires
the individual PKCS #11 modules to be loaded either with the
@code{--provider} option, or by setting up the GnuTLS configuration
-file for PKCS #11 as in @ref{sec:pkcs11}.
+file for PKCS #11 as in @ref{Hardware tokens}.
-@verbatim
+@example
p11tool help
Usage: p11tool [options]
@@ -908,38 +905,34 @@ Usage: p11tool [options]
--outfile FILE Output file.
-d, --debug LEVEL specify the debug level. Default is 1.
-h, --help shows this help text
-@end verbatim
+@end example
After being provided the available PKCS #11 modules, it can list all tokens
available in your system, the objects on the tokens, and perform operations
on them.
-Some examples on how to use p11tool:
+Some examples on how to use p11tool are illustrated in the following paragraphs.
-@itemize
-
-@item List all tokens
-@example
+@subsection List all tokens
+@smallexample
$ p11tool --list-tokens
-@end example
+@end smallexample
-@item List all objects
-@example
+@subsection List all objects
+@smallexample
$ p11tool --login --list-all
-@end example
+@end smallexample
-@item To export an object
-@example
+@subsection Exporting an object
+@smallexample
$ p11tool --login --export pkcs11:(OBJECT URL)
-@end example
+@end smallexample
+Note however that typically PKCS #11 private key objects are not allowed
+to be extracted from the token.
-@item To copy an object to a token
-@example
+@subsection Copy an object to a token
+@smallexample
$ p11tool --login --write pkcs11:(TOKEN URL) \
--load-certificate cert.pem --label "my_cert"
-@end example
-
-@end itemize
+@end smallexample
-Note that typically PKCS #11 private key objects are not allowed
-to be extracted from the token.
diff --git a/doc/cha-support.texi b/doc/cha-support.texi
new file mode 100644
index 0000000000..273c30e990
--- /dev/null
+++ b/doc/cha-support.texi
@@ -0,0 +1,216 @@
+@node Support
+@appendix Support
+
+@menu
+* Getting help::
+* Commercial Support::
+* Downloading and Installing::
+* Bug Reports::
+* Contributing::
+@end menu
+
+@node Getting help
+@section Getting Help
+
+A mailing list where users may help each other exists, and you can
+reach it by sending e-mail to @email{help-gnutls@@gnu.org}. Archives
+of the mailing list discussions, and an interface to manage
+subscriptions, is available through the World Wide Web at
+@url{http://lists.gnu.org/mailman/listinfo/help-gnutls}.
+
+A mailing list for developers are also available, see
+@url{http://www.gnu.org/software/gnutls/lists.html}.
+Bug reports should be sent to @email{bug-gnutls@@gnu.org}, see
+@ref{Bug Reports}.
+
+@node Commercial Support
+@section Commercial Support
+
+Commercial support is available for users of GnuTLS. The kind of
+support that can be purchased may include:
+
+@itemize
+
+@item Implement new features.
+Such as a new TLS extension.
+
+@item Port GnuTLS to new platforms.
+This could include porting to an embedded platforms that may need
+memory or size optimization.
+
+@item Integrating TLS as a security environment in your existing project.
+
+@item System design of components related to TLS.
+
+@end itemize
+
+If you are interested, please write to:
+
+@verbatim
+Simon Josefsson Datakonsult
+Hagagatan 24
+113 47 Stockholm
+Sweden
+
+E-mail: simon@josefsson.org
+@end verbatim
+
+If your company provides support related to GnuTLS and would like to
+be mentioned here, contact the authors using the address at @ref{Bug Reports}.
+
+@node Downloading and Installing
+@section Downloading and Installing
+@cindex Installation
+@cindex Download
+
+GnuTLS is available for download at:
+@url{http://www.gnutls.org/download.html}
+
+GnuTLS uses a Linux-like development cycle: even minor version numbers
+indicate a stable release and a odd minor version number indicates a
+development release. For example, GnuTLS 1.6.3 denote a stable
+release since 6 is even, and GnuTLS 1.7.11 denote a development
+release since 7 is odd.
+
+GnuTLS depends on Libgcrypt,
+and you will need to install Libgcrypt
+before installing GnuTLS. Libgcrypt is available from
+@url{ftp://ftp.gnupg.org/gcrypt/libgcrypt}. Libgcrypt needs another
+library, libgpg-error, and you need to install libgpg-error before
+installing Libgcrypt. Libgpg-error is available from
+@url{ftp://ftp.gnupg.org/gcrypt/libgpg-error}.
+
+Don't forget to verify the cryptographic signature after downloading
+source code packages.
+
+The package is then extracted, configured and built like many other
+packages that use Autoconf. For detailed information on configuring
+and building it, refer to the @file{INSTALL} file that is part of the
+distribution archive. Typically you invoke @code{./configure} and
+then @code{make check install}. There are a number of compile-time
+parameters, as discussed below.
+
+The compression library, libz, is an optional dependency.
+You can get libz from @url{http://www.zlib.net/}.
+
+The X.509 part of GnuTLS needs ASN.1 functionality, from a library
+called libtasn1. A copy of libtasn1 is included in GnuTLS. If you
+want to install it separately (e.g., to make it possibly to use
+libtasn1 in other programs), you can get it from
+@url{http://www.gnu.org/software/gnutls/download.html}.
+The OpenPGP part of GnuTLS uses a stripped down version of OpenCDK for
+parsing OpenPGP packets.
+
+A few @code{configure} options may be relevant, summarized below.
+They disable or enable particular features.
+
+@verbatim
+--disable-srp-authentication
+--disable-psk-authentication
+--disable-anon-authentication
+--disable-extra-pki
+--disable-openpgp-authentication
+--disable-openssl-compatibility
+--without-p11-kit
+@end verbatim
+
+For the complete list, refer to the output from @code{configure --help}.
+
+@node Bug Reports
+@section Bug Reports
+@cindex Reporting Bugs
+
+If you think you have found a bug in GnuTLS, please investigate it and
+report it.
+
+@itemize @bullet
+
+@item Please make sure that the bug is really in GnuTLS, and
+preferably also check that it hasn't already been fixed in the latest
+version.
+
+@item You have to send us a test case that makes it possible for us to
+reproduce the bug.
+
+@item You also have to explain what is wrong; if you get a crash, or
+if the results printed are not good and in that case, in what way.
+Make sure that the bug report includes all information you would need
+to fix this kind of bug for someone else.
+
+@end itemize
+
+Please make an effort to produce a self-contained report, with
+something definite that can be tested or debugged. Vague queries or
+piecemeal messages are difficult to act on and don't help the
+development effort.
+
+If your bug report is good, we will do our best to help you to get a
+corrected version of the software; if the bug report is poor, we won't
+do anything about it (apart from asking you to send better bug
+reports).
+
+If you think something in this manual is unclear, or downright
+incorrect, or if the language needs to be improved, please also send a
+note.
+
+Send your bug report to:
+
+@center @samp{bug-gnutls@@gnu.org}
+
+@node Contributing
+@section Contributing
+@cindex Contributing
+@cindex Hacking
+
+If you want to submit a patch for inclusion -- from solve a typo you
+discovered, up to adding support for a new feature -- you should
+submit it as a bug report, using the process in @ref{Bug Reports}. There are some
+things that you can do to increase the chances for it to be included
+in the official package.
+
+Unless your patch is very small (say, under 10 lines) we require that
+you assign the copyright of your work to the Free Software Foundation.
+This is to protect the freedom of the project. If you have not
+already signed papers, we will send you the necessary information when
+you submit your contribution.
+
+For contributions that doesn't consist of actual programming code, the
+only guidelines are common sense. Use it.
+
+For code contributions, a number of style guides will help you:
+
+@itemize @bullet
+
+@item Coding Style.
+Follow the GNU Standards document.
+@c (@pxref{top, GNU Coding Standards,,standards}).
+
+If you normally code using another coding standard, there is no
+problem, but you should use @samp{indent} to reformat the code
+@c (@pxref{top, GNU Indent,, indent})
+before submitting your work.
+
+@item Use the unified diff format @samp{diff -u}.
+
+@item Return errors.
+No reason whatsoever should abort the execution of the library. Even
+memory allocation errors, e.g. when malloc return NULL, should work
+although result in an error code.
+
+@item Design with thread safety in mind.
+Don't use global variables. Don't even write to per-handle global
+variables unless the documented behaviour of the function you write is
+to write to the per-handle global variable.
+
+@item Avoid using the C math library.
+It causes problems for embedded implementations, and in most
+situations it is very easy to avoid using it.
+
+@item Document your functions.
+Use comments before each function headers, that, if properly
+formatted, are extracted into Texinfo manuals and GTK-DOC web pages.
+
+@item Supply a ChangeLog and NEWS entries, where appropriate.
+
+@end itemize
+
diff --git a/doc/cha-tls-app.texi b/doc/cha-tls-app.texi
index a34d891a93..dbfad72120 100644
--- a/doc/cha-tls-app.texi
+++ b/doc/cha-tls-app.texi
@@ -3,7 +3,7 @@
This chapter is intended to provide some hints on how to use the
@acronym{TLS} over simple custom made application protocols. The
-discussion below mainly refers to the @emph{TCP/IP} transport layer
+discussion below mainly refers to the @acronym{TCP/IP} transport layer
but may be extended to other ones too.
@menu
diff --git a/doc/errcodes.c b/doc/errcodes.c
index 915ae66fc5..ff01e06295 100644
--- a/doc/errcodes.c
+++ b/doc/errcodes.c
@@ -28,6 +28,11 @@
#include <string.h>
#include <gnutls/gnutls.h>
+static void main_latex(void);
+static int main_texinfo (void);
+
+#define MAX_CODES 600
+
typedef struct
{
char name[128];
@@ -43,19 +48,48 @@ compar (const void *_n1, const void *_n2)
return strcmp (n1->name, n2->name);
}
+static const char headers[] = "\\tablefirsthead{%\n"
+ "\\hline\n"
+ "\\multicolumn{1}{|c}{Error code} &\n"
+ "\\multicolumn{1}{c|}{Description} \\\\\n"
+ "\\hline}\n"
+ "\\tablehead{%\n"
+ "\\hline\n"
+ "\\multicolumn{2}{|l|}{\\small\\sl continued from previous page}\\\\\n"
+ "\\hline\n"
+ "\\multicolumn{1}{|c}{Error code} &\n"
+ "\\multicolumn{1}{c|}{Description} \\\\\n"
+ "\\hline}\n"
+ "\\tabletail{%\n"
+ "\\hline\n"
+ "\\multicolumn{2}{|r|}{\\small\\sl continued on next page}\\\\\n"
+ "\\hline}\n"
+ "\\tablelasttail{\\hline}\n"
+ "\\bottomcaption{The error codes table}\n\n";
+
int
main (int argc, char *argv[])
{
+ if (argc > 1)
+ main_latex();
+ else
+ main_texinfo();
+
+ return 0;
+}
+
+static int main_texinfo (void)
+{
int i, j;
const char *desc;
const char *_name;
- error_name names_to_sort[400]; /* up to 400 names */
+ error_name names_to_sort[MAX_CODES]; /* up to MAX_CODES names */
printf ("@table @code\n");
memset (names_to_sort, 0, sizeof (names_to_sort));
j = 0;
- for (i = 0; i > -400; i--)
+ for (i = 0; i > -MAX_CODES; i--)
{
_name = gnutls_strerror_name (i);
if (_name == NULL)
@@ -82,3 +116,70 @@ main (int argc, char *argv[])
return 0;
}
+
+static char* escape_string( const char* str, char* buffer, int buffer_size)
+{
+int i = 0, j = 0;
+
+
+while( str[i] != 0 && j <buffer_size - 1) {
+ if (str[i]=='_') {
+ buffer[j++] = '\\';
+ buffer[j++] = '_';
+ } else if (str[i]=='#') {
+ buffer[j++] = '\\';
+ buffer[j++] = '#';
+ } else {
+ buffer[j++] = str[i];
+ }
+ i++;
+};
+
+buffer[j] = 0;
+
+return buffer;
+
+}
+
+static void main_latex(void)
+{
+int i, j;
+static char buffer1[500];
+static char buffer2[500];
+const char* desc;
+const char* _name;
+error_name names_to_sort[MAX_CODES]; /* up to MAX_CODES names */
+
+puts( headers);
+
+printf("\\begin{supertabular}{|l|p{6.3cm}|}\n");
+
+memset( names_to_sort, 0, sizeof(names_to_sort));
+j=0;
+for (i=0;i>-MAX_CODES;i--)
+{
+ _name = gnutls_strerror_name(i);
+ if ( _name == NULL) continue;
+
+ strcpy( names_to_sort[j].name, _name);
+ names_to_sort[j].error_index = i;
+ j++;
+}
+
+qsort( names_to_sort, j, sizeof(error_name), compar);
+
+for (i=0;i<j;i++)
+{
+ _name = names_to_sort[i].name;
+ desc = gnutls_strerror( names_to_sort[i].error_index);
+ if (desc == NULL || _name == NULL) continue;
+
+ printf( "{\\tiny{%s}} & %s", escape_string(_name, buffer1, sizeof(buffer1)), escape_string(desc, buffer2, sizeof(buffer2)));
+ printf( "\\\\\n");
+}
+
+printf("\\end{supertabular}\n\n");
+
+return;
+
+}
diff --git a/doc/examples/ex-client1.c b/doc/examples/ex-client1.c
index 4d7c94734f..b5b7665845 100644
--- a/doc/examples/ex-client1.c
+++ b/doc/examples/ex-client1.c
@@ -40,7 +40,7 @@ main (void)
gnutls_init (&session, GNUTLS_CLIENT);
/* Use default priorities */
- gnutls_priority_set_direct (session, "PERFORMANCE:+ANON-DH:!ARCFOUR-128",
+ gnutls_priority_set_direct (session, "PERFORMANCE:+ANON-ECDH:+ANON-DH:!ARCFOUR-128",
NULL);
/* put the anonymous credentials to the current session
diff --git a/doc/examples/ex-pkcs11-list.c b/doc/examples/ex-pkcs11-list.c
index 2f222bc7e1..0c16a3489e 100644
--- a/doc/examples/ex-pkcs11-list.c
+++ b/doc/examples/ex-pkcs11-list.c
@@ -16,8 +16,8 @@ main ()
obj_list_size = 0;
ret = gnutls_pkcs11_obj_list_import_url (NULL, &obj_list_size, URL,
- GNUTLS_PKCS11_OBJ_ATTR_CRT_WITH_PRIVKEY,
- 0);
+ GNUTLS_PKCS11_OBJ_ATTR_CRT_WITH_PRIVKEY,
+ 0);
if (ret < 0 && ret != GNUTLS_E_SHORT_MEMORY_BUFFER)
return -1;
diff --git a/doc/examples/ex-serv-anon.c b/doc/examples/ex-serv-anon.c
index 88f38acfef..ade01f4a54 100644
--- a/doc/examples/ex-serv-anon.c
+++ b/doc/examples/ex-serv-anon.c
@@ -35,7 +35,7 @@ initialize_tls_session (void)
gnutls_init (&session, GNUTLS_SERVER);
- gnutls_priority_set_direct (session, "NORMAL:+ANON-DH", NULL);
+ gnutls_priority_set_direct (session, "NORMAL:+ANON-ECDH:+ANON-DH", NULL);
gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
diff --git a/doc/gnutls.texi b/doc/gnutls.texi
index f81fdf6f6b..66368dd1de 100644
--- a/doc/gnutls.texi
+++ b/doc/gnutls.texi
@@ -67,6 +67,10 @@ Documentation License''.
@c (@pxref{Bibliography})
@end macro
+@macro funcref{ref}
+@ref{\ref\}
+@end macro
+
@contents
@ifnottex
@@ -86,6 +90,8 @@ Documentation License''.
* How to use TLS in application protocols::
* Included programs::
* Internal architecture of GnuTLS::
+* Support::
+* Error codes::
* Function reference::
* Supported ciphersuites in GnuTLS::
* Copying Information::
@@ -115,6 +121,10 @@ Documentation License''.
@c appendices
+@include cha-support.texi
+
+@include cha-errors.texi
+
@include cha-functions.texi
@include cha-ciphersuites.texi
diff --git a/doc/latex/Makefile.am b/doc/latex/Makefile.am
new file mode 100644
index 0000000000..1e86cf3817
--- /dev/null
+++ b/doc/latex/Makefile.am
@@ -0,0 +1,105 @@
+TEX_OBJECTS = gnutls.tex macros.tex fdl.tex cover.tex gnutls.bib
+
+GEN_TEX_OBJECTS = cha-preface.tex cha-library.tex cha-intro-tls.tex cha-auth.tex \
+ cha-cert-auth.tex cha-gtls-app.tex cha-tls-app.tex cha-programs.tex cha-support.tex \
+ cha-functions.tex error_codes.tex cha-ciphersuites.tex algorithms.tex \
+ cha-errors.tex
+
+cha-preface.tex: ../cha-preface.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-library.tex: ../cha-library.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-intro-tls.tex: ../cha-intro-tls.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-auth.tex: ../cha-auth.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-cert-auth.tex: ../cha-cert-auth.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-gtls-app.tex: ../cha-gtls-app.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-tls-app.tex: ../cha-tls-app.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-programs.tex: ../cha-programs.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-support.tex: ../cha-support.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-functions.tex: ../cha-functions.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-errors.tex: ../cha-errors.texi
+ ../scripts/mytexi2latex $< > $@
+
+cha-ciphersuites.tex: ../cha-ciphersuites.texi
+ ../scripts/mytexi2latex $< > $@
+
+error_codes.tex: $(top_srcdir)/lib/gnutls_errors.c $(srcdir)/../errcodes
+ $(builddir)/../errcodes --latex > $@-tmp
+ mv -f $@-tmp $@
+
+algorithms.tex: $(srcdir)/../printlist.c $(builddir)/../printlist
+ $(builddir)/../printlist --latex > $@-tmp
+ mv -f $@-tmp $@
+
+gnutls-api.tex: $(srcdir)/../../lib/*.c $(srcdir)/../../lib/ext/*.c $(srcdir)/../../lib/auth/*.c $(srcdir)/../../lib/algorithms/*.c
+ echo "" > $@-tmp
+ for i in $^; do \
+ echo -n "Creating documentation for file $$i... " && \
+ $(srcdir)/../scripts/gdoc -tex $$i >> $@-tmp && \
+ echo "ok"; \
+ done
+ $(srcdir)/../scripts/sort1.pl < $@-tmp > $@-tmp2
+ rm -f $@-tmp
+ mv -f $@-tmp2 $@
+
+x509-api.tex: $(srcdir)/../../lib/x509/*.c
+ echo "" > $@-tmp
+ for i in $^; do \
+ echo -n "Creating documentation for file $$i... " && \
+ $(srcdir)/../scripts/gdoc -tex $$i >> $@-tmp && \
+ echo "ok"; \
+ done
+ $(srcdir)/../scripts/sort1.pl < $@-tmp > $@-tmp2
+ rm -f $@-tmp
+ mv -f $@-tmp2 $@
+
+pgp-api.tex: $(srcdir)/../../lib/openpgp/*.c
+ echo "" > $@-tmp
+ for i in $^; do \
+ echo -n "Creating documentation for file $$i... " && \
+ $(srcdir)/../scripts/gdoc -tex $$i >> $@-tmp && \
+ echo "ok"; \
+ done
+ $(srcdir)/../scripts/sort1.pl < $@-tmp > $@-tmp2
+ rm -f $@-tmp
+ mv -f $@-tmp2 $@
+
+extra-api.tex: $(srcdir)/../../libextra/gnutls_extra.c
+ echo "" > $@-tmp
+ for i in $^; do \
+ echo -n "Creating documentation for file $$i... " && \
+ $(srcdir)/../scripts/gdoc -tex $$i >> $@-tmp && \
+ echo "ok"; \
+ done
+ $(srcdir)/../scripts/sort1.pl < $@-tmp > $@-tmp2
+ rm -f $@-tmp
+ mv -f $@-tmp2 $@
+
+SOURCE_GEN_FILES = extra-api.tex pgp-api.tex x509-api.tex gnutls-api.tex
+
+gnutls.pdf: $(TEX_OBJECTS) $(GEN_TEX_OBJECTS) $(SOURCE_GEN_FILES)
+ -pdflatex gnutls.tex
+ -bibtex gnutls
+ -makeindex gnutls.idx
+ -pdflatex gnutls.tex && pdflatex gnutls.tex
+
+clean-am:
+ rm -f $(GEN_TEX_OBJECTS) $(SOURCE_GEN_FILES) gnutls.aux gnutls.bbl gnutls.blg gnutls.idx gnutls.ilg gnutls.ind gnutls.log gnutls.out gnutls.toc
diff --git a/doc/latex/cover.tex.in b/doc/latex/cover.tex.in
new file mode 100644
index 0000000000..0c51e18fce
--- /dev/null
+++ b/doc/latex/cover.tex.in
@@ -0,0 +1,59 @@
+\begin{latexonly}
+
+\thispagestyle{empty}
+
+\hspace{\linewidth}
+\hspace{-1.9cm}
+\includegraphics[height=1.3cm]{../gnutls-logo}
+\vspace{-.4cm}
+\\
+\HRule
+\vspace{.3cm}
+\\
+\begin{tabular}{l@{\extracolsep{3cm}}p{7cm}}
+{\Large{GNUTLS}}
+&
+\vspace{-.6cm}
+\begin{flushright}
+a Transport Layer Security Library\\
+This document applies to GnuTLS @VERSION@
+\end{flushright}
+\end{tabular}
+
+\vspace*{\stretch{2}}
+
+\begin{flushright}
+by Nikos Mavrogiannopoulos and Simon Josefsson
+\end{flushright}
+\vspace{-0.5cm}
+\HRule
+
+\end{latexonly}
+
+\begin{htmlonly}
+
+{\Large{GNUTLS}}
+\begin{flushright}
+a Transport Layer Security Library\\
+This document applies to GnuTLS @VERSION@
+\end{flushright}
+
+\end{htmlonly}
+
+\newpage
+
+
+\vspace*{\stretch{2}}
+
+\begin{flushleft}
+\par
+Copyright \copyright\ 2011 Free Software Foundation\\
+\par
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+\end{flushleft}
+
diff --git a/doc/latex/fdl.tex b/doc/latex/fdl.tex
new file mode 100644
index 0000000000..40a4a686eb
--- /dev/null
+++ b/doc/latex/fdl.tex
@@ -0,0 +1,563 @@
+%---------------------------------------------------------------------
+\chapter*{\rlap{GNU Free Documentation License}}
+\phantomsection % so hyperref creates bookmarks
+\addcontentsline{toc}{chapter}{GNU Free Documentation License}
+%\label{label_fdl}
+
+ \begin{center}
+
+ Version 1.3, 3 November 2008
+
+
+ Copyright \copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+
+ \bigskip
+
+ <http://fsf.org/>
+
+ \bigskip
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+\end{center}
+
+
+\begin{center}
+{\bf\large Preamble}
+\end{center}
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document ``free'' in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+\begin{center}
+{\Large\bf 1. APPLICABILITY AND DEFINITIONS\par}
+\phantomsection
+\addcontentsline{toc}{section}{1. APPLICABILITY AND DEFINITIONS}
+\end{center}
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``\textbf{Document}'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``\textbf{you}''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A ``\textbf{Modified Version}'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``\textbf{Secondary Section}'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``\textbf{Invariant Sections}'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The ``\textbf{Cover Texts}'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A ``\textbf{Transparent}'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``\textbf{Opaque}''.
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The ``\textbf{Title Page}'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The ``\textbf{publisher}'' means any person or entity that distributes
+copies of the Document to the public.
+
+A section ``\textbf{Entitled XYZ}'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``\textbf{Acknowledgements}'',
+``\textbf{Dedications}'', ``\textbf{Endorsements}'', or ``\textbf{History}''.)
+To ``\textbf{Preserve the Title}''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+\begin{center}
+{\Large\bf 2. VERBATIM COPYING\par}
+\phantomsection
+\addcontentsline{toc}{section}{2. VERBATIM COPYING}
+\end{center}
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section~3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+\begin{center}
+{\Large\bf 3. COPYING IN QUANTITY\par}
+\phantomsection
+\addcontentsline{toc}{section}{3. COPYING IN QUANTITY}
+\end{center}
+
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+\begin{center}
+{\Large\bf 4. MODIFICATIONS\par}
+\phantomsection
+\addcontentsline{toc}{section}{4. MODIFICATIONS}
+\end{center}
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+\begin{itemize}
+\item[A.]
+ Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+
+\item[B.]
+ List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+
+\item[C.]
+ State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+\item[D.]
+ Preserve all the copyright notices of the Document.
+
+\item[E.]
+ Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+\item[F.]
+ Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+
+\item[G.]
+ Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+
+\item[H.]
+ Include an unaltered copy of this License.
+
+\item[I.]
+ Preserve the section Entitled ``History'', Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled ``History'' in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+
+\item[J.]
+ Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the ``History'' section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+
+\item[K.]
+ For any section Entitled ``Acknowledgements'' or ``Dedications'',
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+
+\item[L.]
+ Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+
+\item[M.]
+ Delete any section Entitled ``Endorsements''. Such a section
+ may not be included in the Modified Version.
+
+\item[N.]
+ Do not retitle any existing section to be Entitled ``Endorsements''
+ or to conflict in title with any Invariant Section.
+
+\item[O.]
+ Preserve any Warranty Disclaimers.
+\end{itemize}
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+\begin{center}
+{\Large\bf 5. COMBINING DOCUMENTS\par}
+\phantomsection
+\addcontentsline{toc}{section}{5. COMBINING DOCUMENTS}
+\end{center}
+
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section~4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all sections
+Entitled ``Endorsements''.
+
+\begin{center}
+{\Large\bf 6. COLLECTIONS OF DOCUMENTS\par}
+\phantomsection
+\addcontentsline{toc}{section}{6. COLLECTIONS OF DOCUMENTS}
+\end{center}
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+\begin{center}
+{\Large\bf 7. AGGREGATION WITH INDEPENDENT WORKS\par}
+\phantomsection
+\addcontentsline{toc}{section}{7. AGGREGATION WITH INDEPENDENT WORKS}
+\end{center}
+
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section~3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+\begin{center}
+{\Large\bf 8. TRANSLATION\par}
+\phantomsection
+\addcontentsline{toc}{section}{8. TRANSLATION}
+\end{center}
+
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section~4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section~4) to Preserve
+its Title (section~1) will typically require changing the actual
+title.
+
+
+\begin{center}
+{\Large\bf 9. TERMINATION\par}
+\phantomsection
+\addcontentsline{toc}{section}{9. TERMINATION}
+\end{center}
+
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+\begin{center}
+{\Large\bf 10. FUTURE REVISIONS OF THIS LICENSE\par}
+\phantomsection
+\addcontentsline{toc}{section}{10. FUTURE REVISIONS OF THIS LICENSE}
+\end{center}
+
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+
+\begin{center}
+{\Large\bf 11. RELICENSING\par}
+\phantomsection
+\addcontentsline{toc}{section}{11. RELICENSING}
+\end{center}
+
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+\begin{center}
+{\Large\bf ADDENDUM: How to use this License for your documents\par}
+\phantomsection
+\addcontentsline{toc}{section}{ADDENDUM: How to use this License for your documents}
+\end{center}
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+\bigskip
+\begin{quote}
+ Copyright \copyright{} YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+\end{quote}
+\bigskip
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with \dots\ Texts.'' line with this:
+
+\bigskip
+\begin{quote}
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+\end{quote}
+\bigskip
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+%---------------------------------------------------------------------
diff --git a/doc/latex/gnutls.bib b/doc/latex/gnutls.bib
new file mode 100644
index 0000000000..121c221b94
--- /dev/null
+++ b/doc/latex/gnutls.bib
@@ -0,0 +1,289 @@
+@Misc{ RFC2246,
+ author = "Tim Dierks and Christopher Allen",
+ title = "{The TLS Protocol Version 1.0}",
+ month = "January",
+ year = "1999",
+ note = "Available from http://www.ietf.org/rfc/rfc2246.txt",
+ url = "http://www.ietf.org/rfc/rfc2246.txt"
+}
+
+@misc{RFC3820,
+ author="Steven Tuecke and Von Welch and Doug Engert and Laura Pearlman and Mary Thompson",
+ title="Internet {X.509} Public Key Infrastructure {(PKI)} Proxy Certificate Profile",
+ month="June",
+ year=2004,
+ note = "Available from @url{http://www.ietf.org/rfc/rfc3820}",
+ url = "http://www.ietf.org/rfc/rfc3820"
+}
+
+@misc{RFC5746,
+ author="Eric Rescorla and Marsh Ray and Steve Dispensa and Nasko Oskov",
+ title = "Transport Layer Security {(TLS)} Renegotiation Indication Extension",
+ month ="February",
+ year=2010,
+ note = "Available from @url{http://www.ietf.org/rfc/rfc5746}",
+ url = "http://www.ietf.org/rfc/rfc5746"
+}
+
+@Misc{TLSTKT,
+ author = "Joseph Salowey and Hao Zhou and Pasi Eronen and Hannes Tschofenig",
+ title = "Transport Layer Security {(TLS)} Session Resumption without Server-Side State",
+ month="January"
+ year="2008"
+ note = "Available from @url{http://www.ietf.org/rfc/rfc5077}",
+ url = "http://www.ietf.org/rfc/rfc5077"
+}
+
+@Misc{PKCS11,
+ publisher = "RSA Laboratories",
+ title = "{PKCS \#11 Base Functionality v2.30: Cryptoki – Draft 4}",
+ url = "http://www.rsa.com",
+ month="July",
+ year=2009
+}
+
+@Misc{ECRYPT,
+ publisher = "European Network of Excellence in Cryptology II",
+ title = "{ECRYPT II Yearly Report on Algorithms and Keysizes (2009-2010)}",
+ url = "http://www.ecrypt.eu.org/documents/D.SPA.13.pdf".
+ year=2010
+}
+
+@misc{NISTSP80057,
+ title="{NIST Special Publication 800-57, Recommendation for Key Management - Part 1: General (Revised)}",
+ month="March",
+ year="2007",
+ url="http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57-Part1-revised2_Mar08-2007.pdf"
+}
+
+@Misc{ RFC5246,
+ author = "Tim Dierks and Eric Rescorla",
+ title = "{The TLS Protocol Version 1.2}",
+ month = "August",
+ year = "2008",
+ note = "Available from http://www.ietf.org/rfc/rfc5246.txt",
+ url = "http://www.ietf.org/rfc/rfc5246.txt"
+}
+
+@Misc{ WEGER,
+ author = "Arjen Lenstra and Xiaoyun Wang and Benne de Weger",
+ title = "{Colliding X.509 Certificates}",
+ publisher = "Cryptology ePrint Archive, Report 2005/067",
+ year = "2005",
+ note = "Available from http://eprint.iacr.org/",
+}
+
+@Misc{ RFC3749,
+ author = "Scott Hollenbeck",
+ title = "Transport Layer Security Protocol Compression Methods",
+ month = "May",
+ year = "2004",
+ note = "Available from http://www.ietf.org/rfc/rfc3749.txt",
+ url = "http://www.ietf.org/rfc/rfc3749.txt"
+}
+
+@Misc{ RFC4347,
+ author = "Eric Rescorla and Nagendra Modadugu",
+ title = "Datagram Transport Layer Security",
+ month = "April",
+ year = "2006",
+ note = "Available from http://www.ietf.org/rfc/rfc4347.txt",
+ url = "http://www.ietf.org/rfc/rfc4347.txt"
+}
+
+@Misc{ RFC4346,
+ author = "Tim Dierks and Eric Rescorla",
+ title = "The {TLS} Protocol Version 1.1",
+ month = "April",
+ year = "2006",
+ note = "Available from http://www.ietf.org/rfc/rfc4346.txt",
+ url = "http://www.ietf.org/rfc/rfc4346.txt"
+}
+
+@Misc{ RFC2440,
+ author = "Jon Callas and Lutz Donnerhacke and Hal Finney and Rodney Thayer",
+ title = "{OpenPGP} Message Format",
+ month = "November",
+ year = "1998",
+ note = "Available from http://www.ietf.org/rfc/rfc2440.txt",
+ url = "http://www.ietf.org/rfc/rfc2440.txt"
+}
+
+@Misc{ RFC2511,
+ author = "Michael Myers and Carlisle Adams and Dave Solo and David Kemp",
+ title = "Internet {X.509} Certificate Request Message Format",
+ month = "March",
+ year = "1999",
+ note = "Available from http://www.ietf.org/rfc/rfc2511.txt",
+ url = "http://www.ietf.org/rfc/rfc2511.txt"
+}
+
+@Misc{ RFC2817,
+ author = "Rohit Khare and Scott Lawrence",
+ title = "Upgrading to {TLS} Within {HTTP/1.1}",
+ month = "May",
+ year = "2000",
+ note = "Available from http://www.ietf.org/rfc/rfc2817.txt",
+ url = "http://www.ietf.org/rfc/rfc2817.txt"
+}
+
+@Misc{ RFC2818,
+ author = "Eric Rescola",
+ title = "{HTTP over TLS}",
+ month = "May",
+ year = "2000",
+ note = "Available from http://www.ietf.org/rfc/rfc2818.txt",
+ url = "http://www.ietf.org/rfc/rfc2818.txt"
+}
+
+@Misc{ RFC2945,
+ author = "Tom Wu",
+ title = "The {SRP} Authentication and Key Exchange System",
+ month = "September",
+ year = "2000",
+ note = "Available from http://www.ietf.org/rfc/rfc2945.txt",
+ url = "http://www.ietf.org/rfc/rfc2945.txt"
+}
+
+@Misc{ RFC2986,
+ author = "Magnus Nystrom and Burt Kaliski",
+ title = "{PKCS 10 v1.7:} Certification Request Syntax Specification",
+ month = "November",
+ year = "2000",
+ note = "Available from http://www.ietf.org/rfc/rfc2986.txt",
+ url = "http://www.ietf.org/rfc/rfc2986.txt"
+}
+
+@Misc{PKIX,
+ author = "Russell Housley and Tim Polk and Warwick Ford and David Solo",
+ title = "Internet {X.509} Public Key Infrastructure Certificate and Certificate Revocation List {(CRL)} Profile",
+ month = "April",
+ year = "2002",
+ note = "Available from http://www.ietf.org/rfc/rfc3280.txt",
+ url = "http://www.ietf.org/rfc/rfc3280.txt"
+}
+
+@Misc{ SSL3,
+ author = "Alan Freier and Philip Karlton and Paul Kocher",
+ title = "The {SSL} Protocol Version 3.0",
+ month = "November",
+ year = "1996",
+ note = "Available from http://wp.netscape.com/eng/ssl3/draft302.txt",
+ url = "http://wp.netscape.com/eng/ssl3/draft302.txt"
+}
+
+@Misc{ PKCS12,
+ author = "RSA Laboratories",
+ title = "{PKCS 12 v1.0}: Personal Information Exchange Syntax",
+ month = "June",
+ year = "1999"
+}
+
+@Misc{ RESCOLA,
+ author = "Eric Rescola",
+ title = "{SSL and TLS}: Designing and Building Secure Systems",
+ year = "2001"
+}
+
+@Misc{ TLSEXT,
+ author = "Simon Blake-Wilson and Magnus Nystrom and David Hopwood and Jan Mikkelsen and Tim Wright",
+ title = "Transport Layer Security {(TLS)} Extensions",
+ month = "June",
+ year = "2003",
+ note = "Available from http://www.ietf.org/rfc/rfc3546.txt",
+ url = "http://www.ietf.org/rfc/rfc3546.txt"
+}
+
+@Misc{ TLSSRP,
+ author = "David Taylor and Trevor Perrin and Tom Wu and Nikos Mavroyanopoulos",
+ title = "Using {SRP for TLS} Authentication",
+ month = "November",
+ year = "2007",
+ note = "Available from http://www.ietf.org/rfc/rfc5054.txt",
+ url = "http://www.ietf.org/rfc/rfc5054.txt"
+}
+
+@Misc{ RFC5056,
+ author = "Nicolas Williams",
+ title = "On the Use of Channel Bindings to Secure Channels",
+ month = "November",
+ year = "2007",
+ note = "Available from http://www.ietf.org/rfc/rfc5056.txt",
+ url = "http://www.ietf.org/rfc/rfc5056.txt"
+}
+
+@Misc{ RFC5929,
+ author = "Jeff Altman and Nicolas Williams and Larry Zhu",
+ title = "Channel Bindings for {TLS}",
+ month = "July",
+ year = "2010",
+ note = "Available from http://www.ietf.org/rfc/rfc5929.txt",
+ url = "http://www.ietf.org/rfc/rfc5929.txt"
+}
+
+@Misc{ TLSPSK,
+ author = "Pasi Eronen and Hannes Tschofenig",
+ title = "Pre-shared key Ciphersuites for {TLS}",
+ month = "December",
+ year = "2005",
+ note = "Available from http://www.ietf.org/rfc/rfc4279.txt",
+ url = "http://www.ietf.org/rfc/rfc4279.txt"
+}
+
+@Misc{ TLSPGP,
+ author = "Nikos Mavroyanopoulos",
+ title = "Using {OpenPGP keys for TLS} authentication",
+ month = "April",
+ year = "2004",
+ note = "Internet draft, work in progress. Available from http://www.normos.org/ietf/draft/draft-ietf-tls-openpgp-keys-05.txt",
+ url = "http://www.normos.org/ietf/draft/draft-ietf-tls-openpgp-keys-05.txt"
+}
+
+@Misc{ TLSCOMP,
+ author = "Scott Hollenbeck",
+ title = "Transport Layer Security Protocol Compression Methods",
+ month = "January",
+ year = "2004",
+ note = "Internet draft, work in progress. Available from http://www.ietf.org/rfc/rfc3749.txt",
+ url = "http://www.ietf.org/rfc/rfc3749.txt"
+}
+
+@Misc{ CBCATT,
+ author = "Bodo Moeller",
+ title = "Security of {CBC} Ciphersuites in {SSL/TLS}: Problems and Countermeasures",
+ year = "2002",
+ note = "Available from http://www.openssl.org/\~\ bodo/tls-cbc.txt",
+ url = "http://www.openssl.org/~bodo/tls-cbc.txt"
+}
+
+@Misc{ GUTPKI,
+ author = "Peter Gutmann",
+ title = "Everything you never wanted to know about {PKI} but were forced to find out",
+ year = "2002",
+ note = "Available from http://www.cs.auckland.ac.nz/\~\ pgut001/pubs/pkitutorial.pdf",
+ url = "http://www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf"
+}
+
+@Misc{ GPGH,
+ author = "Mike Ashley",
+ title = "The {GNU} Privacy Handbook",
+ year = "2002",
+ note = "Available from http://www.gnupg.org/gph/en/manual.pdf",
+ url = "http://www.gnupg.org/gph/en/manual.pdf"
+}
+
+@Misc{ TOMSRP,
+ author = "Tom Wu",
+ title = "The Stanford {SRP} Authentication Project",
+ note = "Available at http://srp.stanford.edu/",
+ url = "http://srp.stanford.edu/"
+}
+
+@Book{ STEVENS,
+ title = "{UNIX} Network Programming, Volume 1 0-13-490012-X",
+ author = "W. Richard Stevens",
+ publisher = "Prentice Hall",
+ year = "1998",
+ isbn = "0-13-490012-X"
+}
+
diff --git a/doc/latex/gnutls.tex b/doc/latex/gnutls.tex
new file mode 100644
index 0000000000..870b82e7aa
--- /dev/null
+++ b/doc/latex/gnutls.tex
@@ -0,0 +1,79 @@
+\documentclass{book}
+\bibliographystyle{plain}
+
+\usepackage{html}
+\usepackage{fancyhdr}
+\usepackage{graphicx}
+\usepackage{makeidx}
+\usepackage{supertabular}
+\usepackage{color}
+\usepackage{colortbl}
+\usepackage{fancyvrb}
+\usepackage{eurosans}
+\usepackage{parskip}
+\usepackage{hyperref}
+
+\hypersetup{
+ colorlinks,%
+ citecolor=blue,%
+ filecolor=blue,%
+ linkcolor=blue,%
+ urlcolor=blue
+}
+
+\input{macros}
+
+\makeindex
+
+\begin{document}
+
+\frontmatter
+
+\input{cover}
+
+\setcounter{tocdepth}{1}
+\tableofcontents
+
+\pagestyle{fancy}
+\fancyhead[RE]{\slshape \rightmark}
+\fancyhead[LO]{\slshape \leftmark}
+\fancyhead[RO,LE]{\empty}
+\fancyfoot[C]{\thepage}
+
+\input{cha-preface}
+
+\mainmatter
+\input{cha-library}
+
+\input{cha-intro-tls}
+
+\input{cha-auth}
+
+\input{cha-cert-auth}
+
+\input{cha-gtls-app}
+
+\input{cha-tls-app}
+
+\input{cha-programs}
+
+\appendix
+
+\input{cha-support}
+
+\input{cha-ciphersuites}
+
+\input{cha-errors}
+
+%\input{cha-functions}
+
+%\input{fdl}
+
+\backmatter
+
+\printindex
+
+\bibliography{gnutls}
+
+\end{document}
+
diff --git a/doc/latex/macros.tex b/doc/latex/macros.tex
new file mode 100644
index 0000000000..26df4799d4
--- /dev/null
+++ b/doc/latex/macros.tex
@@ -0,0 +1,45 @@
+\newcommand{\gnutls}{{\emph{GnuTLS}}}
+\newcommand{\gnutlse}{{\emph{GnuTLS-extra}}}
+\newcommand{\tlsI}{{\emph{TLS 1.0}}}
+\newcommand{\tlsII}{{\emph{TLS 1.1}}}
+\newcommand{\tls}{{\emph{TLS}}}
+\newcommand{\sslIII}{{\emph{SSL 3.0}}}
+\newcommand{\sslII}{{\emph{SSL 2.0}}}
+\newcommand{\ssl}{{\emph{SSL}}}
+\newcommand{\HRule}{\rule{\linewidth}{0.4mm}}
+
+\newcommand{\code}[1]{%
+ {\tt{#1}}%
+}
+
+\newcommand{\command}[1]{%
+ ``{\tt{#1}}''%
+}
+
+\newcommand{\myref}[1]{%
+ \autoref{#1}%
+}
+
+\newcommand{\file}[1]{%
+ ``{\tt{#1}}''%
+}
+
+\newcommand{\acronym}[1]{%
+ {#1}%
+}
+
+\newcommand{\examplefile}[1]{%
+ {\VerbatimInput[frame=single,numbers=left,numbersep=3pt,fontsize=\footnotesize]{#1}}%
+}
+
+\DefineVerbatimEnvironment{example}{Verbatim}%
+{numbers=left,frame=single,numbersep=3pt,fontsize=\footnotesize}
+
+\DefineVerbatimEnvironment{smallexample}{Verbatim}%
+{frame=single,numbersep=3pt,fontsize=\footnotesize}
+
+
+\newcommand{\funcref}[2]{%
+ %\hyperref[#2]{#1()}%
+ \code{#1}%
+}
diff --git a/doc/printlist.c b/doc/printlist.c
index 743ffdac06..f3b7c4a36d 100644
--- a/doc/printlist.c
+++ b/doc/printlist.c
@@ -26,8 +26,21 @@
#include <gnutls/x509.h>
#include <gnutls/openpgp.h>
+static void main_texinfo (void);
+static void main_latex(void);
+
int
-main (void)
+main (int argc, char *argv[])
+{
+ if (argc > 1)
+ main_latex();
+ else
+ main_texinfo();
+
+ return 0;
+}
+
+static void main_texinfo (void)
{
{
size_t i;
@@ -39,16 +52,18 @@ main (void)
gnutls_protocol_t version;
printf ("Available cipher suites:\n");
+
printf ("@multitable @columnfractions .60 .20 .20\n");
for (i = 0; (name = gnutls_cipher_suite_info
(i, id, &kx, &cipher, &mac, &version)); i++)
{
- printf ("@item %s\n@tab 0x%02x 0x%02x\n@tab %s\n",
+ printf ("@item %s\n@tab 0x%02X 0x%02X\n@tab %s\n",
name,
(unsigned char) id[0], (unsigned char) id[1],
gnutls_protocol_get_name (version));
}
printf ("@end multitable\n");
+
}
{
@@ -139,3 +154,78 @@ main (void)
printf ("@end itemize\n");
}
}
+
+static const char headers[] = "\\tablefirsthead{%\n"
+ "\\hline\n"
+ "Ciphersuite name & TLS ID & since\\\\\n"
+ "\\hline}\n"
+ "\\tablehead{%\n"
+ "\\hline\n"
+ "\\multicolumn{3}{|l|}{\\small\\sl continued from previous page}\\\\\n"
+ "\\hline\n"
+ "Ciphersuite name & TLS ID & since\\\\\n"
+ "\\hline}\n"
+ "\\tabletail{%\n"
+ "\\hline\n"
+ "\\multicolumn{3}{|r|}{\\small\\sl continued on next page}\\\\\n"
+ "\\hline}\n"
+ "\\tablelasttail{\\hline}\n"
+ "\\bottomcaption{The ciphersuites table}\n\n";
+
+static char* escape_string( const char* str)
+{
+static char buffer[500];
+int i = 0, j = 0;
+
+
+while( str[i] != 0 && j < sizeof(buffer) - 1) {
+ if (str[i]=='_') {
+ buffer[j++] = '\\';
+ buffer[j++] = '_';
+ } else {
+ buffer[j++] = str[i];
+ }
+ i++;
+};
+
+buffer[j] = 0;
+
+return buffer;
+
+}
+
+static void main_latex(void)
+{
+int i, j;
+const char* desc;
+const char* _name;
+
+puts( headers);
+
+printf("\\begin{supertabular}{|l|p{1.8cm}|p{1.6cm}|}\n");
+
+ {
+ size_t i;
+ const char *name;
+ char id[2];
+ gnutls_kx_algorithm_t kx;
+ gnutls_cipher_algorithm_t cipher;
+ gnutls_mac_algorithm_t mac;
+ gnutls_protocol_t version;
+
+ for (i = 0; (name = gnutls_cipher_suite_info
+ (i, id, &kx, &cipher, &mac, &version)); i++)
+ {
+ printf ("{\\small{%s}} & \\code{0x%02X 0x%02X} & %s",
+ escape_string(name),
+ (unsigned char) id[0], (unsigned char) id[1],
+ gnutls_protocol_get_name (version));
+ printf( "\\\\\n");
+ }
+ printf("\\end{supertabular}\n\n");
+
+ }
+
+return;
+
+}
diff --git a/doc/scripts/mytexi2latex b/doc/scripts/mytexi2latex
new file mode 100755
index 0000000000..7d1cb4ad29
--- /dev/null
+++ b/doc/scripts/mytexi2latex
@@ -0,0 +1,263 @@
+#!/usr/bin/perl
+
+use constant NORMAL => 0;
+use constant SKIP => 1;
+use constant ITEMIZE => 2;
+use constant VERBATIM => 3;
+use constant ENUMERATE => 4;
+use constant TABLE_ITEMIZE => 5;
+use constant MULTITABLE => 6;
+use constant EXAMPLE => 7;
+use constant SMALL_EXAMPLE => 8;
+use constant QUOTE => 9;
+
+sub unescape()
+{
+my $prefix=$_[0];
+my $suffix=$_[1];
+ $suffix =~ s/\\//g;
+ return "$prefix\{$suffix\}";
+}
+
+sub funcref()
+{
+my $prefix = $_[0];
+my $suffix=$_[0];
+ $suffix =~ s/\\//g;
+ return "\\funcref\{$prefix\}\{$suffix\}";
+}
+
+my $punescape = \&unescape;
+my $pfuncref = \&funcref;
+my $mode;
+my $num_args = $#ARGV + 1;
+
+if ($num_args != 1 || $ARGV[0] eq "-h" || $ARGV[0] eq "--help") {
+ print "Usage: " . "texi2latex infile\n";
+ exit 0;
+}
+open (FILE, "< $ARGV[0]") or die "Cannot open $ARGV[0]";
+
+my $match = "[\\w\\d-\\.\\/\\@\\:\_\\\\\#]";
+my $spacematch = "[\\s\\w\\d-\\.\\/\\@\\#\\:]";
+my $mathmatch = "[\\s\\w\\d-\\.\\/\\:\\(\\)\\+\\/\\^\\'\\=\{\}\\\\\\,]";
+my $underscorematch = "[\\s\\w\\d-\\.\\/\\@\\_\\\\\:\\~]";
+my $codematch = "[\\s\\w\\d-\\.\\/\\@\\_\\\\\:\\-\\\"\+\\%]";
+my ($line, $prev_mode);
+my ($verbatim, $label);
+while ($line = <FILE>) {
+ $verbatim = 0;
+
+ if ($mode == SKIP) {
+#print "%menu: $line";
+ if ($line =~ m/\@end /) {
+ $mode = NORMAL;
+ }
+ $prev_mode = $mode;
+ next;
+ } elsif ($mode == ITEMIZE) {
+#print "%itemize: $line";
+ if ($line =~ s/\@end itemize/\\end{itemize}/g) {
+ $mode = NORMAL;
+ }
+ $line =~ s/\@item (.+)/\\item $1/g;
+ $prev_mode = $mode;
+ } elsif ($mode == ENUMERATE) {
+ if ($line =~ s/\@end itemize/\\end{enumerate}/g) {
+ $mode = NORMAL;
+ }
+ if ($line =~ s/\@end enumerate/\\end{enumerate}/g) {
+ $mode = NORMAL;
+ }
+ $line =~ s/\@item(.*)/\\item $1/g;
+ $prev_mode = $mode;
+ } elsif ($mode == TABLE_ITEMIZE) {
+ if ($line =~ s/\@end table/\n\\end{itemize}/g) {
+ $mode = NORMAL;
+ }
+ chomp $line;
+ if ($line eq "") {
+ next;
+ }
+ $line .= "\n";
+
+ $line =~ s/\@item (.+)/\\item $1 /g;
+ $line =~ s/\@itemx (.+)/\\item $1 /g;
+
+ $prev_mode = $mode;
+ } elsif ($mode == MULTITABLE) {
+ if ($line =~ s/\@end multitable/\\\\\n\\hline\n\\end{tabular}/g) {
+ $mode = NORMAL;
+ } else {
+ chomp $line;
+ if ($line eq "") {
+ next;
+ }
+ $line .= "\n";
+ $line =~ s/\@tab/\&/g;
+ if ($line =~ m/\@headitem/) {
+ $line =~ s/\@headitem (.+)/$1\\\\\n\\hline\n\\hline/g;
+ } else {
+ if ($prev_mode != $mode) {
+ $line =~ s/\@item (.+)/$1/g;
+ $line =~ s/\@itemx (.+)/$1/g;
+ } else {
+ $line =~ s/\@item (.+)/\\\\\n\\hline\n$1/g;
+ $line =~ s/\@itemx (.+)/\\\\\n\\hline\n$1/g;
+ }
+ }
+ }
+ $prev_mode = $mode;
+ } elsif ($mode == VERBATIM) {
+ if ($line =~ s/\@end verbatim/\\end{verbatim}/g) {
+ $mode = NORMAL;
+ }
+ $verbatim = 1;
+ $prev_mode = $mode;
+ } elsif ($mode == QUOTE) {
+ if ($line =~ s/\@end quotation/\\end{quote}/g) {
+ $mode = NORMAL;
+ }
+ $prev_mode = $mode;
+ } elsif ($mode == EXAMPLE) {
+ if ($line =~ s/\@end example/\\end{example}/g) {
+ $mode = NORMAL;
+ }
+ $line =~ s/\@{/{/g;
+ $line =~ s/\@}/}/g;
+ $verbatim = 1;
+
+ $prev_mode = $mode;
+ } elsif ($mode == SMALL_EXAMPLE) {
+ if ($line =~ s/\@end smallexample/\\end{smallexample}/g) {
+ $mode = NORMAL;
+ }
+ $line =~ s/\@{/\{/g;
+ $line =~ s/\@}/\}/g;
+ $verbatim = 1;
+
+ $prev_mode = $mode;
+ } else {
+ $prev_mode = $mode;
+
+ $line =~ s/\@iftex/% /g;
+ $line =~ s/\@end iftex/% /g;
+ $line =~ s/\@anchor (.+)/\\label{$1}/g;
+ $line =~ s/\@anchor\{($spacematch+)\}/\\label{$1}/g;
+ if ($line =~ s/\@subsection (.+)/\\subsection{$1}/g) {
+ if ($label ne '') {
+ $line .= "\\label{$label}\n";
+ }
+ }
+
+ if ($line =~ s/\@section (.+)/\\section{$1}/g) {
+ if ($label ne '') {
+ $line .= "\\label{$label}\n";
+ }
+ }
+
+ if ($line =~ s/\@chapter (.+)/\\chapter{$1}/g) {
+ if ($label ne '') {
+ $line .= "\\label{$label}\n";
+ }
+ }
+ if ($line =~ s/\@appendix (.+)/\\chapter{$1}/g) {
+ if ($label ne '') {
+ $line .= "\\label{$label}\n";
+ }
+ }
+
+ if ($line =~ m/\@node (.+)/) {
+ $label = $1;
+ next;
+ } else {
+ $label = '';
+ }
+
+ if ($line =~ s/\@menu//g) {
+ $mode = SKIP;
+ next;
+ }
+ if ($line =~ s/\@ifnottex//g) {
+ $mode = SKIP;
+ next;
+ }
+ if ($line =~ s/\@itemize \@bullet/\\begin{itemize}/g) {
+ $mode = ITEMIZE;
+ }
+ if ($line =~ s/\@itemize/\\begin{itemize}/g) {
+ $mode = ITEMIZE;
+ }
+ if ($line =~ s/\@enumerate/\\begin{enumerate}/g) {
+ $mode = ENUMERATE;
+ }
+ if ($line =~ s/\@table .*/\n\\begin{itemize}/g) {
+ $mode = TABLE_ITEMIZE;
+ }
+ if ($line =~ s/\@multitable \@columnfractions ([\.\d]+) ([\.\d]+) ([\.\d]+)$/\n\\begin{tabular}{|p{3.3cm}|p{3.3cm}|p{4.3cm}|}\n\\hline\n/g) {
+ $mode = MULTITABLE;
+ }
+ if ($line =~ s/\@multitable \@columnfractions ([\.\d]+) ([\.\d]+) ([\.\d]+) ([\.\d]+) ([\.\d]+)$/\n\\begin{tabular}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{3cm}|}\n\\hline\n/g) {
+ $mode = MULTITABLE;
+ }
+ if ($line =~ s/\@example/\\begin{example}/g) {
+ $mode = EXAMPLE;
+ }
+ if ($line =~ s/\@smallexample/\\begin{smallexample}/g) {
+ $mode = SMALL_EXAMPLE;
+ }
+ if ($line =~ s/\@verbatim$/\\begin{verbatim}/g) {
+ $mode = VERBATIM;
+ }
+ if ($line =~ s/\@quotation$/\\begin{quote}/g) {
+ $mode = QUOTE;
+ }
+ }
+
+ if ($verbatim == 0) {
+ $line =~ s/\_/\\_/g;
+ $line =~ s/\~/\\~/g;
+ $line =~ s/\%/\\%/g;
+ $line =~ s/\#/\\\#/g;
+ $line =~ s/\@verbatiminclude (.*)/\\examplefile{\.\.\/$1}/g;
+ $line =~ s/\@image\{($match+)\,($match+)\}/\\includegraphics\[width\=$2\]\{\.\.\/$1\}/g;
+ $line =~ s/\@samp\{($spacematch+)\}/$1/g;
+ $line =~ s/\@strong\{/\{\\bf /g;
+ $line =~ s/\@c (.*)/\% $1/g;
+ $line =~ s/\@math\{($mathmatch+)\}/\$$1\$/g;
+ $line =~ s/\@acronym\{($spacematch+)\}/\\acronym{$1}/g;
+ $line =~ s/\s*\@xcite\{($match+)\}/~\\cite{$1}/g;
+ $line =~ s/\@footnote\{/\\footnote{/g;
+ $line =~ s/\@tindex (.+)/\\index{$1}/g;
+ if ($line =~ s/\@include (.+)/\\input{$1}/g) {
+ $line =~ s/\.texi/\.tex/g;
+ $line =~ s/(\\input)\{($underscorematch+)\}/$punescape->($1,$2)/ge;
+ }
+ $line =~ s/\@cindex (.+)/\\index{$1}/g;
+ $line =~ s/\@url\{($underscorematch+)\}/\\url{$1}/g;
+ #$line =~ s/\@euro/\\euro/g;
+ $line =~ s/\@euro\{\}/euro/g;
+ $line =~ s/\@file\{($spacematch+)\}/\\file{$1}/g;
+ $line =~ s/\@code\{($codematch+)\}/\\code{$1}/g;
+ $line =~ s/\@option\{($codematch+)\}/\\command{$1}/g;
+ $line =~ s/\@command\{($codematch+)\}/\\command{$1}/g;
+ $line =~ s/\@ref\{/\\myref\{/g;
+ $line =~ s/\@emph\{($spacematch+)\}/\\emph{$1}/g;
+ $line =~ s/\@xref\{/\\myref\{/g;
+ $line =~ s/\@funcref\{($codematch+)\}/$pfuncref->($1)/ge;
+ $line =~ s/\@pxref\{/\\myref\{/g;
+ $line =~ s/\@center (.*)/\\begin{center}\n$1\n\\end{center}/g;
+ if ($line =~ m/\@email/) {
+ $line =~ s/\@email\{(.+)\}/$1/g;
+ }
+ $line =~ s/\@\@/@/g;
+
+ #when a myref{} contains underscores remove them
+ $line =~ s/(\\myref)\{($underscorematch+)\}/$punescape->($1,$2)/ge;
+ }
+
+ print $line;
+}
+close (FILE);
+
+exit 0;
diff --git a/doc/scripts/sort1.pl b/doc/scripts/sort1.pl
new file mode 100755
index 0000000000..9d31ed4e81
--- /dev/null
+++ b/doc/scripts/sort1.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+sub key_of_record {
+ local($record) = @_;
+
+ # Split record into lines:
+ my @lines = split /\n/, $record;
+
+ my ($i) = 1;
+ my ($key) = $lines[$i];
+
+ while( !($key =~ m/^\\label(.*)/) && ($i < 5)) { $i=$i+1; $key = $lines[$i]; }
+
+ return $key;
+}
+
+$/="\n\n\n"; # Records are separated by blank lines.
+@records = <>; # Read in whole file, one record per array element.
+
+@records = sort { key_of_record($a) cmp key_of_record($b) } @records;
+print @records;
diff --git a/doc/signatures.texi b/doc/signatures.texi
deleted file mode 100644
index 32e1013155..0000000000
--- a/doc/signatures.texi
+++ /dev/null
@@ -1,151 +0,0 @@
-In this section we will provide some information about digital
-signatures, how they work, and give the rationale for disabling some
-of the algorithms used.
-
-Digital signatures work by using somebody's secret key to sign some
-arbitrary data. Then anybody else could use the public key of that
-person to verify the signature. Since the data may be arbitrary it is
-not suitable input to a cryptographic digital signature algorithm. For
-this reason and also for performance cryptographic hash algorithms are
-used to preprocess the input to the signature algorithm. This works as
-long as it is difficult enough to generate two different messages with
-the same hash algorithm output. In that case the same signature could
-be used as a proof for both messages. Nobody wants to sign an innocent
-message of donating 1 @euro{} to Greenpeace and find out that he
-donated 1.000.000 @euro{} to Bad Inc.
-
-For a hash algorithm to be called cryptographic the following three
-requirements must hold
-@enumerate
-@item Preimage resistance. That means the algorithm must be one way and given
-the output of the hash function @math{H(x)}, it is impossible to
-calculate @math{x}.
-
-@item 2nd preimage resistance. That means that given a pair @math{x,y} with @math{y=H(x)} it is impossible
-to calculate an @math{x'} such that @math{y=H(x')}.
-
-@item Collision resistance. That means that it is impossible to calculate random @math{x} and @math{x'} such
-@math{H(x')=H(x)}.
-@end enumerate
-
-The last two requirements in the list are the most important in
-digital signatures. These protect against somebody who would like to
-generate two messages with the same hash output. When an algorithm is
-considered broken usually it means that the Collision resistance of
-the algorithm is less than brute force. Using the birthday paradox the
-brute force attack takes
-@iftex
-@math{2^{(\rm{hash\ size}) / 2}}
-@end iftex
-@ifnottex
-@math{2^{((hash size) / 2)}}
-@end ifnottex
-operations. Today colliding certificates using the MD5 hash algorithm
-have been generated as shown in @xcite{WEGER}.
-
-There has been cryptographic results for the SHA-1 hash algorithms as
-well, although they are not yet critical. Before 2004, MD5 had a
-presumed collision strength of @math{2^64}, but it has been showed to
-have a collision strength well under @math{2^50}. As of November
-2005, it is believed that SHA-1's collision strength is around
-@math{2^63}. We consider this sufficiently hard so that we still
-support SHA-1. We anticipate that SHA-256/386/512 will be used in
-publicly-distributed certificates in the future. When @math{2^63} can
-be considered too weak compared to the computer power available
-sometime in the future, SHA-1 will be disabled as well. The collision
-attacks on SHA-1 may also get better, given the new interest in tools
-for creating them.
-
-@subsection Supported Algorithms
-The available digital signature algorithms in @acronym{GnuTLS} are
-listed below:
-
-@table @code
-@item RSA
-RSA is public key cryptosystem designed by Ronald Rivest, Adi Shamir
-and Leonard Adleman. It can be used with any hash functions.
-
-@item DSA
-DSA is the USA's Digital Signature Standard. It uses only the SHA-1
-hash algorithm.
-
-@end table
-
-The supported cryptographic hash algorithms are:
-
-@table @code
-@item MD2
-MD2 is a cryptographic hash algorithm designed by Ron Rivest. It is
-optimized for 8-bit processors. Outputs 128 bits of data. There are
-several known weaknesses of this algorithm and it should not be used.
-Unfortunately some CA certificates signed with RSA-MD2 are still in
-use, but this is acceptable because the RSA-MD2 signature is not
-involved in certificate validation.
-
-@item MD5
-MD5 is a cryptographic hash algorithm designed by Ron Rivest. Outputs
-128 bits of data. It is considered to be broken.
-
-@item SHA-1
-SHA is a cryptographic hash algorithm designed by NSA. Outputs 160
-bits of data. It is also considered to be broken, though no practical
-attacks have been found.
-
-@item RMD160
-RIPEMD is a cryptographic hash algorithm developed in the framework of
-the EU project RIPE. Outputs 160 bits of data.
-
-@end table
-
-
-@subsection Trading Security for Interoperability
-
-If you connect to a server and use GnuTLS' functions to verify the
-certificate chain, and get a @ref{GNUTLS_CERT_INSECURE_ALGORITHM}
-validation error (@pxref{Verifying X.509 certificate paths}), it means
-that somewhere in the certificate chain there is a certificate signed
-using @code{RSA-MD2} or @code{RSA-MD5}. These two digital signature
-algorithms are considered broken, so GnuTLS fail when attempting to
-verify the certificate. In some situations, it may be useful to be
-able to verify the certificate chain anyway, assuming an attacker did
-not utilize the fact that these signatures algorithms are broken.
-This section will give help on how to achieve that.
-
-First, it is important to know that you do not have to enable any of
-the flags discussed here to be able to use trusted root CA
-certificates signed using @code{RSA-MD2} or @code{RSA-MD5}. The only
-attack today is that it is possible to generate certificates with
-colliding signatures (collision resistance); you cannot generate a
-certificate that has the same signature as an already existing
-signature (2nd preimage resistance).
-
-If you are using @ref{gnutls_certificate_verify_peers2} to verify the
-certificate chain, you can call
-@ref{gnutls_certificate_set_verify_flags} with the
-@code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2} or
-@code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5} flag, as in:
-
-@example
- gnutls_certificate_set_verify_flags (x509cred,
- GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5);
-@end example
-
-This will tell the verifier algorithm to enable @code{RSA-MD5} when
-verifying the certificates.
-
-If you are using @ref{gnutls_x509_crt_verify} or
-@ref{gnutls_x509_crt_list_verify}, you can pass the
-@code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5} parameter directly in the
-@code{flags} parameter.
-
-If you are using these flags, it may also be a good idea to warn the
-user when verification failure occur for this reason. The simplest is
-to not use the flags by default, and only fall back to using them
-after warning the user. If you wish to inspect the certificate chain
-yourself, you can use @ref{gnutls_certificate_get_peers} to extract
-the raw server's certificate chain, then use
-@ref{gnutls_x509_crt_import} to parse each of the certificates, and
-then use @ref{gnutls_x509_crt_get_signature_algorithm} to find out the
-signing algorithm used for each certificate. If any of the
-intermediary certificates are using @code{GNUTLS_SIGN_RSA_MD2} or
-@code{GNUTLS_SIGN_RSA_MD5}, you could present a warning.