From: Nikos Mavrogiannopoulos Date: Sat, 25 Jan 2014 09:24:16 +0000 (+0100) Subject: do not set the SYSTEM priority string by default in examples (not yet). X-Git-Tag: gnutls_3_3_0pre0~280 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bb69c0c6bb7b8b7fdcf3bd5705bfcc312e50857;p=thirdparty%2Fgnutls.git do not set the SYSTEM priority string by default in examples (not yet). --- diff --git a/doc/examples/ex-cert-select-pkcs11.c b/doc/examples/ex-cert-select-pkcs11.c index 7d091b1791..a7f4e7c5c3 100644 --- a/doc/examples/ex-cert-select-pkcs11.c +++ b/doc/examples/ex-cert-select-pkcs11.c @@ -19,10 +19,6 @@ #include #include /* for getpass() */ -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - /* A TLS client that loads the certificate and key. */ @@ -99,7 +95,7 @@ int main(void) /* priorities */ gnutls_priority_init(&priorities_cache, - GNUTLS_DEFAULT_PRIORITY, NULL); + "NORMAL", NULL); /* sets the trusted cas file */ diff --git a/doc/examples/ex-cert-select.c b/doc/examples/ex-cert-select.c index 5f12bb84a7..7437e269c7 100644 --- a/doc/examples/ex-cert-select.c +++ b/doc/examples/ex-cert-select.c @@ -28,10 +28,6 @@ #define KEY_FILE "key.pem" #define CAFILE "/etc/ssl/certs/ca-certificates.crt" -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - extern int tcp_connect(void); extern void tcp_close(int sd); @@ -111,7 +107,7 @@ int main(void) /* priorities */ gnutls_priority_init(&priorities_cache, - GNUTLS_DEFAULT_PRIORITY, NULL); + "NORMAL", NULL); /* sets the trusted cas file */ diff --git a/doc/examples/ex-client-dtls.c b/doc/examples/ex-client-dtls.c index c625240679..dcb0e101db 100644 --- a/doc/examples/ex-client-dtls.c +++ b/doc/examples/ex-client-dtls.c @@ -14,10 +14,6 @@ #include #include -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - /* A very basic Datagram TLS client, over UDP with X.509 authentication. */ @@ -58,7 +54,7 @@ int main(void) /* Use default priorities */ ret = gnutls_priority_set_direct(session, - GNUTLS_DEFAULT_PRIORITY, &err); + "NORMAL", &err); if (ret < 0) { if (ret == GNUTLS_E_INVALID_REQUEST) { fprintf(stderr, "Syntax error at: %s\n", err); diff --git a/doc/examples/ex-client-srp.c b/doc/examples/ex-client-srp.c index dc3b51cbd5..4542724651 100644 --- a/doc/examples/ex-client-srp.c +++ b/doc/examples/ex-client-srp.c @@ -9,10 +9,6 @@ #include #include -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - /* Those functions are defined in other examples. */ extern void check_alert(gnutls_session_t session, int ret); @@ -60,8 +56,7 @@ int main(void) /* Set the priorities. */ gnutls_priority_set_direct(session, - GNUTLS_DEFAULT_PRIORITY - ":+SRP:+SRP-RSA:+SRP-DSS", + "NORMAL:+SRP:+SRP-RSA:+SRP-DSS", NULL); /* put the SRP credentials to the current session diff --git a/doc/examples/ex-client-x509.c b/doc/examples/ex-client-x509.c index 2860a0c0cc..df96444f9f 100644 --- a/doc/examples/ex-client-x509.c +++ b/doc/examples/ex-client-x509.c @@ -11,10 +11,6 @@ #include #include "examples.h" -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - /* A very basic TLS client, with X.509 authentication and server certificate * verification. Note that error checking for missing files etc. is omitted * for simplicity. @@ -71,7 +67,7 @@ int main(void) /* Use default priorities */ ret = gnutls_priority_set_direct(session, - GNUTLS_DEFAULT_PRIORITY, &err); + "NORMAL", &err); if (ret < 0) { if (ret == GNUTLS_E_INVALID_REQUEST) { fprintf(stderr, "Syntax error at: %s\n", err); diff --git a/doc/examples/ex-serv-anon.c b/doc/examples/ex-serv-anon.c index 6ebfbdf082..dc0a55b90b 100644 --- a/doc/examples/ex-serv-anon.c +++ b/doc/examples/ex-serv-anon.c @@ -15,10 +15,6 @@ #include #include -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - /* This is a sample TLS 1.0 echo server, for anonymous authentication only. */ @@ -96,8 +92,7 @@ int main(void) for (;;) { gnutls_init(&session, GNUTLS_SERVER); gnutls_priority_set_direct(session, - GNUTLS_DEFAULT_PRIORITY - ":+ANON-ECDH:+ANON-DH", + "NORMAL::+ANON-ECDH:+ANON-DH", NULL); gnutls_credentials_set(session, GNUTLS_CRD_ANON, anoncred); diff --git a/doc/examples/ex-serv-pgp.c b/doc/examples/ex-serv-pgp.c index 519c2a74f5..d68a11ca49 100644 --- a/doc/examples/ex-serv-pgp.c +++ b/doc/examples/ex-serv-pgp.c @@ -16,10 +16,6 @@ #include #include -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define DEFAULT_PRIORITY "NORMAL" -#endif - #define KEYFILE "secret.asc" #define CERTFILE "public.asc" #define RINGFILE "ring.gpg" @@ -110,8 +106,7 @@ int main(void) for (;;) { gnutls_init(&session, GNUTLS_SERVER); gnutls_priority_set_direct(session, - GNUTLS_DEFAULT_PRIORITY - ":+CTYPE-OPENPGP", NULL); + "NORMAL:+CTYPE-OPENPGP", NULL); /* request client certificate if any. */ diff --git a/doc/examples/ex-serv-psk.c b/doc/examples/ex-serv-psk.c index 0c4c93ed11..c83658bc02 100644 --- a/doc/examples/ex-serv-psk.c +++ b/doc/examples/ex-serv-psk.c @@ -15,10 +15,6 @@ #include #include -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define DEFAULT_PRIORITY "NORMAL" -#endif - #define KEYFILE "key.pem" #define CERTFILE "cert.pem" #define CAFILE "/etc/ssl/certs/ca-certificates.crt" @@ -105,8 +101,7 @@ int main(void) generate_dh_params(); gnutls_priority_init(&priority_cache, - GNUTLS_DEFAULT_PRIORITY - ":+PSK:+ECDHE-PSK:+DHE-PSK", + "NORMAL:+PSK:+ECDHE-PSK:+DHE-PSK", NULL); gnutls_certificate_set_dh_params(x509_cred, dh_params); diff --git a/doc/examples/ex-serv-srp.c b/doc/examples/ex-serv-srp.c index 3b2cd57021..e2417654e1 100644 --- a/doc/examples/ex-serv-srp.c +++ b/doc/examples/ex-serv-srp.c @@ -15,10 +15,6 @@ #include #include -#if GNUTLS_VERSION_NUMBER < 0x030300 -# define GNUTLS_DEFAULT_PRIORITY "NORMAL" -#endif - #define SRP_PASSWD "tpasswd" #define SRP_PASSWD_CONF "tpasswd.conf" @@ -94,7 +90,7 @@ int main(void) for (;;) { gnutls_init(&session, GNUTLS_SERVER); gnutls_priority_set_direct(session, - GNUTLS_DEFAULT_PRIORITY + "NORMAL" ":-KX-ALL:+SRP:+SRP-DSS:+SRP-RSA", NULL); gnutls_credentials_set(session, GNUTLS_CRD_SRP, srp_cred); diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 7f84d6ab96..14e9d726f3 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -1079,7 +1079,6 @@ int gnutls_key_generate(gnutls_datum_t * key, unsigned int key_size); /* if you just want some defaults, use the following. */ -#define GNUTLS_DEFAULT_PRIORITY "SYSTEM" int gnutls_priority_init(gnutls_priority_t * priority_cache, const char *priorities, const char **err_pos); void gnutls_priority_deinit(gnutls_priority_t priority_cache);