From: Nikos Mavrogiannopoulos Date: Thu, 10 Oct 2002 22:15:26 +0000 (+0000) Subject: more documentation updates X-Git-Tag: gnutls_0_5_x_before_int_fixes~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d19eeeb021270ded3b4d8fe7ca09fbe69b6054b;p=thirdparty%2Fgnutls.git more documentation updates --- diff --git a/doc/tex/ex-alert.tex b/doc/tex/ex-alert.tex index 8afe6e69b6..b5cd0f9cfb 100644 --- a/doc/tex/ex-alert.tex +++ b/doc/tex/ex-alert.tex @@ -17,7 +17,7 @@ void check_alert(gnutls_session session, int ret) last_alert = gnutls_alert_get(session); /* The check for renegotiation is only useful if we are - * a client, and should be removed otherwise. + * a server, and we had requested a rehandshake. */ if (last_alert == GNUTLS_A_NO_RENEGOTIATION && ret == GNUTLS_E_WARNING_ALERT_RECEIVED) diff --git a/doc/tex/ex-rfc2818.tex b/doc/tex/ex-rfc2818.tex index a50bdf70b3..b22895c06a 100644 --- a/doc/tex/ex-rfc2818.tex +++ b/doc/tex/ex-rfc2818.tex @@ -24,7 +24,7 @@ void verify_certificate( gnutls_session session, const char* hostname) } if ( gnutls_certificate_expiration_time_peers(session) < time(0)) { - printf("The certificate is expired\n"); + printf("The certificate has expired\n"); return; } diff --git a/doc/tex/examples.tex b/doc/tex/examples.tex index 3bf599b1f3..cc0c88e07d 100644 --- a/doc/tex/examples.tex +++ b/doc/tex/examples.tex @@ -28,14 +28,9 @@ This function should be called after a successful \par HTTPS clients have to verify not only the peer's certificate, but also the hostname in this certificate. That is to know that they actually connected to the right site. -RFC2818 specifies some hostname checking algorithm, and this --a simple form-- -is implemented in the following example. \par -This function should be called right after a successful -\printfunc{gnutls_certificate_verify_peers}{gnutls\_certificate\_verify\_peers}. -See also -\printfunc{gnutls_x509_check_certificates_hostname}{gnutls\_x509\_check\_certificates\_hostname}. +The following function is an example on how to fully verify a certificate. \input{ex-rfc2818} diff --git a/lib/rfc2818_hostname.c b/lib/rfc2818_hostname.c index f1fbd8d5f2..a3e11a14b2 100644 --- a/lib/rfc2818_hostname.c +++ b/lib/rfc2818_hostname.c @@ -33,6 +33,8 @@ static int hostname_compare(const char *certname, const char *hostname); * the given hostname. This is a basic implementation of the matching described * in RFC2818 (HTTPS). * + * Returns 1 on success, and 0 on failure. + * **/ int gnutls_x509_check_certificates_hostname(const gnutls_datum * cert, const char *hostname)