summaryrefslogtreecommitdiff
path: root/doc/tex/serv1.tex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tex/serv1.tex')
-rw-r--r--doc/tex/serv1.tex15
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/tex/serv1.tex b/doc/tex/serv1.tex
index 7b7effa8e4..7d2ef42613 100644
--- a/doc/tex/serv1.tex
+++ b/doc/tex/serv1.tex
@@ -37,6 +37,11 @@ GNUTLS_STATE initialize_state()
{
GNUTLS_STATE state;
int ret;
+ const int protocol_priority[] = { GNUTLS_TLS1, GNUTLS_SSL3, 0 };
+ const int kx_priority[] = { GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0 };
+ const int cipher_priority[] = { GNUTLS_CIPHER_RIJNDAEL_CBC, GNUTLS_CIPHER_3DES_CBC, 0};
+ const int comp_priority[] = { GNUTLS_COMP_ZLIB, GNUTLS_COMP_NULL, 0 };
+ const int mac_priority[] = { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 };
gnutls_init(&state, GNUTLS_SERVER);
@@ -45,11 +50,11 @@ GNUTLS_STATE initialize_state()
if ((ret = gnutls_db_set_name(state, "gnutls-rsm.db")) < 0)
fprintf(stderr, "*** DB error (%d)\n\n", ret);
- gnutls_cipher_set_priority(state, GNUTLS_CIPHER_RIJNDAEL_CBC, GNUTLS_CIPHER_3DES_CBC, 0);
- gnutls_compression_set_priority(state, GNUTLS_COMP_ZLIB, GNUTLS_COMP_NULL, 0);
- gnutls_kx_set_priority(state, GNUTLS_KX_RSA, GNUTLS_KX_SRP, 0);
- gnutls_protocol_set_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0);
- gnutls_mac_set_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0);
+ gnutls_protocol_set_priority(state, protocol_priority);
+ gnutls_cipher_set_priority(state, cipher_priority);
+ gnutls_compression_set_priority(state, comp_priority);
+ gnutls_kx_set_priority(state, kx_priority);
+ gnutls_mac_set_priority(state, mac_priority);
gnutls_set_cred(state, GNUTLS_SRP, srp_cred);
gnutls_set_cred(state, GNUTLS_X509PKI, x509_cred);