]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
cxx: bring few modern functions, and allow to get the raw session
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 12 May 2018 06:47:15 +0000 (08:47 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 12 May 2018 06:56:20 +0000 (08:56 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lib/gnutlsxx.cpp
lib/includes/gnutls/gnutlsxx.h

index 6a3de6af1699cc651deac031143fc35c342455f8..98f12a1358af48681879b03822e34508c57e5329 100644 (file)
@@ -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);
index 561dcaca1f93b91b7ae8e9b0d408e2f5f3bf94d8..28f38e93e513ee43417678146f6399d294eacc99 100644 (file)
@@ -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);