gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_2_99_3-4-gd57800e


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_99_3-4-gd57800e
Date: Sun, 19 Jun 2011 21:34:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=d57800e66a27850365cd42e52f0128e2b6d49dad

The branch, master has been updated
       via  d57800e66a27850365cd42e52f0128e2b6d49dad (commit)
       via  84ac5bc635b4701e0f3b9d40b2f0726e4c45a13d (commit)
       via  e339ff713b0337e78cb0267d4e43b3b22961f583 (commit)
      from  720abdba139609e14059cfc32c10613d563290d5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d57800e66a27850365cd42e52f0128e2b6d49dad
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Jun 19 23:34:09 2011 +0200

    more files to ignore

commit 84ac5bc635b4701e0f3b9d40b2f0726e4c45a13d
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Jun 19 22:23:02 2011 +0200

    updated documentation to allow latex output.

commit e339ff713b0337e78cb0267d4e43b3b22961f583
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Jun 19 18:04:32 2011 +0200

    corrected typos

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                 |    1 +
 configure.ac                               |    2 +
 doc/Makefile.am                            |    4 +-
 doc/cha-auth.texi                          |  102 ++++----
 doc/cha-bib.texi                           |    8 +
 doc/cha-cert-auth.texi                     |  189 ++++++-------
 doc/cha-ciphersuites.texi                  |   34 ---
 doc/cha-errors.texi                        |   11 +
 doc/cha-functions.texi                     |   74 +-----
 doc/cha-gtls-app.texi                      |   66 +++---
 doc/cha-internals.texi                     |    2 +-
 doc/cha-intro-tls.texi                     |  192 ++++++-------
 doc/cha-library.texi                       |   69 ++---
 doc/cha-preface.texi                       |  244 +---------------
 doc/cha-programs.texi                      |  345 +++++++++++------------
 doc/{cha-preface.texi => cha-support.texi} |   80 ++----
 doc/cha-tls-app.texi                       |    2 +-
 doc/errcodes.c                             |  105 +++++++-
 doc/examples/ex-client1.c                  |    2 +-
 doc/examples/ex-pkcs11-list.c              |    4 +-
 doc/examples/ex-serv-anon.c                |    2 +-
 doc/gnutls.texi                            |   10 +
 doc/latex/.gitignore                       |   30 ++
 doc/latex/Makefile.am                      |  105 +++++++
 doc/latex/cover.tex.in                     |   59 ++++
 doc/{fdl-1.3.texi => latex/fdl.tex}        |  425 ++++++++++++++++------------
 doc/latex/gnutls.bib                       |  289 +++++++++++++++++++
 doc/latex/gnutls.tex                       |   79 +++++
 doc/latex/macros.tex                       |   45 +++
 doc/printlist.c                            |   94 ++++++-
 doc/scripts/mytexi2latex                   |  263 +++++++++++++++++
 doc/scripts/sort1.pl                       |   21 ++
 doc/signatures.texi                        |  151 ----------
 lib/gnutls_record.c                        |    2 +-
 lib/x509/crq.c                             |    8 +-
 lib/x509/x509.c                            |    4 +-
 lib/x509/x509_write.c                      |    8 +-
 37 files changed, 1874 insertions(+), 1257 deletions(-)
 create mode 100644 doc/cha-errors.texi
 copy doc/{cha-preface.texi => cha-support.texi} (71%)
 create mode 100644 doc/latex/.gitignore
 create mode 100644 doc/latex/Makefile.am
 create mode 100644 doc/latex/cover.tex.in
 copy doc/{fdl-1.3.texi => latex/fdl.tex} (64%)
 create mode 100644 doc/latex/gnutls.bib
 create mode 100644 doc/latex/gnutls.tex
 create mode 100644 doc/latex/macros.tex
 create mode 100755 doc/scripts/mytexi2latex
 create mode 100755 doc/scripts/sort1.pl
 delete mode 100644 doc/signatures.texi

diff --git a/.gitignore b/.gitignore
index a2562cf..1e8d81b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -464,3 +464,4 @@ doc/version-guile.texi
 build-aux/compile
 doc/stamp-1
 lib/algorithms/libgnutls_alg.la
+gl/tests/inttypes.h
diff --git a/configure.ac b/configure.ac
index 3e8a7ff..14d15fb 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 183986a..e54e5a3 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 9336ab5..9a9bb38 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.
 
address@hidden OpenPGP trust model}, for more information about the
address@hidden trust model.  For a more detailed introduction to
address@hidden 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
address@hidden or
address@hidden depending on the
address@hidden or
address@hidden 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
 
address@hidden @ref{gnutls_certificate_server_set_retrieve_function}
address@hidden @funcref{gnutls_certificate_server_set_retrieve_function}
 
address@hidden @ref{gnutls_certificate_client_set_retrieve_function}
address@hidden @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
address@hidden
address@hidden
 
 Certificate verification is possible by loading the trusted
 authorities into the credentials structure by using
address@hidden or
address@hidden for openpgp
address@hidden or
address@hidden 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
address@hidden  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
address@hidden  If a different
address@hidden  If a different
 password file format is to be used, then the function
address@hidden, should be called,
address@hidden, should be called,
 in order to set an appropriate callback.
 
 Some helper functions such as
 
 @itemize
 
address@hidden @ref{gnutls_srp_verifier}
address@hidden @funcref{gnutls_srp_verifier}
 
address@hidden @ref{gnutls_srp_base64_encode}
address@hidden @funcref{gnutls_srp_base64_encode}
 
address@hidden @ref{gnutls_srp_base64_decode}
address@hidden @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
address@hidden  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
address@hidden  This has the
address@hidden  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
address@hidden, should be used
address@hidden, 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
address@hidden  The client can retrieve
address@hidden  The client can retrieve
 the hint, for example in the callback function, using
address@hidden
address@hidden
 
 Some helper functions such as:
 
 @itemize
 
address@hidden @ref{gnutls_hex_encode}
address@hidden @funcref{gnutls_hex_encode}
 
address@hidden @ref{gnutls_hex_decode}
address@hidden @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
address@hidden  A mapping is shown below.
address@hidden  A mapping is shown below.
 
 Key exchange algorithms and the corresponding credential types:
 
address@hidden @columnfractions .3 .3 .3
address@hidden @columnfractions .4 .25 .25
 
 @headitem Key exchange @tab Client credentials @tab Server credentials
 
address@hidden @code{KX_RSA}
address@hidden @code{KX_DHE_RSA}
address@hidden @code{KX_DHE_DSS}
address@hidden @code{KX_ECDHE_RSA}
address@hidden @code{KX_ECDHE_ECDSA}
address@hidden @code{KX_RSA_EXPORT}
address@hidden @code{KX_RSA},
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden
 @tab @code{CRD_CERTIFICATE}
 @tab @code{CRD_CERTIFICATE}
 
address@hidden @code{KX_SRP_RSA}
address@hidden @code{KX_SRP_RSA}, @code{KX_SRP_DSS}
 @tab @code{CRD_SRP}
address@hidden @code{CRD_SRP}
address@hidden @code{KX_SRP_DSS}
address@hidden
 @tab @code{CRD_CERTIFICATE}
 
 @item @code{KX_SRP}
 @tab @code{CRD_SRP}
 @tab @code{CRD_SRP}
 
address@hidden @code{KX_ANON_DH}
address@hidden @code{KX_ANON_ECDH}
address@hidden @code{KX_ANON_DH},
address@hidden
 @tab @code{CRD_ANON}
 @tab @code{CRD_ANON}
 
address@hidden @code{KX_PSK}
address@hidden @code{KX_DHE_PSK}
address@hidden @code{KX_PSK},
address@hidden, @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
address@hidden can be used to
+functions like @funcref{gnutls_certificate_set_dh_params} and
address@hidden 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
address@hidden  An example is shown
address@hidden  An example is shown
 below.
 
 @example
diff --git a/doc/cha-bib.texi b/doc/cha-bib.texi
index a197a8f..893819c 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}.
 
address@hidden @anchor{RFC4347}[RFC4347]
+Eric Rescorla and Nagendra Modadugu, "Datagram Transport Layer Security", April
+2006, Available from @url{http://www.ietf.org/rfc/rfc4347.txt}.
+
address@hidden @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 b51a3ed..2342618 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
address@hidden 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
address@hidden: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
address@hidden 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
 
address@hidden @ref{gnutls_x509_trust_list_init}:
address@hidden @funcref{gnutls_x509_trust_list_init}:
 A function to initialize a list that will hold trusted
 certificate authorities and certificate revocation lists.
 
address@hidden @ref{gnutls_x509_trust_list_deinit}:
address@hidden @funcref{gnutls_x509_trust_list_deinit}:
 Deinitializes the list.
 
address@hidden @ref{gnutls_x509_trust_list_add_cas}:
address@hidden @funcref{gnutls_x509_trust_list_add_cas}:
 Adds certificate authorities to the list.
 
address@hidden @ref{gnutls_x509_trust_list_add_named_crt}:
address@hidden @funcref{gnutls_x509_trust_list_add_named_crt}:
 Adds trusted certificates for an entity identified
 by a name.
 
address@hidden @ref{gnutls_x509_trust_list_add_crls}:
address@hidden @funcref{gnutls_x509_trust_list_add_crls}:
 Adds certificate revocation lists.
 
address@hidden @ref{gnutls_x509_trust_list_verify_crt}:
address@hidden @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).
 
