summaryrefslogtreecommitdiffstats
path: root/lib/ext/pre_shared_key.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext/pre_shared_key.h')
-rw-r--r--lib/ext/pre_shared_key.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/ext/pre_shared_key.h b/lib/ext/pre_shared_key.h
new file mode 100644
index 0000000..f1ea62c
--- /dev/null
+++ b/lib/ext/pre_shared_key.h
@@ -0,0 +1,23 @@
+#ifndef GNUTLS_LIB_EXT_PRE_SHARED_KEY_H
+#define GNUTLS_LIB_EXT_PRE_SHARED_KEY_H
+
+#include "auth/psk.h"
+#include <hello_ext.h>
+#include "tls13/session_ticket.h"
+
+#define PRE_SHARED_KEY_TLS_ID 41
+
+extern const hello_ext_entry_st ext_mod_pre_shared_key;
+
+inline static
+unsigned _gnutls_have_psk_credentials(const gnutls_psk_client_credentials_t cred, gnutls_session_t session)
+{
+ if ((cred->get_function || cred->username.data) && session->internals.priorities->have_psk)
+ return 1;
+ else
+ return 0;
+}
+
+int _gnutls_generate_early_secrets_for_psk(gnutls_session_t session);
+
+#endif /* GNUTLS_LIB_EXT_PRE_SHARED_KEY_H */