switch (ret) {
case GNUTLS_E_WARNING_ALERT_RECEIVED: {
- auto alert = gnutls_alert_get(session.get());
- debugs(83, DBG_IMPORTANT, "TLS ALERT: " << gnutls_alert_get_name(alert));
- }
- // drop through to next case
+ auto alert = gnutls_alert_get(session.get());
+ debugs(83, DBG_IMPORTANT, "TLS ALERT: " << gnutls_alert_get_name(alert));
+ }
+ // drop through to next case
case GNUTLS_E_AGAIN:
case GNUTLS_E_INTERRUPTED:
Security::PeerOptions::PeerOptions()
{
- // init options consistent with an empty sslOptions
- parseOptions();
+ // init options consistent with an empty sslOptions
+ parseOptions();
}
void
return;
}
- if (sslVersion > 2) {
+ if (sslVersion > 2) {
// backward compatibility hack for sslversion= configuration
// only use if tls-min-version=N.N is not present
// values 0-2 for auto and SSLv2 are not supported any longer.
fatalf("Unknown TLS option '%s'", err);
}
parsedOptions = Security::ParsedOptions(op, [](gnutls_priority_t p) {
- gnutls_priority_deinit(p);
+ gnutls_priority_deinit(p);
});
#endif
}
Security::NewSessionObject(const Security::ContextPointer &ctx)
{
Security::SessionPointer session(SSL_new(ctx.get()), [](SSL *p) {
- debugs(83, 5, "SSL_free session=" << (void*)p);
- SSL_free(p);
- });
+ debugs(83, 5, "SSL_free session=" << (void*)p);
+ SSL_free(p);
+ });
debugs(83, 5, "SSL_new session=" << (void*)session.get());
return session;
}
gnutls_session_t tmp;
errCode = gnutls_init(&tmp, static_cast<unsigned int>(type) | GNUTLS_NONBLOCK);
Security::SessionPointer session(tmp, [](gnutls_session_t p) {
- debugs(83, 5, "gnutls_deinit session=" << (void*)p);
- gnutls_deinit(p);
+ debugs(83, 5, "gnutls_deinit session=" << (void*)p);
+ gnutls_deinit(p);
});
debugs(83, 5, "gnutls_init " << (type == Security::Io::BIO_TO_SERVER ? "client" : "server" )<< " session=" << (void*)session.get());
if (errCode != GNUTLS_E_SUCCESS) {
namespace Io
{
- enum Type {
+enum Type {
#if USE_OPENSSL
- BIO_TO_CLIENT = 6000,
- BIO_TO_SERVER
+ BIO_TO_CLIENT = 6000,
+ BIO_TO_SERVER
#elif USE_GNUTLS
- // NP: this is odd looking but correct.
- // 'to-client' means we are a server, and vice versa.
- BIO_TO_CLIENT = GNUTLS_SERVER,
- BIO_TO_SERVER = GNUTLS_CLIENT
+ // NP: this is odd looking but correct.
+ // 'to-client' means we are a server, and vice versa.
+ BIO_TO_CLIENT = GNUTLS_SERVER,
+ BIO_TO_SERVER = GNUTLS_CLIENT
#else
- BIO_TO_CLIENT = 6000,
- BIO_TO_SERVER
+ BIO_TO_CLIENT = 6000,
+ BIO_TO_SERVER
#endif
- };
+};
} // namespace Io
#if USE_OPENSSL
parsedOptions = 0;
#endif
- STUB_NOP
+ STUB_NOP
}
void Security::PeerOptions::parse(char const*) STUB
Security::ContextPointer Security::PeerOptions::createClientContext(bool) STUB_RETVAL(Security::ContextPointer())