address@hidden @ref{gnutls_x509_trust_list_verify_named_crt}:
address@hidden @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
address@hidden and @ref{gnutls_certificate_set_x509_crl_file},
address@hidden 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.
 
address@hidden
 @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
address@hidden depends on the flags set by
-calling @ref{gnutls_certificate_set_verify_flags}.  All the available
address@hidden depends on the flags set by
+calling @funcref{gnutls_certificate_set_verify_flags}.  All the available
 flags are part of the enumeration
address@hidden and are explained in the table
address@hidden and are explained in the table
 below.
 
address@hidden
address@hidden 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.
 
address@hidden PKCS #10 certificate requests
address@hidden 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}.
 
address@hidden PKCS #12 structures
address@hidden 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
address@hidden  This checks an
address@hidden  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
 
 
address@hidden PKCS #11 tokens
address@hidden @acronym{PKCS #11} tokens
address@hidden:pkcs11}
address@hidden @acronym{PKCS #11} tokens
address@hidden Hardware tokens
address@hidden Hardware tokens
address@hidden PKCS #11 tokens
address@hidden Hardware tokens
 
 @subsection Introduction
-This section copes with the @acronym{PKCS #11} @xcite{PKCS11} support in 
@acronym{GnuTLS}.
address@hidden #11} is plugin API allowing applications to access cryptographic
+This section copes with hardware token support in @acronym{GnuTLS} using 
address@hidden #11 @xcite{PKCS11}.
address@hidden #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
 
address@hidden @ref{gnutls_pkcs11_init}: Global initialization
address@hidden @funcref{gnutls_pkcs11_init}: Global initialization
 
address@hidden @ref{gnutls_pkcs11_deinit}: Global deinitialization
address@hidden @funcref{gnutls_pkcs11_deinit}: Global deinitialization
 
address@hidden @ref{gnutls_pkcs11_set_token_function}: Sets the token insertion 
function
address@hidden @funcref{gnutls_pkcs11_set_token_function}: Sets the token 
insertion function
 
address@hidden @ref{gnutls_pkcs11_set_pin_function}: Sets the PIN request 
function
address@hidden @funcref{gnutls_pkcs11_set_pin_function}: Sets the PIN request 
function
 
address@hidden @ref{gnutls_pkcs11_add_provider}: Adds an additional 
@acronym{PKCS #11} provider
address@hidden @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 
address@hidden://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
 
address@hidden @ref{gnutls_pkcs11_obj_init}: Initializes an object
address@hidden @funcref{gnutls_pkcs11_obj_init}: Initializes an object
 
address@hidden @ref{gnutls_pkcs11_obj_import_url}: To import an object from a 
url
address@hidden @funcref{gnutls_pkcs11_obj_import_url}: To import an object from 
a url
 
address@hidden @ref{gnutls_pkcs11_obj_export_url}: To export the URL of the 
object
address@hidden @funcref{gnutls_pkcs11_obj_export_url}: To export the URL of the 
object
 
address@hidden @ref{gnutls_pkcs11_obj_deinit}: To deinitialize an object
address@hidden @funcref{gnutls_pkcs11_obj_deinit}: To deinitialize an object
 
address@hidden @ref{gnutls_pkcs11_obj_export}: To export data associated with 
object
address@hidden @funcref{gnutls_pkcs11_obj_export}: To export data associated 
with object
 
address@hidden @ref{gnutls_pkcs11_obj_get_info}: To obtain information about an 
object
address@hidden @funcref{gnutls_pkcs11_obj_get_info}: To obtain information 
about an object
 
address@hidden @ref{gnutls_pkcs11_obj_list_import_url}: To mass load of objects
address@hidden @funcref{gnutls_pkcs11_obj_list_import_url}: To mass load of 
objects
 
address@hidden @ref{gnutls_x509_crt_import_pkcs11}: Import a certificate object
address@hidden @funcref{gnutls_x509_crt_import_pkcs11}: Import a certificate 
object
 
address@hidden @ref{gnutls_x509_crt_import_pkcs11_url}: Helper function to 
directly import a URL into a certificate
address@hidden @funcref{gnutls_x509_crt_import_pkcs11_url}: Helper function to 
directly import a URL into a certificate
 
address@hidden @ref{gnutls_x509_crt_list_import_pkcs11}: Mass import of 
certificates
address@hidden @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
 
address@hidden @ref{gnutls_pkcs11_token_init}: Initializes a token
address@hidden @funcref{gnutls_pkcs11_token_init}: Initializes a token
 
address@hidden @ref{gnutls_pkcs11_token_set_pin}: Sets the token user's PIN
address@hidden @funcref{gnutls_pkcs11_token_set_pin}: Sets the token user's PIN
 
address@hidden @ref{gnutls_pkcs11_token_get_url}: Returns the URL of a token
address@hidden @funcref{gnutls_pkcs11_token_get_url}: Returns the URL of a token
 
address@hidden @ref{gnutls_pkcs11_token_get_info}: Obtain information about a 
token
address@hidden @funcref{gnutls_pkcs11_token_get_info}: Obtain information about 
a token
 
address@hidden @ref{gnutls_pkcs11_token_get_flags}: Returns flags about a token 
(i.e. hardware or software)
address@hidden @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.
address@hidden
address@hidden
 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();
address@hidden verbatim
address@hidden 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
 
address@hidden @ref{gnutls_pkcs11_delete_url}: To delete an object
address@hidden @funcref{gnutls_pkcs11_delete_url}: To delete an object
 
address@hidden @ref{gnutls_pkcs11_copy_x509_privkey}: To copy a private key to 
a token
address@hidden @funcref{gnutls_pkcs11_copy_x509_privkey}: To copy a private key 
to a token
 
address@hidden @ref{gnutls_pkcs11_copy_x509_crt}: To copy a certificate to a 
token
address@hidden @funcref{gnutls_pkcs11_copy_x509_crt}: To copy a certificate to 
a token
 
 @end itemize
 
 
address@hidden Using a @acronym{PKCS #11} token with TLS
address@hidden 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
 
address@hidden @ref{gnutls_certificate_set_x509_trust_file}: If given a PKCS 
#11 URL will load the trusted certificates from it.
address@hidden @funcref{gnutls_certificate_set_x509_trust_file}: If given a 
PKCS #11 URL will load the trusted certificates from it.
 
address@hidden @ref{gnutls_certificate_set_x509_key_file}: Will also load PKCS 
#11 URLs for keys and certificates.
address@hidden @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
address@hidden:abstract}
 @cindex Abstract types
 
 Since there are many forms of a public or private keys supported by 
@acronym{GnuTLS} such as
address@hidden, @acronym{OpenPGP}, or @acronym{PKCS #11} it is desirable to 
allow common operations
address@hidden, @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:
 
address@hidden
address@hidden
 #inlude <gnutls/abstract.h>
 #inlude <gnutls/pkcs11.h>
 
 void sign_cert( gnutls_x509_crt_t to_be_signed)
-{
address@hidden
 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);
-}
address@hidden verbatim
+  /* sign the certificate to be signed */
+  gnutls_x509_crt_privkey_sign(to_be_signed, ca_cert, ca_key, 
+                               GNUTLS_DIG_SHA1, 0);
address@hidden
address@hidden 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
address@hidden with the
address@hidden with the
 @code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2} or
 @code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5} flag, as in:
 
address@hidden
address@hidden
   gnutls_certificate_set_verify_flags (x509cred,
                                        GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5);
address@hidden example
address@hidden 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
address@hidden, you can pass the
+If you are using @funcref{gnutls_x509_crt_verify} or
address@hidden, 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
address@hidden to parse each of the certificates, and
-then use @ref{gnutls_x509_crt_get_signature_algorithm} to find out the
address@hidden 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 df90865..916c2ab 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:
-
address@hidden @code
address@hidden RSA
-RSA is public key cryptosystem designed by Ronald Rivest, Adi Shamir
-and Leonard Adleman.  It can be used with any hash functions.
-
address@hidden DSA
-DSA is the USA's Digital Signature Standard.  It may use the SHA
-family of hash algorithms.
-
address@hidden ECDSA
-ECDSA is the elliptic curve counter-part of DSA. 
-
address@hidden 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.
-
address@hidden MD5
-MD5 is a cryptographic hash algorithm designed by Ron Rivest. Outputs
-128 bits of data.  It is considered to be broken.
-
address@hidden 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.
-
address@hidden RMD160
-RIPEMD is a cryptographic hash algorithm developed in the framework of
-the EU project RIPE.  Outputs 160 bits of data.
-
address@hidden table
-
diff --git a/doc/cha-errors.texi b/doc/cha-errors.texi
new file mode 100644
index 0000000..84d2336
--- /dev/null
+++ b/doc/cha-errors.texi
@@ -0,0 +1,11 @@
address@hidden Error codes
address@hidden Error Codes and Descriptions
address@hidden 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.
+
address@hidden error_codes.texi
+
diff --git a/doc/cha-functions.texi b/doc/cha-functions.texi
index a818800..56e36fc 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
 
address@hidden X.509 certificate functions
address@hidden X509 certificate functions
 @section @acronym{X.509} Certificate Functions
address@hidden: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
address@hidden: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
 
address@hidden TLS Inner Application (TLS/IA) functions
address@hidden @acronym{TLS} Inner Application (@acronym{TLS/IA}) Functions
address@hidden @acronym{TLS} Inner Application (@acronym{TLS/IA}) functions
address@hidden 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:
-
address@hidden
-int client_avp (gnuls_session_t *session, void *ptr,
-                const char *last, size_t lastlen,
-               char **new, size_t *newlen)
address@hidden
-...
address@hidden
-...
-int main ()
address@hidden
-  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...
-...
address@hidden 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
address@hidden instead of
address@hidden, and replace the call to the
-client functions with the corresponding server functions.
-
address@hidden Error codes and descriptions
address@hidden Error Codes and Descriptions
address@hidden Codes}
address@hidden 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.
-
address@hidden error_codes.texi
diff --git a/doc/cha-gtls-app.texi b/doc/cha-gtls-app.texi
index c61d3f5..632b70e 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
address@hidden are to be used. Those will print
+Those are the cases where the @funcref{gnutls_global_set_log_level} and
address@hidden 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:
 
