From: Nikos Mavrogiannopoulos Date: Thu, 14 Nov 2002 09:19:56 +0000 (+0000) Subject: updated the basic client to support OpenPGP certificate authentication. X-Git-Tag: gnutls_0_6_0~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fa7654b6c7694f74fc733d7337fdda3413a3ee1;p=thirdparty%2Fgnutls.git updated the basic client to support OpenPGP certificate authentication. --- diff --git a/doc/tex/ex-client2.tex b/doc/tex/ex-client2.tex index 646e78a86e..cebb584c8f 100644 --- a/doc/tex/ex-client2.tex +++ b/doc/tex/ex-client2.tex @@ -28,12 +28,10 @@ int main() gnutls_session session; char buffer[MAX_BUF + 1]; gnutls_certificate_client_credentials xcred; - const int protocol_priority[] = { GNUTLS_TLS1, GNUTLS_SSL3, 0 }; - const int kx_priority[] = { GNUTLS_KX_RSA, 0 }; - const int cipher_priority[] = { GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR_128, 0}; - const int comp_priority[] = { GNUTLS_COMP_NULL, 0 }; - const int mac_priority[] = { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 }; - + /* Allow connections to servers that have OpenPGP keys as well. + */ + const int cert_type_priority[2] = { GNUTLS_CRT_X509, + GNUTLS_CRT_OPENPGP, 0 }; gnutls_global_init(); @@ -62,27 +60,9 @@ int main() */ gnutls_init(&session, GNUTLS_CLIENT); - /* allow both SSL3 and TLS1 - */ - gnutls_protocol_set_priority(session, protocol_priority); - - /* allow only ARCFOUR and 3DES ciphers - * (3DES has the highest priority) - */ - gnutls_cipher_set_priority(session, cipher_priority); - - /* only allow null compression - */ - gnutls_compression_set_priority(session, comp_priority); - - /* use GNUTLS_KX_RSA - */ - gnutls_kx_set_priority(session, kx_priority); - - /* allow the usage of both SHA and MD5 - */ - gnutls_mac_set_priority(session, mac_priority); - + /* Use default priorities */ + gnutls_set_default_priority(session); + gnutls_certificate_type_set_priority(session, cert_type_priority); /* put the x509 credentials to the current session */ diff --git a/doc/tex/examples.tex b/doc/tex/examples.tex index 2966ad818f..eceececac0 100644 --- a/doc/tex/examples.tex +++ b/doc/tex/examples.tex @@ -7,7 +7,7 @@ Note that these examples contain little or no error checking. \subsection{Simple client example with X.509 certificate support} Let's assume now that we want to create a client which communicates -with servers using the X.509 authentication schema. The following client +with servers that use X.509 or OpenPGP certificate authentication. The following client is a very simple \tls{} client, it does not support session resuming nor any other fancy features. \input{ex-client2}