#include <fcntl.h>
#include <getpass.h> /* for getpass() */
-#if GNUTLS_VERSION_NUMBER < 0x030300
-# define GNUTLS_DEFAULT_PRIORITY "NORMAL"
-#endif
-
/* A TLS client that loads the certificate and key.
*/
/* priorities */
gnutls_priority_init(&priorities_cache,
- GNUTLS_DEFAULT_PRIORITY, NULL);
+ "NORMAL", NULL);
/* sets the trusted cas file
*/
#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);
/* priorities */
gnutls_priority_init(&priorities_cache,
- GNUTLS_DEFAULT_PRIORITY, NULL);
+ "NORMAL", NULL);
/* sets the trusted cas file
*/
#include <gnutls/gnutls.h>
#include <gnutls/dtls.h>
-#if GNUTLS_VERSION_NUMBER < 0x030300
-# define GNUTLS_DEFAULT_PRIORITY "NORMAL"
-#endif
-
/* A very basic Datagram TLS client, over UDP with X.509 authentication.
*/
/* 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);
#include <string.h>
#include <gnutls/gnutls.h>
-#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);
/* 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
#include <gnutls/x509.h>
#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.
/* 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);
#include <unistd.h>
#include <gnutls/gnutls.h>
-#if GNUTLS_VERSION_NUMBER < 0x030300
-# define GNUTLS_DEFAULT_PRIORITY "NORMAL"
-#endif
-
/* This is a sample TLS 1.0 echo server, for anonymous authentication only.
*/
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);
#include <gnutls/gnutls.h>
#include <gnutls/openpgp.h>
-#if GNUTLS_VERSION_NUMBER < 0x030300
-# define DEFAULT_PRIORITY "NORMAL"
-#endif
-
#define KEYFILE "secret.asc"
#define CERTFILE "public.asc"
#define RINGFILE "ring.gpg"
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.
*/
#include <unistd.h>
#include <gnutls/gnutls.h>
-#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"
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);
#include <unistd.h>
#include <gnutls/gnutls.h>
-#if GNUTLS_VERSION_NUMBER < 0x030300
-# define GNUTLS_DEFAULT_PRIORITY "NORMAL"
-#endif
-
#define SRP_PASSWD "tpasswd"
#define SRP_PASSWD_CONF "tpasswd.conf"
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);
/* 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);