address@hidden
address@hidden
 gcc -c foo.c `pkg-config gnutls --cflags`
address@hidden example
address@hidden 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}.
 
address@hidden
address@hidden
 gcc -o foo foo.o `pkg-config gnutls --libs`
address@hidden example
address@hidden smallexample
 
 Of course you can also combine both examples to a single command by
 specifying both options to @command{pkg-config}:
 
address@hidden
address@hidden
 gcc -o foo foo.c `pkg-config gnutls --cflags --libs`
address@hidden example
address@hidden 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
 
address@hidden Client using a PKCS #11 token with TLS
address@hidden 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
address@hidden@acronym{OpenPGP}} key authentication. You can easily combine
address@hidden 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
 
address@hidden PKCS #12 structure generation
address@hidden 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
address@hidden or
address@hidden for anonymous sessions.
address@hidden or
address@hidden 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
 
address@hidden @ref{gnutls_rsa_params_generate2}
address@hidden @funcref{gnutls_rsa_params_generate2}
 
address@hidden @ref{gnutls_certificate_set_rsa_export_params}
address@hidden @funcref{gnutls_certificate_set_rsa_export_params}
 
address@hidden @ref{gnutls_rsa_params_import_pkcs1}
address@hidden @funcref{gnutls_rsa_params_import_pkcs1}
 
address@hidden @ref{gnutls_rsa_params_export_pkcs1}
address@hidden @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
address@hidden, you can invoke the TLS PRF with this call:
address@hidden, 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
address@hidden function.  Currently only the
address@hidden 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 478f168..29bc25c 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 
address@hidden only multiplexes the input to the appropriate 
address@hidden 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 23dbeb2..d8dc5bc 100644
--- a/doc/cha-intro-tls.texi
+++ b/doc/cha-intro-tls.texi
@@ -8,22 +8,19 @@ by @address@hidden, 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
address@hidden 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.  
address@hidden 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
address@hidden @ref{gnutls_transport_set_push_function}
address@hidden @ref{gnutls_transport_set_vec_push_function}
address@hidden @ref{gnutls_transport_set_pull_timeout_function} (for 
@acronym{DTLS} only)
address@hidden @ref{gnutls_transport_set_pull_function}
address@hidden @ref{gnutls_transport_set_ptr}
address@hidden @ref{gnutls_transport_set_errno}
address@hidden @funcref{gnutls_transport_set_push_function}
address@hidden @funcref{gnutls_transport_set_vec_push_function}
address@hidden @funcref{gnutls_transport_set_pull_timeout_function} (for 
@acronym{DTLS} only)
address@hidden @funcref{gnutls_transport_set_pull_function}
address@hidden @funcref{gnutls_transport_set_ptr}
address@hidden @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
 
address@hidden @ref{gnutls_record_send}:
address@hidden @funcref{gnutls_record_send}:
 To send a record packet with application data.
 
address@hidden @ref{gnutls_record_recv}:
address@hidden @funcref{gnutls_record_recv}:
 To receive a record packet with application data.
 
address@hidden @ref{gnutls_record_recv_seq}:
address@hidden @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.
 
address@hidden @ref{gnutls_record_get_direction}:
address@hidden @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
address@hidden 3DES_CBC
address@hidden is the DES block cipher algorithm used with triple
address@hidden 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.
 
address@hidden ARCFOUR_128
-ARCFOUR is a fast stream cipher.
address@hidden ARCFOUR_128:
+A fast stream cipher.
 
address@hidden ARCFOUR_40
-This is the ARCFOUR cipher that is fed with a 40 bit key,
address@hidden ARCFOUR_40:
+This is the ARCFOUR cipher fed with a 40 bit key,
 which is considered weak.
 
address@hidden AES_CBC
address@hidden 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.
 
address@hidden AES_GCM
address@hidden 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.
 
address@hidden CAMELLIA_CBC
-CAMELLIA is an 128-bit block cipher developed by Mitsubish and NTT. It
address@hidden 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
address@hidden MAC_MD5
-MD5 is a cryptographic hash algorithm designed by Ron Rivest. Outputs
address@hidden MAC_MD5:
+This is a cryptographic hash algorithm designed by Ron Rivest. Outputs
 128 bits of data.
 
address@hidden MAC_SHA
-SHA is a cryptographic hash algorithm designed by NSA. Outputs 160
address@hidden MAC_SHA1:
+A cryptographic hash algorithm designed by NSA. Outputs 160
 bits of data.
 
address@hidden MAC_SHA256
-SHA256 is a cryptographic hash algorithm designed by NSA. Outputs 256
address@hidden MAC_SHA256:
+A cryptographic hash algorithm designed by NSA. Outputs 256
 bits of data.
 
address@hidden MAC_AEAD
address@hidden 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
address@hidden' address@hidden should use
address@hidden 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
address@hidden DEFLATE
address@hidden DEFLATE:
 Zlib compression, using the deflate algorithm.
 
address@hidden NULL
address@hidden 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
address@hidden, or @ref{gnutls_priority_set} with
address@hidden, 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
address@hidden 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
address@hidden 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
address@hidden @ref{gnutls_alert_send}:
address@hidden @funcref{gnutls_alert_send}:
 To send an alert signal.
 
address@hidden @ref{gnutls_error_to_alert}:
address@hidden @funcref{gnutls_error_to_alert}:
 To map a gnutls error number to an alert signal.
 
address@hidden @ref{gnutls_alert_get}:
address@hidden @funcref{gnutls_alert_get}:
 Returns the last received alert.
 
address@hidden @ref{gnutls_alert_get_name}:
address@hidden @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
address@hidden @ref{gnutls_priority_init}:
address@hidden @funcref{gnutls_priority_init}:
 To initialize a priority set of ciphers.
 
address@hidden @ref{gnutls_priority_deinit}:
address@hidden @funcref{gnutls_priority_deinit}:
 To deinitialize a priority set of ciphers.
 
address@hidden @ref{gnutls_priority_set}:
address@hidden @funcref{gnutls_priority_set}:
 To associate a priority set with a @acronym{TLS} session.
 
address@hidden @ref{gnutls_priority_set_direct}:
address@hidden @funcref{gnutls_priority_set_direct}:
 To directly associate a session with a given priority string.
 
address@hidden @ref{gnutls_credentials_set}:
address@hidden @funcref{gnutls_credentials_set}:
 To set the appropriate credentials structures.
 
address@hidden @ref{gnutls_certificate_server_set_request}:
address@hidden @funcref{gnutls_certificate_server_set_request}:
 To set whether client certificate is required or not.
 
address@hidden @ref{gnutls_handshake}:
address@hidden @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
address@hidden function. If a certificate
address@hidden 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
address@hidden @ref{gnutls_certificate_set_x509_trust_file}
address@hidden @ref{gnutls_certificate_set_x509_trust_mem}
address@hidden @funcref{gnutls_certificate_set_x509_trust_file}
address@hidden @funcref{gnutls_certificate_set_x509_trust_mem}
 @end itemize
 
-Sending of the names of the CAs can be controlled using
address@hidden The client, then, may
+Sending of the names of the certificate authorities can be controlled using 
the function
address@hidden 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
 
address@hidden @ref{gnutls_session_get_data}
address@hidden @funcref{gnutls_session_get_data}
 
address@hidden @ref{gnutls_session_get_id}
address@hidden @funcref{gnutls_session_get_id}
 
address@hidden @ref{gnutls_session_set_data}
address@hidden @funcref{gnutls_session_set_data}
 
 @end itemize
 
@@ -656,19 +644,19 @@ registered with:
 
 @itemize
 
address@hidden @ref{gnutls_db_set_remove_function}
address@hidden @funcref{gnutls_db_set_remove_function}
 
address@hidden @ref{gnutls_db_set_store_function}
address@hidden @funcref{gnutls_db_set_store_function}
 
address@hidden @ref{gnutls_db_set_retrieve_function}
address@hidden @funcref{gnutls_db_set_retrieve_function}
 
