summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-05-12 08:47:15 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-05-12 08:56:20 +0200
commitb49bfde8cf4d9dc10a365da4a7dddd904718b4eb (patch)
tree09e3e493781971e4ee1a909e00a6989e5d6f91b9
parent058b550a302a609ea6934f4ab99b95741025d1ba (diff)
downloadgnutls-b49bfde8cf4d9dc10a365da4a7dddd904718b4eb.tar.gz
cxx: bring few modern functions, and allow to get the raw session
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r--lib/gnutlsxx.cpp15
-rw-r--r--lib/includes/gnutls/gnutlsxx.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/gnutlsxx.cpp b/lib/gnutlsxx.cpp
index 6a3de6af16..98f12a1358 100644
--- a/lib/gnutlsxx.cpp
+++ b/lib/gnutlsxx.cpp
@@ -46,6 +46,11 @@ namespace gnutls
gnutls_deinit (s);
}
+ gnutls_session_t session::ptr()
+ {
+ return s;
+ }
+
int session::bye (gnutls_close_request_t how)
{
return RETWRAP (gnutls_bye (s, how));
@@ -292,6 +297,11 @@ namespace gnutls
}
// client session
+ void client_session::set_verify_cert (const char *hostname, unsigned flags)
+ {
+ gnutls_session_set_verify_cert(s, hostname, flags);
+ }
+
void client_session::set_server_name (gnutls_server_name_type_t type,
const void *name, size_t name_length)
{
@@ -469,6 +479,11 @@ namespace gnutls
gnutls_transport_set_pull_function (s, pull_func);
}
+ void session::set_transport_pull_timeout_function (gnutls_pull_timeout_func pull_timeout_func)
+ {
+ gnutls_transport_set_pull_timeout_function (s, pull_timeout_func);
+ }
+
void session::set_user_ptr (void *ptr)
{
gnutls_session_set_ptr (s, ptr);
diff --git a/lib/includes/gnutls/gnutlsxx.h b/lib/includes/gnutls/gnutlsxx.h
index 561dcaca1f..28f38e93e5 100644
--- a/lib/includes/gnutls/gnutlsxx.h
+++ b/lib/includes/gnutls/gnutlsxx.h
@@ -107,6 +107,7 @@ namespace gnutls {
session(unsigned int);
virtual ~ session();
+ gnutls_session_t ptr();
int bye(gnutls_close_request_t how);
int handshake();
@@ -189,6 +190,7 @@ namespace gnutls {
vec_push_func);
void set_transport_pull_function(gnutls_pull_func
pull_func);
+ void set_transport_pull_timeout_function (gnutls_pull_timeout_func pull_timeout_func);
void set_user_ptr(void *ptr);
void *get_user_ptr() const;
@@ -265,6 +267,7 @@ namespace gnutls {
client_session(int flags);
~client_session();
+ void set_verify_cert(const char *hostname, unsigned flags);
void set_server_name(gnutls_server_name_type_t type,
const void *name, size_t name_length);