Skip to content

Commit

Permalink
DoTlsHandshake: changed first call-parameter to TlsConfigBase::BNET_T…
Browse files Browse the repository at this point in the history
…LS_AUTO

- wherever tsl will negotiate without prior cleartext (md5/ssl) bareos handshake
  • Loading branch information
franku committed Sep 17, 2018
1 parent e0bf946 commit e53a8ef
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/src/console/console.cc
Expand Up @@ -1021,8 +1021,8 @@ BareosSocket *ConnectToDirector(JobControlRecord &jcr, utime_t heart_beat, char
return nullptr;
}

if (!UA_sock->DoTlsHandshake(4, local_tls_resource, false, qualified_resource_name.c_str(), password->value,
&jcr)) {
if (!UA_sock->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, local_tls_resource, false,
qualified_resource_name.c_str(), password->value, &jcr)) {
sendit(errmsg);
TerminateConsole(0);
return nullptr;
Expand Down
8 changes: 4 additions & 4 deletions core/src/dird/authenticate.cc
Expand Up @@ -73,8 +73,8 @@ bool AuthenticateWithStorageDaemon(JobControlRecord *jcr, StorageResource *store
TlsResource *tls_configuration = dynamic_cast<TlsResource *>(store);
BareosSocket *sd = jcr->store_bsock;

if (!sd->DoTlsHandshake(4, tls_configuration, false, qualified_resource_name.c_str(), store->password.value,
jcr)) {
if (!sd->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, tls_configuration, false, qualified_resource_name.c_str(),
store->password.value, jcr)) {
Dmsg0(100, "Could not DoTlsHandshake() with a storage daemon\n");
return false;
}
Expand Down Expand Up @@ -142,8 +142,8 @@ bool AuthenticateWithFileDaemon(JobControlRecord *jcr)

TlsResource *tls_configuration = dynamic_cast<TlsResource *>(client);

if (!fd->DoTlsHandshake(4, tls_configuration, false, qualified_resource_name.c_str(), client->password.value,
jcr)) {
if (!fd->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, tls_configuration, false,
qualified_resource_name.c_str(), client->password.value, jcr)) {
Dmsg0(100, "Could not DoTlsHandshake() with a storage daemon\n");
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/sd_cmds.cc
Expand Up @@ -146,8 +146,8 @@ bool ConnectToStorageDaemon(JobControlRecord *jcr, int retry_interval,
}

TlsResource *tls_configuration = dynamic_cast<TlsResource *>(store);
if (!sd->DoTlsHandshake(4, tls_configuration, false, qualified_resource_name.c_str(),
tls_configuration->password.value, jcr)) {
if (!sd->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, tls_configuration, false, qualified_resource_name.c_str(),
tls_configuration->password.value, jcr)) {
Dmsg0(100, "Could not DoTlsHandshake() with storagedaemon\n");
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions core/src/filed/dir_cmd.cc
Expand Up @@ -1595,7 +1595,8 @@ static bool StorageCmd(JobControlRecord *jcr)
}

tls_resource = dynamic_cast<TlsResource *>(me);
if (!sd->DoTlsHandshake(4, tls_resource, false, qualified_resource_name.c_str(), jcr->sd_auth_key, jcr)) {
if (!sd->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, tls_resource, false,
qualified_resource_name.c_str(), jcr->sd_auth_key, jcr)) {
goto bail_out;
}

Expand Down Expand Up @@ -2149,7 +2150,7 @@ static BareosSocket *connect_to_director(JobControlRecord *jcr, DirectorResource

TlsResource *tls_configuration = dynamic_cast<TlsResource *>(dir_res);

if (!dir->DoTlsHandshake(4, tls_configuration, false, qualified_resource_name.c_str(),
if (!dir->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, tls_configuration, false, qualified_resource_name.c_str(),
dir_res->password.value, jcr)) {
Dmsg0(100, "Could not DoTlsHandshake() with director\n");
return nullptr;
Expand Down
3 changes: 2 additions & 1 deletion core/src/stored/dir_cmd.cc
Expand Up @@ -1645,7 +1645,8 @@ static bool ReplicateCmd(JobControlRecord *jcr)
}

tls_resource = dynamic_cast<TlsResource *>(me);
if (!sd->DoTlsHandshake(4, tls_resource, false, qualified_resource_name.c_str(), jcr->sd_auth_key, jcr)) {
if (!sd->DoTlsHandshake(TlsConfigBase::BNET_TLS_AUTO, tls_resource, false, qualified_resource_name.c_str(),
jcr->sd_auth_key, jcr)) {
goto bail_out;
}

Expand Down

0 comments on commit e53a8ef

Please sign in to comment.