summaryrefslogtreecommitdiff
path: root/modules/extra/m_ssl_gnutls.cpp
diff options
context:
space:
mode:
authorRobby- <robby@chat.be>2014-03-17 00:58:51 +0100
committerRobby- <robby@chat.be>2014-03-17 00:58:51 +0100
commitf436ce9912098f8856f16a6dfface7ce2ae4680b (patch)
tree917b666d130a2ae6253add575c2a077dad8bcdbf /modules/extra/m_ssl_gnutls.cpp
parentef9729fb02dd3e44f59b447b567cdeb450690344 (diff)
m_ssl_gnutls: Fix deprecation warnings when using newer GnuTLS versions.
Diffstat (limited to 'modules/extra/m_ssl_gnutls.cpp')
-rw-r--r--modules/extra/m_ssl_gnutls.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/extra/m_ssl_gnutls.cpp b/modules/extra/m_ssl_gnutls.cpp
index 1af208039..011530280 100644
--- a/modules/extra/m_ssl_gnutls.cpp
+++ b/modules/extra/m_ssl_gnutls.cpp
@@ -234,7 +234,11 @@ namespace GnuTLS
return ret;
}
+ #if (GNUTLS_VERSION_MAJOR < 2 || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR < 12))
static int cert_callback(gnutls_session_t sess, const gnutls_datum_t* req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t* sign_algos, int sign_algos_length, gnutls_retr_st* st);
+ #else
+ static int cert_callback(gnutls_session_t sess, const gnutls_datum_t* req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t* sign_algos, int sign_algos_length, gnutls_retr2_st* st);
+ #endif
public:
X509CertList certs;
@@ -253,7 +257,11 @@ namespace GnuTLS
throw ConfigException("Unable to set cert/key pair");
}
+ #if (GNUTLS_VERSION_MAJOR < 2 || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR < 12))
gnutls_certificate_client_set_retrieve_function(cred, cert_callback);
+ #else
+ gnutls_certificate_set_retrieve_function(cred, cert_callback);
+ #endif
}
~X509CertCredentials()
@@ -625,9 +633,16 @@ SSLSocketIO::SSLSocketIO() : sess(NULL), mycreds(me->cred)
mycreds->incrref();
}
+#if (GNUTLS_VERSION_MAJOR < 2 || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR < 12))
int GnuTLS::X509CertCredentials::cert_callback(gnutls_session_t sess, const gnutls_datum_t* req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t* sign_algos, int sign_algos_length, gnutls_retr_st* st)
{
st->type = GNUTLS_CRT_X509;
+#else
+int GnuTLS::X509CertCredentials::cert_callback(gnutls_session_t sess, const gnutls_datum_t* req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t* sign_algos, int sign_algos_length, gnutls_retr2_st* st)
+{
+ st->cert_type = GNUTLS_CRT_X509;
+ st->key_type = GNUTLS_PRIVKEY_X509;
+#endif
st->ncerts = me->cred->certs.size();
st->cert.x509 = me->cred->certs.raw();
st->key.x509 = me->cred->key.get();