address@hidden @ref{gnutls_db_set_ptr}
address@hidden @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
address@hidden is provided for that reason.
address@hidden 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:
address@hidden
address@hidden
 NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0:+VERS-SSL3.0:%COMPAT
address@hidden example
address@hidden 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
address@hidden and the
address@hidden functions.
+useful to clients with constrained capabilities. See the functions:
address@hidden
address@hidden @funcref{gnutls_record_set_max_size}
address@hidden @funcref{gnutls_record_get_max_size}
address@hidden 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
address@hidden and @ref{gnutls_server_name_get} can be
address@hidden 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
address@hidden and servers use
address@hidden to generate a key and
address@hidden to enable the extension.
address@hidden and servers use
address@hidden to generate a key and
address@hidden 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
address@hidden @code{gnutls_sec_param_t}
address@hidden Security parameter
 @tab Description
 
 @item 64
@@ -938,9 +928,9 @@ key algorithm is required, use of the following functions is
 recommended:
 @itemize
 
address@hidden @ref{gnutls_pk_bits_to_sec_param}
address@hidden @funcref{gnutls_pk_bits_to_sec_param}
 
address@hidden @ref{gnutls_sec_param_to_pk_bits}
address@hidden @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 f556369..5f738e1 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.
 
address@hidden 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.
 
address@hidden Support for TLS Extension mechanism.
address@hidden Support for TLS safe renegotiation.
 
address@hidden Support for TLS Compression Methods.
address@hidden Support for @acronym{PKCS} #11 tokens.
 
 @end itemize
 
-Additionally @acronym{GnuTLS} provides a limited emulation API for the
-widely used address@hidden@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
address@hidden@address@hidden://ftp.gnupg.org/gcrypt/alpha/gnutls/libtasn1/}},
address@hidden@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
address@hidden@address@hidden://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
address@hidden@address@hidden://ftp.gnupg.org/gcrypt/alpha/libgcrypt/}}
address@hidden 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 
address@hidden@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 address@hidden 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
address@hidden returned by @ref{gnutls_record_recv}.
address@hidden 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
address@hidden
address@hidden
 
 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.
 
address@hidden
-
address@hidden Native threads
address@hidden Native threads
 @example
 #include <gnutls.h>
 
@@ -183,7 +173,7 @@ int main()
 @}
 @end example
 
address@hidden Other thread packages
address@hidden Other thread packages
 @example
 
 int main()
@@ -193,7 +183,6 @@ int main()
    gnutls_global_init();
 @}
 @end example
address@hidden itemize
 
 @node Callback functions
 @section Callback Functions
@@ -209,21 +198,21 @@ data to the transport layer.
 
 @itemize
 
address@hidden @ref{gnutls_transport_set_push_function}
address@hidden @funcref{gnutls_transport_set_push_function}
 
address@hidden @ref{gnutls_transport_set_pull_function}
address@hidden @funcref{gnutls_transport_set_pull_function}
 
 @end itemize
 
 Other callback functions such as the one set by
address@hidden, may require more
address@hidden, may require more
 complicated input, including data to be allocated.  These callbacks
 should allocate and free memory using the functions shown below.
 
 @itemize
 
address@hidden @ref{gnutls_malloc}
address@hidden @funcref{gnutls_malloc}
 
address@hidden @ref{gnutls_free}
address@hidden @funcref{gnutls_free}
 
 @end itemize
diff --git a/doc/cha-preface.texi b/doc/cha-preface.texi
index 68a7c82..20ea7f8 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}.
 
address@hidden
-
 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/}.
 
address@hidden
-* Getting help::
-* Commercial Support::
-* Downloading and Installing::
-* Bug Reports::
-* Contributing::
address@hidden menu
-
address@hidden Getting help
address@hidden 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
address@hidden://lists.gnu.org/mailman/listinfo/help-gnutls}.
-
-A mailing list for developers are also available, see
address@hidden://www.gnu.org/software/gnutls/lists.html}.
-
-Bug reports should be sent to @email{bug-gnutls@@gnu.org}, see
address@hidden Reports}.
-
address@hidden Commercial Support
address@hidden Commercial Support
-
-Commercial support is available for users of GnuTLS.  The kind of
-support that can be purchased may include:
-
address@hidden
-
address@hidden Implement new features.
-Such as a new TLS extension.
-
address@hidden Port GnuTLS to new platforms.
-This could include porting to an embedded platforms that may need
-memory or size optimization.
-
address@hidden Integrating TLS as a security environment in your existing 
project.
-
address@hidden System design of components related to TLS.
-
address@hidden itemize
-
-If you are interested, please write to:
-
address@hidden
-Simon Josefsson Datakonsult
-Hagagatan 24
-113 47 Stockholm
-Sweden
-
-E-mail: address@hidden
address@hidden verbatim
-
-If your company provides support related to GnuTLS and would like to
-be mentioned here, contact the author (@pxref{Bug Reports}).
-
address@hidden Downloading and Installing
address@hidden Downloading and Installing
address@hidden Installation
address@hidden Download
-
-GnuTLS is available for download from the following URL:
-
address@hidden://www.gnutls.org/download.html}
-
-The latest version is stored in a file, e.g.,
address@hidden@value{VERSION}.tar.gz} where the @address@hidden
-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
address@hidden://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
address@hidden://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
address@hidden://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
address@hidden 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.
-
address@hidden @code
-
address@hidden --disable-srp-authentication
address@hidden --disable-psk-authentication
address@hidden --disable-anon-authentication
address@hidden --disable-extra-pki
address@hidden --disable-openpgp-authentication
address@hidden --disable-openssl-compatibility
-Disable or enable particular features.  Generally not recommended.
-
address@hidden table
-
-For the complete list, refer to the output from @code{configure
---help}.
-
address@hidden Bug Reports
address@hidden Bug Reports
address@hidden Reporting Bugs
-
-If you think you have found a bug in GnuTLS, please investigate it and
-report it.
-
address@hidden @bullet
-
address@hidden 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.
-
address@hidden You have to send us a test case that makes it possible for us to
-reproduce the bug.
-
address@hidden 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.
-
address@hidden 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:
-
address@hidden @samp{bug-gnutls@@gnu.org}
-
address@hidden Contributing
address@hidden Contributing
address@hidden Contributing
address@hidden 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:
-
address@hidden @bullet
-
address@hidden Coding Style.
-Follow the GNU Standards document.
address@hidden (@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
address@hidden (@pxref{top, GNU Indent,, indent}) 
-before submitting your work.
-
address@hidden Use the unified diff format @samp{diff -u}.
-
address@hidden 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.
-
address@hidden 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.
-
address@hidden Avoid using the C math library.
-It causes problems for embedded implementations, and in most
-situations it is very easy to avoid using it.
-
address@hidden Document your functions.
-Use comments before each function headers, that, if properly
-formatted, are extracted into Texinfo manuals and GTK-DOC web pages.
-
address@hidden Supply a ChangeLog and NEWS entries, where appropriate.
-
address@hidden itemize
diff --git a/doc/cha-programs.texi b/doc/cha-programs.texi
index 528deef..e8f7e62 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.
 
address@hidden
address@hidden
 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
address@hidden verbatim
address@hidden 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:
-
address@hidden
address@hidden
address@hidden Diffie-Hellman parameter generation
 To generate parameters for Diffie-Hellman key exchange, use the command:
address@hidden
address@hidden
 $ certtool --generate-dh-params --outfile dh.pem
address@hidden example
-
address@hidden
-To generate parameters for the RSA-EXPORT key exchange, use the command:
address@hidden
-$ certtool --generate-privkey --bits 512 --outfile rsa.pem
address@hidden example
-
address@hidden itemize
address@hidden smallexample
 
address@hidden
address@hidden Self-signed certificate generation
 
address@hidden
 To create a self signed certificate, use the command:
address@hidden
address@hidden
 $ certtool --generate-privkey --outfile ca-key.pem
 $ certtool --generate-self-signed --load-privkey ca-key.pem \
    --outfile ca-cert.pem
address@hidden example
address@hidden smallexample
 
 Note that a self-signed certificate usually belongs to a certificate
 authority, that signs other certificates.
 
address@hidden
address@hidden Private key generation
 To create a private key (RSA by default), run:
 
address@hidden
address@hidden
 $ certtool --generate-privkey --outfile key.pem
address@hidden example
address@hidden smallexample
 
 To create a DSA private key, run:
 
address@hidden
address@hidden
 $ certtool --dsa --generate-privkey --outfile key-dsa.pem
address@hidden example
address@hidden smallexample
 
address@hidden
address@hidden Certificate generation
 To generate a certificate using the private key, use the command:
 
address@hidden
address@hidden
 $ certtool --generate-certificate --load-privkey key.pem \
    --outfile cert.pem --load-ca-certificate ca-cert.pem \
    --load-ca-privkey ca-key.pem
address@hidden example
address@hidden smallexample
 
address@hidden
-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.
 
address@hidden
address@hidden
 $ certtool --generate-request --load-privkey key.pem \
   --outfile request.pem
address@hidden example
address@hidden smallexample
 
address@hidden
 To generate a certificate using the previous request, use the command:
 
address@hidden
address@hidden
 $ certtool --generate-certificate --load-request request.pem \
    --outfile cert.pem \
    --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem
address@hidden example
address@hidden smallexample
 
address@hidden
address@hidden Certificate information
 To view the certificate information, use:
 
address@hidden
address@hidden
 $ certtool --certificate-info --infile cert.pem
address@hidden example
address@hidden smallexample
 
address@hidden
address@hidden @acronym{PKCS} #12 structure generation
 To generate a @acronym{PKCS} #12 structure using the previous key and
 certificate, use the command:
 
address@hidden
address@hidden
 $ certtool --load-certificate cert.pem --load-privkey key.pem \
   --to-p12 --outder --outfile key.p12
address@hidden example
address@hidden 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
address@hidden parameter as follows:
+--load-ca-certificate parameter as follows:
 
address@hidden
address@hidden
 $ certtool --load-ca-certificate ca.pem \
   --load-certificate cert.pem --load-privkey key.pem \
   --to-p12 --outder --outfile key.p12
address@hidden example
address@hidden smallexample
 
address@hidden
address@hidden 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:
 
address@hidden
address@hidden
 $ 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
address@hidden example
address@hidden smallexample
 
address@hidden
address@hidden Certificate Revocation List generation
 To create an empty Certificate Revocation List (CRL) do:
 
address@hidden
-$ certtool --generate-crl --load-ca-privkey x509-ca-key.pem 
--load-ca-certificate x509-ca.pem
address@hidden example
address@hidden
+$ certtool --generate-crl --load-ca-privkey x509-ca-key.pem \
+           --load-ca-certificate x509-ca.pem
address@hidden smallexample
 
 To create a CRL that contains some revoked certificates, place the
 certificates in a file and use @code{--load-certificate} as follows:
 
address@hidden
address@hidden
 $ certtool --generate-crl --load-ca-privkey x509-ca-key.pem \
   --load-ca-certificate x509-ca.pem --load-certificate revoked-certs.pem
address@hidden example
address@hidden smallexample
 
address@hidden
 To verify a Certificate Revocation List (CRL) do:
 
address@hidden
address@hidden
 $ certtool --verify-crl --load-ca-certificate x509-ca.pem < crl.pem
address@hidden example
-
address@hidden itemize
-
-Certtool's template file format:
address@hidden smallexample
 
address@hidden
 
address@hidden
-Firstly create a file named 'cert.cfg' that contains the information
-about the certificate. An example file is listed below.
 
address@hidden
-Then execute:
address@hidden 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:
 
address@hidden
address@hidden
 $ certtool --generate-certificate cert.pem --load-privkey key.pem  \
    --template cert.cfg \
    --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem
address@hidden example
-
address@hidden itemize
address@hidden 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.
 
address@hidden
address@hidden
 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
address@hidden verbatim
address@hidden 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
address@hidden NORMAL:+PSK:-RSA:-DHE-RSA:-DHE-PSK}.
-
address@hidden 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:
address@hidden 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:
 
