diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-01-10 19:26:48 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-04 14:03:13 +0100 |
commit | 741300728a889b4ccaec35bd57efb072018c860c (patch) | |
tree | 1531c90303a6379a89966946c7e341fafb8ec18f /common/rfb/CSecurityTLS.cxx | |
parent | 77f0a61ec8f1488d6042b1370444bb2612604292 (diff) | |
download | tigervnc-741300728a889b4ccaec35bd57efb072018c860c.tar.gz tigervnc-741300728a889b4ccaec35bd57efb072018c860c.zip |
Use StringParameters directly
We don't need to make extra copies of the string in most cases, so let's
simplify the code and access the string directly when we can.
Diffstat (limited to 'common/rfb/CSecurityTLS.cxx')
-rw-r--r-- | common/rfb/CSecurityTLS.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index ca1c919b..aaf792d3 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -92,9 +92,6 @@ CSecurityTLS::CSecurityTLS(CConnection* cc, bool _anon) : CSecurity(cc), session(NULL), anon_cred(NULL), cert_cred(NULL), anon(_anon), tlsis(NULL), tlsos(NULL), rawis(NULL), rawos(NULL) { - cafile = X509CA.getData(); - crlfile = X509CRL.getData(); - if (gnutls_global_init() != GNUTLS_E_SUCCESS) throw AuthFailureException("gnutls_global_init failed"); } @@ -146,9 +143,6 @@ CSecurityTLS::~CSecurityTLS() { shutdown(); - delete[] cafile; - delete[] crlfile; - gnutls_global_deinit(); } @@ -287,10 +281,10 @@ void CSecurityTLS::setParam() if (gnutls_certificate_set_x509_system_trust(cert_cred) < 1) vlog.error("Could not load system certificate trust store"); - if (*cafile && gnutls_certificate_set_x509_trust_file(cert_cred,cafile,GNUTLS_X509_FMT_PEM) < 0) + if (gnutls_certificate_set_x509_trust_file(cert_cred, X509CA, GNUTLS_X509_FMT_PEM) < 0) vlog.error("Could not load user specified certificate authority"); - if (*crlfile && gnutls_certificate_set_x509_crl_file(cert_cred,crlfile,GNUTLS_X509_FMT_PEM) < 0) + if (gnutls_certificate_set_x509_crl_file(cert_cred, X509CRL, GNUTLS_X509_FMT_PEM) < 0) vlog.error("Could not load user specified certificate revocation list"); if (gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cert_cred) != GNUTLS_E_SUCCESS) |