Skip to content

Commit

Permalink
bsock: removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed May 31, 2018
1 parent c4eef05 commit 9185aea
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions core/src/lib/bsock.cc
Expand Up @@ -380,27 +380,11 @@ bool BareosSocket::two_way_authenticate(JobControlRecord *jcr,
goto auth_fatal;
}

/*
* get local tls need
*/

/*
* Timeout Hello after 10 min
*/
tid = StartBsockTimer(this, AUTH_TIMEOUT);

/*
* See if we initiate the challenge or respond to a challenge.
*/
if (initiated_by_remote) {
/*
* Challenge Remote.
*/
auth_success = cram_md5_challenge(this, password.value, local_tls_policy, compatible);
if (auth_success) {
/*
* Respond to remote challenge
*/
auth_success = cram_md5_respond(this, password.value, &remote_tls_policy, &compatible);
if (!auth_success) {
Dmsg1(debuglevel, "Respond cram-get-auth failed with %s\n", who());
Expand All @@ -409,16 +393,10 @@ bool BareosSocket::two_way_authenticate(JobControlRecord *jcr,
Dmsg1(debuglevel, "Challenge cram-auth failed with %s\n", who());
}
} else {
/*
* Respond to remote challenge
*/
auth_success = cram_md5_respond(this, password.value, &remote_tls_policy, &compatible);
if (!auth_success) {
Dmsg1(debuglevel, "cram_respond failed for %s\n", who());
} else {
/*
* Challenge Remote.
*/
auth_success = cram_md5_challenge(this, password.value, local_tls_policy, compatible);
if (!auth_success) {
Dmsg1(debuglevel, "cram_challenge failed for %s\n", who());
Expand All @@ -444,18 +422,12 @@ bool BareosSocket::two_way_authenticate(JobControlRecord *jcr,
goto auth_fatal;
}

/*
* Verify that the remote host is willing to meet our TLS requirements
*/
selected_local_tls = SelectTlsFromPolicy(tls_configuration, remote_tls_policy);
if (selected_local_tls != nullptr) {
if (selected_local_tls->GetVerifyPeer()) {
verify_list = selected_local_tls->GetVerifyList();
}

/*
* See if we are handshaking a passive client connection.
*/
if (initiated_by_remote) {
std::shared_ptr<TLS_CONTEXT> tls_ctx = selected_local_tls->CreateServerContext(
std::make_shared<PskCredentials>(identity, password.value));
Expand Down

0 comments on commit 9185aea

Please sign in to comment.