summaryrefslogtreecommitdiff
path: root/lib/includes/gnutls
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-02-08 11:23:33 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-02-10 10:10:31 +0100
commit397e5b476854a9b94bf0aeb52e94a26a7cdd3add (patch)
treed9749415e33595d6300a647f2eaa7a678db4d74c /lib/includes/gnutls
parent5bf3ec7228dba60c27c1dc3ed5022d705ae9980d (diff)
downloadgnutls-397e5b476854a9b94bf0aeb52e94a26a7cdd3add.tar.gz
ALPN: added the GNUTLS_ALPN_SERVER_PRECEDENCE flag
This allows the server to set precedence on the protocols it supports, rather than following the client's order. Resolves #71
Diffstat (limited to 'lib/includes/gnutls')
-rw-r--r--lib/includes/gnutls/gnutls.h.in17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index e9e613918d..ec7065b50e 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -1212,7 +1212,22 @@ int gnutls_srtp_set_mki(gnutls_session_t session,
int gnutls_srtp_get_mki(gnutls_session_t session, gnutls_datum_t * mki);
/* ALPN TLS extension */
-#define GNUTLS_ALPN_MAND 1
+
+/**
+ * gnutls_alpn_flags_t:
+ * @GNUTLS_ALPN_MANDATORY: Require ALPN negotiation. The connection will be
+ * aborted if no matching ALPN protocol is found.
+ * @GNUTLS_ALPN_SERVER_PRECEDENCE: The choices set by the server
+ * will take precedence over the client's.
+ *
+ * Enumeration of different ALPN flags. These are used by gnutls_alpn_set_protocols().
+ */
+typedef enum {
+ GNUTLS_ALPN_MANDATORY = 1,
+ GNUTLS_ALPN_SERVER_PRECEDENCE = (1<<1)
+} gnutls_alpn_flags_t;
+
+#define GNUTLS_ALPN_MAND GNUTLS_ALPN_MANDATORY
int gnutls_alpn_get_selected_protocol(gnutls_session_t session,
gnutls_datum_t * protocol);
int gnutls_alpn_set_protocols(gnutls_session_t session,