address@hidden
address@hidden
 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
address@hidden smallexample
address@hidden 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.
 
address@hidden
address@hidden
 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
address@hidden verbatim
address@hidden 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:
 
address@hidden
address@hidden
 gnutls-serv --http
address@hidden example
address@hidden 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:
 
address@hidden
address@hidden
 $ 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
 ...
address@hidden example
address@hidden 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.
 
address@hidden
address@hidden
 $ 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
address@hidden example
address@hidden smallexample
 
 For icing, we'll create a proxy certificate for the client too.
 
address@hidden
address@hidden
 $ 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
 ...
address@hidden example
address@hidden smallexample
 
 Then start the server again:
 
address@hidden
address@hidden
 $ gnutls-serv --http \
             --x509cafile x509-ca.pem \
             --x509keyfile x509-server-key.pem \
             --x509certfile x509-server.pem
address@hidden example
address@hidden 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.
 
address@hidden
address@hidden
 $ 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
 ...
address@hidden example
address@hidden smallexample
 
 The next step is to create OpenPGP credentials for the server.
 
address@hidden
address@hidden
 gpg --gen-key
 ...enter whatever details you want, use 'test.gnutls.org' as name...
address@hidden example
address@hidden 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.
 
address@hidden
address@hidden
 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
address@hidden example
address@hidden smallexample
 
 Let's start the server with support for OpenPGP credentials:
 
address@hidden
address@hidden
 gnutls-serv --http \
             --pgpkeyfile openpgp-server-key.txt \
             --pgpcertfile openpgp-server.txt
address@hidden example
address@hidden smallexample
 
 The next step is to add support for SRP authentication.
 
address@hidden
address@hidden
 srptool --create-conf srp-tpasswd.conf
 srptool --passwd-conf srp-tpasswd.conf --username jas --passwd srp-passwd.txt
 Enter password: [TYPE "foo"]
address@hidden example
address@hidden smallexample
 
 Start the server with SRP support:
 
address@hidden
address@hidden
 gnutls-serv --http \
             --srppasswdconf srp-tpasswd.conf \
             --srppasswd srp-passwd.txt
address@hidden example
address@hidden smallexample
 
 Let's also add support for PSK.
 
address@hidden
address@hidden
 $ psktool --passwd psk-passwd.txt
address@hidden example
address@hidden smallexample
 
 Start the server with PSK support:
 
address@hidden
address@hidden
 gnutls-serv --http \
             --pskpasswd psk-passwd.txt
address@hidden example
address@hidden smallexample
 
 Finally, we start the server with all the earlier parameters and you
 get this command:
 
address@hidden
address@hidden
 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
address@hidden example
address@hidden 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.
 
address@hidden
address@hidden
 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
address@hidden verbatim
address@hidden 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:
-
address@hidden
address@hidden How to use srptool
 
address@hidden
 To create tpasswd.conf which holds the g and n values for
 @acronym{SRP} protocol (generator and a large prime), run:
 
address@hidden
address@hidden
 $ srptool --create-conf /etc/tpasswd.conf
address@hidden example
address@hidden smallexample
 
address@hidden
 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.
 
address@hidden
address@hidden
 $ srptool --passwd /etc/tpasswd \
     --passwd-conf /etc/tpasswd.conf -u test
address@hidden example
address@hidden smallexample
 
address@hidden
 This command will check against a password.  If the password matches
 the one in /etc/tpasswd you will get an ok.
 
address@hidden
address@hidden
 $ srptool --passwd /etc/tpasswd \
     --passwd-conf /etc/tpasswd.conf --verify -u test
address@hidden example
-
address@hidden itemize
address@hidden 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}.
 
address@hidden
address@hidden
 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
address@hidden verbatim
address@hidden 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.
 
address@hidden
-
address@hidden List all tokens
address@hidden
address@hidden List all tokens
address@hidden
 $ p11tool --list-tokens
address@hidden example
address@hidden smallexample
 
address@hidden List all objects
address@hidden
address@hidden List all objects
address@hidden
 $ p11tool --login --list-all
address@hidden example
address@hidden smallexample
 
address@hidden To export an object
address@hidden 
address@hidden Exporting an object
address@hidden 
 $ p11tool --login --export pkcs11:(OBJECT URL)
address@hidden example
address@hidden smallexample
+Note however that typically PKCS #11 private key objects are not allowed
+to be extracted from the token.
 
address@hidden To copy an object to a token
address@hidden 
address@hidden Copy an object to a token
address@hidden 
 $ p11tool --login --write pkcs11:(TOKEN URL) \
   --load-certificate cert.pem --label "my_cert"
address@hidden example
-
address@hidden itemize
address@hidden smallexample
 
-Note that typically PKCS #11 private key objects are not allowed
-to be extracted from the token.
diff --git a/doc/cha-preface.texi b/doc/cha-support.texi
similarity index 71%
copy from doc/cha-preface.texi
copy to doc/cha-support.texi
index 68a7c82..273c30e 100644
--- a/doc/cha-preface.texi
+++ b/doc/cha-support.texi
@@ -1,31 +1,5 @@
address@hidden Preface
address@hidden Preface
-
-This document tries to demonstrate and explain the @acronym{GnuTLS}
-library API.  A brief introduction to the protocols and the technology
-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
-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.
-
-Although this document tries to be self contained, basic network
-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}.
-
address@hidden
-
-Updated versions of the @acronym{GnuTLS} software and this document
-will be available from @url{http://www.gnutls.org/} and
address@hidden://www.gnu.org/software/gnutls/}.
address@hidden Support
address@hidden Support
 
 @menu
 * Getting help::
@@ -46,9 +20,8 @@ subscriptions, is available through the World Wide Web at
 
 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
address@hidden Reports}.
address@hidden Reports}.
 
 @node Commercial Support
 @section Commercial Support
@@ -83,21 +56,16 @@ E-mail: address@hidden
 @end verbatim
 
 If your company provides support related to GnuTLS and would like to
-be mentioned here, contact the author (@pxref{Bug Reports}).
+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 from the following URL:
-
+GnuTLS is available for download at:
 @url{http://www.gnutls.org/download.html}
 
-The latest version is stored in a file, e.g.,
address@hidden@value{VERSION}.tar.gz} where the @address@hidden
-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
@@ -122,7 +90,7 @@ 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.
+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
@@ -130,30 +98,23 @@ 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
address@hidden 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.
+parsing OpenPGP packets.
 
