summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2007-10-24 00:15:54 +0300
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2007-10-24 00:15:54 +0300
commit12c545d3beb9c759e94cc091f5cbcf3850b3ce18 (patch)
treea2cd31f4efcf8270972a20891e3cf60936ae3ebe
parent70ab5bc909739bfb7bba653fc457c4c5d91dadeb (diff)
downloadgnutls-12c545d3beb9c759e94cc091f5cbcf3850b3ce18.tar.gz
Added some documentation for the new convert functions.
-rw-r--r--doc/examples/ex-client-srp.c8
-rw-r--r--doc/gnutls.texi1
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/examples/ex-client-srp.c b/doc/examples/ex-client-srp.c
index f1b5fa8d25..dde39bb105 100644
--- a/doc/examples/ex-client-srp.c
+++ b/doc/examples/ex-client-srp.c
@@ -28,6 +28,8 @@ extern void tcp_close (int sd);
#define SA struct sockaddr
#define MSG "GET / HTTP/1.0\r\n\r\n"
+#define MAX_PRIORITIES 3
+
int
main (void)
{
@@ -37,6 +39,7 @@ main (void)
char buffer[MAX_BUF + 1];
gnutls_srp_client_credentials_t srp_cred;
gnutls_certificate_credentials_t cert_cred;
+ int kx_priorities[MAX_PRIORITIES];
gnutls_global_init ();
@@ -45,6 +48,9 @@ main (void)
*/
gnutls_global_init_extra ();
+ gnutls_kx_convert_priority( kx_priorities, MAX_PRIORITIES,
+ "SRP, SRP-RSA, SRP-DSS", ',');
+
gnutls_srp_allocate_client_credentials (&srp_cred);
gnutls_certificate_allocate_credentials (&cert_cred);
@@ -64,7 +70,7 @@ main (void)
/* Set the priorities.
*/
gnutls_set_default_priority (session);
-
+ gnutls_kx_set_priority( session, kx_priorities);
/* put the SRP credentials to the current session
*/
diff --git a/doc/gnutls.texi b/doc/gnutls.texi
index 9029362ac1..4127eee67a 100644
--- a/doc/gnutls.texi
+++ b/doc/gnutls.texi
@@ -2293,6 +2293,7 @@ The following client is a very simple @acronym{SRP} @acronym{TLS}
client which connects to a server and authenticates using a
@emph{username} and a @emph{password}. The server may authenticate
itself using a certificate, and in that case it has to be verified.
+In this example we also show the usage of @ref{gnutls_kx_convert_priority}.
@verbatiminclude examples/ex-client-srp.c