address@hidden @code
+A few @code{configure} options may be relevant, summarized below.
+They disable or enable particular features. 
 
address@hidden --disable-srp-authentication
address@hidden --disable-psk-authentication
address@hidden --disable-anon-authentication
address@hidden --disable-extra-pki
address@hidden --disable-openpgp-authentication
address@hidden --disable-openssl-compatibility
-Disable or enable particular features.  Generally not recommended.
-
address@hidden table
address@hidden
+--disable-srp-authentication
+--disable-psk-authentication
+--disable-anon-authentication
+--disable-extra-pki
+--disable-openpgp-authentication
+--disable-openssl-compatibility
+--without-p11-kit
address@hidden verbatim
 
-For the complete list, refer to the output from @code{configure
---help}.
+For the complete list, refer to the output from @code{configure --help}.
 
 @node Bug Reports
 @section Bug Reports
@@ -203,7 +164,7 @@ Send your bug report to:
 
 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
+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.
 
@@ -252,3 +213,4 @@ 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 a34d891..dbfad72 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 915ae66..ff01e06 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 4d7c947..b5b7665 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 2f222bc..0c16a34 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 88f38ac..ade01f4 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 f81fdf6..66368dd 100644
--- a/doc/gnutls.texi
+++ b/doc/gnutls.texi
@@ -67,6 +67,10 @@ Documentation License''.
 @c (@pxref{Bibliography})
 @end macro
 
address@hidden funcref{ref}
address@hidden
address@hidden 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
 
address@hidden cha-support.texi
+
address@hidden cha-errors.texi
+
 @include cha-functions.texi
 
 @include cha-ciphersuites.texi
diff --git a/doc/latex/.gitignore b/doc/latex/.gitignore
new file mode 100644
index 0000000..708c017
--- /dev/null
+++ b/doc/latex/.gitignore
@@ -0,0 +1,30 @@
+gnutls.aux
+gnutls.bbl
+gnutls.blg
+gnutls.idx
+gnutls.ilg
+gnutls.ind
+gnutls.log
+gnutls.out
+gnutls.pdf
+gnutls.toc
+missfont.log
+extra-api.tex
+gnutls-api.tex
+cover.tex
+error_codes.tex
+cha-tls-app.tex
+cha-support.tex
+cha-programs.tex
+cha-preface.tex
+cha-library.tex
+cha-intro-tls.tex
+cha-gtls-app.tex
+cha-functions.tex
+cha-ciphersuites.tex
+cha-cert-auth.tex
+cha-auth.tex
+algorithms.tex
+x509-api.tex
+pgp-api.tex
+cha-errors.tex
diff --git a/doc/latex/Makefile.am b/doc/latex/Makefile.am
new file mode 100644
index 0000000..1e86cf3
--- /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 > address@hidden
+       mv -f address@hidden $@
+
+algorithms.tex: $(srcdir)/../printlist.c $(builddir)/../printlist
+       $(builddir)/../printlist --latex > address@hidden
+       mv -f address@hidden $@
+
+gnutls-api.tex: $(srcdir)/../../lib/*.c $(srcdir)/../../lib/ext/*.c 
$(srcdir)/../../lib/auth/*.c $(srcdir)/../../lib/algorithms/*.c
+       echo "" > address@hidden
+       for i in $^; do \
+               echo -n "Creating documentation for file $$i... " && \
+               $(srcdir)/../scripts/gdoc -tex $$i >> address@hidden && \
+               echo "ok"; \
+       done
+       $(srcdir)/../scripts/sort1.pl < address@hidden > address@hidden
+       rm -f address@hidden
+       mv -f address@hidden $@
+
+x509-api.tex: $(srcdir)/../../lib/x509/*.c
+       echo "" > address@hidden
+       for i in $^; do \
+               echo -n "Creating documentation for file $$i... " && \
+               $(srcdir)/../scripts/gdoc -tex $$i >> address@hidden && \
+               echo "ok"; \
+       done
+       $(srcdir)/../scripts/sort1.pl < address@hidden > address@hidden
+       rm -f address@hidden
+       mv -f address@hidden $@
+
+pgp-api.tex: $(srcdir)/../../lib/openpgp/*.c
+       echo "" > address@hidden
+       for i in $^; do \
+               echo -n "Creating documentation for file $$i... " && \
+               $(srcdir)/../scripts/gdoc -tex $$i >> address@hidden && \
+               echo "ok"; \
+       done
+       $(srcdir)/../scripts/sort1.pl < address@hidden > address@hidden
+       rm -f address@hidden
+       mv -f address@hidden $@
+
+extra-api.tex: $(srcdir)/../../libextra/gnutls_extra.c
+       echo "" > address@hidden
+       for i in $^; do \
+               echo -n "Creating documentation for file $$i... " && \
+               $(srcdir)/../scripts/gdoc -tex $$i >> address@hidden && \
+               echo "ok"; \
+       done
+       $(srcdir)/../scripts/sort1.pl < address@hidden > address@hidden
+       rm -f address@hidden
+       mv -f address@hidden $@
+
+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 0000000..0c51e18
--- /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}
+\\
address@hidden
+{\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/fdl-1.3.texi b/doc/latex/fdl.tex
similarity index 64%
copy from doc/fdl-1.3.texi
copy to doc/latex/fdl.tex
index fc19ddd..40a4a68 100644
--- a/doc/fdl-1.3.texi
+++ b/doc/latex/fdl.tex
@@ -1,23 +1,33 @@
address@hidden The GNU Free Documentation License.
address@hidden Version 1.3, 3 November 2008
+%---------------------------------------------------------------------
+\chapter*{\rlap{GNU Free Documentation License}}
+\phantomsection  % so hyperref creates bookmarks
+\addcontentsline{toc}{chapter}{GNU Free Documentation License}
+%\label{label_fdl}
 
address@hidden This file is intended to be included within another document,
address@hidden hence no sectioning command or @node.
+ \begin{center}
 
address@hidden
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, 
Inc.
address@hidden://fsf.org/}
+       Version 1.3, 3 November 2008
 
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
address@hidden display
 
address@hidden 0
address@hidden
-PREAMBLE
+ 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 @dfn{free} in the sense of freedom: to
+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
@@ -37,35 +47,39 @@ 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.
 
address@hidden
-APPLICABILITY AND DEFINITIONS
+
+\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 ``Document'', below,
+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 ``you''.  You accept the license if you
+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 ``Modified Version'' of the Document means any work containing the
+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 ``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
+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 ``Invariant Sections'' are certain Secondary Sections whose titles
+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
@@ -73,12 +87,12 @@ 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 ``Cover Texts'' are certain short passages of text that are listed,
+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 ``Transparent'' copy of the Document means a machine-readable copy,
+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
@@ -89,36 +103,35 @@ 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 ``Opaque''.
+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, address@hidden 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 ``Title Page'' means, for a printed book, the title page itself,
+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 ``publisher'' means any person or entity that distributes copies
-of the Document to the public.
+The ``\textbf{publisher}'' means any person or entity that distributes
+copies of the Document to the public.
 
-A section ``Entitled XYZ'' means a named subunit of the Document whose
+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 ``Acknowledgements'',
-``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
+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.
 
@@ -129,8 +142,12 @@ 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.
 
address@hidden
-VERBATIM COPYING
+
+\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
@@ -140,13 +157,18 @@ 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.
+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.
 
address@hidden
-COPYING IN QUANTITY
+
+\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
@@ -183,8 +205,12 @@ 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.
 
address@hidden
-MODIFICATIONS
+
+\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
@@ -193,84 +219,84 @@ 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:
 
address@hidden A
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-State on the Title page the name of the publisher of the
-Modified Version, as the publisher.
-
address@hidden
-Preserve all the copyright notices of the Document.
-
address@hidden
-Add an appropriate copyright notice for your modifications
-adjacent to the other copyright notices.
-
address@hidden
-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.
-
address@hidden
-Preserve in that license notice the full lists of Invariant Sections
-and required Cover Texts given in the Document's license notice.
-
address@hidden
-Include an unaltered copy of this License.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-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.
-
address@hidden
-Delete any section Entitled ``Endorsements''.  Such a section
-may not be included in the Modified Version.
-
address@hidden
-Do not retitle any existing section to be Entitled ``Endorsements'' or
-to conflict in title with any Invariant Section.
-
address@hidden
-Preserve any Warranty Disclaimers.
address@hidden enumerate
+\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
@@ -299,11 +325,16 @@ 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.
 
address@hidden
-COMBINING DOCUMENTS
+
+\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
+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
@@ -321,11 +352,14 @@ 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.''
+and any sections Entitled ``Dedications''.  You must delete all sections
+Entitled ``Endorsements''.
 
address@hidden
-COLLECTIONS OF DOCUMENTS
+\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
@@ -338,8 +372,13 @@ 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.
 
address@hidden
-AGGREGATION WITH INDEPENDENT WORKS
+
+\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
@@ -350,7 +389,7 @@ 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
+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
@@ -358,11 +397,16 @@ electronic equivalent of covers if the Document is in 
electronic form.
 Otherwise they must appear on printed covers that bracket the whole
 aggregate.
 
address@hidden
-TRANSLATION
+
+\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.
+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
@@ -375,12 +419,17 @@ 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
+``Dedications'', or ``History'', the requirement (section~4) to Preserve
+its Title (section~1) will typically require changing the actual
 title.
 
address@hidden
-TERMINATION
+
+\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
@@ -407,14 +456,19 @@ 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.
 
address@hidden
-FUTURE REVISIONS OF THIS LICENSE
+
+\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
address@hidden://www.gnu.org/copyleft/}.
+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
@@ -429,8 +483,13 @@ License can be used, that proxy's public statement of 
acceptance of a
 version permanently authorizes you to choose that version for the
 Document.
 
address@hidden
-RELICENSING
+
+\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
@@ -459,38 +518,39 @@ 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.
 
address@hidden enumerate
 
address@hidden
address@hidden ADDENDUM: How to use this License for your documents
+\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:
 
address@hidden
address@hidden
-  Copyright (C)  @var{year}  @var{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''.
address@hidden group
address@hidden smallexample
-
+\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 address@hidden'' line with this:
-
address@hidden
address@hidden
-    with the Invariant Sections being @var{list their titles}, with
-    the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
-    being @var{list}.
address@hidden group
address@hidden smallexample
-
+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.
@@ -500,7 +560,4 @@ 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.
 
address@hidden Local Variables:
address@hidden ispell-local-pdict: "ispell-dict"
address@hidden End:
-
+%---------------------------------------------------------------------
diff --git a/doc/latex/gnutls.bib b/doc/latex/gnutls.bib
new file mode 100644
index 0000000..121c221
--- /dev/null
+++ b/doc/latex/gnutls.bib
@@ -0,0 +1,289 @@
address@hidden 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";
+}
+
address@hidden,
+  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";
+}
+
address@hidden,
+  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";
+}
+
address@hidden,
+  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";
+}
+
address@hidden,
+ publisher = "RSA Laboratories",
+ title = "{PKCS \#11 Base Functionality v2.30: Cryptoki – Draft 4}",
+ url = "http://www.rsa.com";,
+ month="July",
+ year=2009
+}
+
address@hidden,
+ 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
+}
+
address@hidden,
+  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";
+}
+
address@hidden 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";
+}
+
address@hidden 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/";,
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden,
+       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";
+}
+
address@hidden 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";
+}
+
address@hidden PKCS12,
+       author = "RSA Laboratories",
+       title = "{PKCS 12 v1.0}: Personal Information Exchange Syntax",
+       month = "June",
+       year = "1999"
+}
+
address@hidden RESCOLA,
+       author = "Eric Rescola",
+       title = "{SSL and TLS}: Designing and Building Secure Systems",
+       year = "2001"
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden 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";
+}
+
address@hidden TOMSRP,
+       author = "Tom Wu",
+       title = "The Stanford {SRP} Authentication Project",
+       note = "Available at http://srp.stanford.edu/";,
+       url = "http://srp.stanford.edu/";
+}
+
address@hidden 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 0000000..870b82e
--- /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 0000000..26df479
--- /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 743ffda..f3b7c4a 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 address@hidden 0x%02x address@hidden %s\n",
+        printf ("@item address@hidden 0x%02X address@hidden %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 0000000..7d1cb4a
--- /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-\\.\\/address@hidden:\_\\\\\#]";
+my $spacematch = "[\\s\\w\\d-\\.\\/address@hidden:]";
+my $mathmatch = "[\\s\\w\\d-\\.\\/\\:\\(\\)\\+\\/\\^\\'\\=\{\}\\\\\\,]";
+my $underscorematch = "[\\s\\w\\d-\\.\\/address@hidden:\\~]";
+my $codematch = "[\\s\\w\\d-\\.\\/address@hidden:\\-\\\"\+\\%]";
+my ($line, $prev_mode);
+my ($verbatim, $label);
+while ($line = <FILE>) {
+       $verbatim = 0;
+
+        if ($mode == SKIP) {
+#print "%menu: $line";
+                if ($line =~ m/address@hidden /) {
+                        $mode = NORMAL;
+                }
+               $prev_mode = $mode;
+                next;
+        } elsif ($mode == ITEMIZE) {
+#print "%itemize: $line";
+                if ($line =~ s/address@hidden itemize/\\end{itemize}/g) {
+                        $mode = NORMAL;
+                }
+                $line =~ s/address@hidden (.+)/\\item $1/g;
+               $prev_mode = $mode;
+        } elsif ($mode == ENUMERATE) {
+                if ($line =~ s/address@hidden itemize/\\end{enumerate}/g) {
+                        $mode = NORMAL;
+                }
+                if ($line =~ s/address@hidden enumerate/\\end{enumerate}/g) {
+                        $mode = NORMAL;
+                }
+                $line =~ s/address@hidden(.*)/\\item $1/g;
+               $prev_mode = $mode;
+        } elsif ($mode == TABLE_ITEMIZE) {
+                if ($line =~ s/address@hidden table/\n\\end{itemize}/g) {
+                        $mode = NORMAL;
+                }
+               chomp $line;
+               if ($line eq "") {
+                       next;
+               }
+               $line .= "\n";
+
+               $line =~ s/address@hidden (.+)/\\item $1 /g;
+               $line =~ s/address@hidden (.+)/\\item $1 /g;
+
+               $prev_mode = $mode;
+        } elsif ($mode == MULTITABLE) {
+                if ($line =~ s/address@hidden 
multitable/\\\\\n\\hline\n\\end{tabular}/g) {
+                        $mode = NORMAL;
+                } else {
+                       chomp $line;
+                       if ($line eq "") {
+                               next;
+                       }
+                       $line .= "\n";
+                       $line =~ s/address@hidden/\&/g;
+                       if ($line =~ m/address@hidden/) {
+                               $line =~ s/address@hidden 
(.+)/$1\\\\\n\\hline\n\\hline/g;
+                       } else {
+                               if ($prev_mode != $mode) {
+                                       $line =~ s/address@hidden (.+)/$1/g;
+                                       $line =~ s/address@hidden (.+)/$1/g;
+                               } else {
+                                       $line =~ s/address@hidden 
(.+)/\\\\\n\\hline\n$1/g;
+                                       $line =~ s/address@hidden 
(.+)/\\\\\n\\hline\n$1/g;
+                               }
+                       }
+               }
+               $prev_mode = $mode;
+        } elsif ($mode == VERBATIM) {
+                if ($line =~ s/address@hidden verbatim/\\end{verbatim}/g) {
+                        $mode = NORMAL;
+                }
+               $verbatim = 1;
+               $prev_mode = $mode;
+        } elsif ($mode == QUOTE) {
+                if ($line =~ s/address@hidden quotation/\\end{quote}/g) {
+                        $mode = NORMAL;
+                }
+               $prev_mode = $mode;
+        } elsif ($mode == EXAMPLE) {
+                if ($line =~ s/address@hidden example/\\end{example}/g) {
+                        $mode = NORMAL;
+                }
+               $line =~ s/address@hidden/{/g;
+               $line =~ s/address@hidden/}/g;
+               $verbatim = 1;
+
+               $prev_mode = $mode;
+        } elsif ($mode == SMALL_EXAMPLE) {
+                if ($line =~ s/address@hidden 
smallexample/\\end{smallexample}/g) {
+                        $mode = NORMAL;
+                }
+               $line =~ s/address@hidden/\{/g;
+               $line =~ s/address@hidden/\}/g;
+               $verbatim = 1;
+
+               $prev_mode = $mode;
+        } else {
+               $prev_mode = $mode;
+
+               $line =~ s/address@hidden/% /g;
+               $line =~ s/address@hidden iftex/% /g;
+                $line =~ s/address@hidden (.+)/\\label{$1}/g;
+               $line =~ s/address@hidden($spacematch+)\}/\\label{$1}/g;
+               if ($line =~ s/address@hidden (.+)/\\subsection{$1}/g) {
+                       if ($label ne '') {
+                               $line .= "\\label{$label}\n";
+                       }
+               }
+
+                if ($line =~ s/address@hidden (.+)/\\section{$1}/g) {
+                       if ($label ne '') {
+                               $line .= "\\label{$label}\n";
+                       }
+               }
+
+                if ($line =~ s/address@hidden (.+)/\\chapter{$1}/g) {
+                       if ($label ne '') {
+                               $line .= "\\label{$label}\n";
+                       }
+               }
+               if ($line =~ s/address@hidden (.+)/\\chapter{$1}/g) {
+                       if ($label ne '') {
+                               $line .= "\\label{$label}\n";
+                       }
+               }
+
+                if ($line =~ m/address@hidden (.+)/) {
+                       $label = $1;
+                       next;
+               } else {
+                       $label = '';
+               }
+
+                if ($line =~ s/address@hidden//g) {
+                        $mode = SKIP;
+                       next;
+                }
+                if ($line =~ s/address@hidden//g) {
+                        $mode = SKIP;
+                       next;
+                }
+                if ($line =~ s/address@hidden 
address@hidden/\\begin{itemize}/g) {
+                        $mode = ITEMIZE;
+                }
+                if ($line =~ s/address@hidden/\\begin{itemize}/g) {
+                        $mode = ITEMIZE;
+                }
+                if ($line =~ s/address@hidden/\\begin{enumerate}/g) {
+                        $mode = ENUMERATE;
+                }
+                if ($line =~ s/address@hidden .*/\n\\begin{itemize}/g) {
+                        $mode = TABLE_ITEMIZE;
+                }
+                if ($line =~ s/address@hidden address@hidden ([\.\d]+) 
([\.\d]+) 
([\.\d]+)$/\n\\begin{tabular}{|p{3.3cm}|p{3.3cm}|p{4.3cm}|}\n\\hline\n/g) {
+                        $mode = MULTITABLE;
+                }
+                if ($line =~ s/address@hidden address@hidden ([\.\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/address@hidden/\\begin{example}/g) {
+                        $mode = EXAMPLE;
+                }
+                if ($line =~ s/address@hidden/\\begin{smallexample}/g) {
+                        $mode = SMALL_EXAMPLE;
+                }
+                if ($line =~ s/address@hidden/\\begin{verbatim}/g) {
+                        $mode = VERBATIM;
+                }
+                if ($line =~ s/address@hidden/\\begin{quote}/g) {
+                        $mode = QUOTE;
+                }
+        }
+
+       if ($verbatim == 0) {
+               $line =~ s/\_/\\_/g;
+               $line =~ s/\~/\\~/g;
+               $line =~ s/\%/\\%/g;
+               $line =~ s/\#/\\\#/g;
+                $line =~ s/address@hidden (.*)/\\examplefile{\.\.\/$1}/g;
+               $line =~ 
s/address@hidden($match+)\,($match+)\}/\\includegraphics\[width\=$2\]\{\.\.\/$1\}/g;
+               $line =~ s/address@hidden($spacematch+)\}/$1/g;
+               $line =~ s/address@hidden/\{\\bf /g;
+               $line =~ s/address@hidden (.*)/\% $1/g;
+               $line =~ s/address@hidden($mathmatch+)\}/\$$1\$/g;
+               $line =~ s/address@hidden($spacematch+)\}/\\acronym{$1}/g;
+               $line =~ s/address@hidden($match+)\}/~\\cite{$1}/g;
+               $line =~ s/address@hidden/\\footnote{/g;
+               $line =~ s/address@hidden (.+)/\\index{$1}/g;
+               if ($line =~ s/address@hidden (.+)/\\input{$1}/g) {
+                       $line =~ s/\.texi/\.tex/g;
+                       $line =~ 
s/(\\input)\{($underscorematch+)\}/$punescape->($1,$2)/ge;
+               }
+               $line =~ s/address@hidden (.+)/\\index{$1}/g;
+               $line =~ s/address@hidden($underscorematch+)\}/\\url{$1}/g;
+               #$line =~ s/address@hidden/\\euro/g;
+               $line =~ s/address@hidden/euro/g;
+               $line =~ s/address@hidden($spacematch+)\}/\\file{$1}/g;
+               $line =~ s/address@hidden($codematch+)\}/\\code{$1}/g;
+               $line =~ s/address@hidden($codematch+)\}/\\command{$1}/g;
+               $line =~ s/address@hidden($codematch+)\}/\\command{$1}/g;
+               $line =~ s/address@hidden/\\myref\{/g;
+               $line =~ s/address@hidden($spacematch+)\}/\\emph{$1}/g;
+               $line =~ s/address@hidden/\\myref\{/g;
+               $line =~ s/address@hidden($codematch+)\}/$pfuncref->($1)/ge;
+               $line =~ s/address@hidden/\\myref\{/g;
+               $line =~ s/address@hidden 
(.*)/\\begin{center}\n$1\n\\end{center}/g;
+               if ($line =~ m/address@hidden/) {
+                       $line =~ s/address@hidden(.+)\}/$1/g;
+               }
+               $line =~ s/address@hidden@/@/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 0000000..9d31ed4
--- /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.
address@hidden = <>;  # Read in whole file, one record per array element.
+
address@hidden = 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 32e1013..0000000
--- 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
address@hidden
address@hidden 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}.
-
address@hidden 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')}.
-
address@hidden Collision resistance. That means that it is impossible to 
calculate random @math{x} and @math{x'} such
address@hidden(x')=H(x)}.
address@hidden 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
address@hidden
address@hidden(\rm{hash\ size}) / 2}} 
address@hidden iftex
address@hidden
address@hidden((hash size) / 2)}} 
address@hidden 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
address@hidden  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.
-
address@hidden Supported Algorithms
-The available digital signature algorithms in @acronym{GnuTLS} are
-listed below:
-
address@hidden @code
address@hidden RSA
-RSA is public key cryptosystem designed by Ronald Rivest, Adi Shamir
-and Leonard Adleman. It can be used with any hash functions.
-
address@hidden DSA
-DSA is the USA's Digital Signature Standard. It uses only the SHA-1
-hash algorithm.
-
address@hidden table
-
-The supported cryptographic hash algorithms are:
-
address@hidden @code
address@hidden 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.
-
address@hidden MD5
-MD5 is a cryptographic hash algorithm designed by Ron Rivest. Outputs
-128 bits of data. It is considered to be broken.
-
address@hidden 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.
-
address@hidden RMD160
-RIPEMD is a cryptographic hash algorithm developed in the framework of
-the EU project RIPE. Outputs 160 bits of data.
-
address@hidden table
-
-
address@hidden 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
address@hidden with the
address@hidden or
address@hidden flag, as in:
-
address@hidden
-  gnutls_certificate_set_verify_flags (x509cred,
-                                       GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5);
address@hidden 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
address@hidden, you can pass the
address@hidden parameter directly in the
address@hidden 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
address@hidden 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
address@hidden, you could present a warning.
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 1e0be23..f6d788e 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -1198,7 +1198,7 @@ _gnutls_recv_int (gnutls_session_t session, 
content_type_t type,
  * MSG_DONTWAIT flag if blocking is a problem.
  *
  * If the EINTR is returned by the internal push function (the
- * default is send()} then %GNUTLS_E_INTERRUPTED will be returned. If
+ * default is send()) then %GNUTLS_E_INTERRUPTED will be returned. If
  * %GNUTLS_E_INTERRUPTED or %GNUTLS_E_AGAIN is returned, you must
  * call this function again, with the same parameters; alternatively
  * you could provide a %NULL pointer for data, and 0 for
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index 27dee3e..f6bbd4d 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -1831,13 +1831,13 @@ gnutls_x509_crq_get_extension_by_oid (gnutls_x509_crq_t 
crq,
  * This function will set the subject alternative name certificate
  * extension.  It can set the following types:
  *
- * &GNUTLS_SAN_DNSNAME: as a text string
+ * %GNUTLS_SAN_DNSNAME: as a text string
  *
- * &GNUTLS_SAN_RFC822NAME: as a text string
+ * %GNUTLS_SAN_RFC822NAME: as a text string
  *
- * &GNUTLS_SAN_URI: as a text string
+ * %GNUTLS_SAN_URI: as a text string
  *
- * &GNUTLS_SAN_IPADDRESS: as a binary IP address (4 or 16 bytes)
+ * %GNUTLS_SAN_IPADDRESS: as a binary IP address (4 or 16 bytes)
  *
  * Other values can be set as binary values with the proper DER encoding.
  *
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 582968f..7211b32 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -2658,8 +2658,8 @@ gnutls_x509_crt_verify_hash (gnutls_x509_crt_t crt, 
unsigned int flags,
  * %GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN,
  * %GNUTLS_CRL_REASON_AA_COMPROMISE, or zero for all possible reasons.
  *
- * Returns: %GNUTLS_E_SHORT_MEMORY_BUFFER and updates &@ret_size if
- *   &@ret_size is not enough to hold the distribution point, or the
+ * Returns: %GNUTLS_E_SHORT_MEMORY_BUFFER and updates @ret_size if
+ *   @ret_size is not enough to hold the distribution point, or the
  *   type of the distribution point if everything was ok. The type is
  *   one of the enumerated %gnutls_x509_subject_alt_name_t.  If the
  *   certificate does not have an Alternative name with the specified
diff --git a/lib/x509/x509_write.c b/lib/x509/x509_write.c
index 45c3e74..a87e8ec 100644
--- a/lib/x509/x509_write.c
+++ b/lib/x509/x509_write.c
@@ -593,13 +593,13 @@ gnutls_x509_crt_set_subject_alternative_name 
(gnutls_x509_crt_t crt,
  * This function will set the subject alternative name certificate
  * extension. It can set the following types:
  *
- * &GNUTLS_SAN_DNSNAME: as a text string
+ * %GNUTLS_SAN_DNSNAME: as a text string
  *
- * &GNUTLS_SAN_RFC822NAME: as a text string
+ * %GNUTLS_SAN_RFC822NAME: as a text string
  *
- * &GNUTLS_SAN_URI: as a text string
+ * %GNUTLS_SAN_URI: as a text string
  *
- * &GNUTLS_SAN_IPADDRESS: as a binary IP address (4 or 16 bytes)
+ * %GNUTLS_SAN_IPADDRESS: as a binary IP address (4 or 16 bytes)
  * 
  * Other values can be set as binary values with the proper DER encoding.
  *


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]