Skip to content

Commit

Permalink
tls: removed newline character from cipher message string
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Jan 4, 2019
1 parent d3a2a44 commit e66646a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/dird/fd_cmds.cc
Expand Up @@ -183,6 +183,7 @@ static void SendInfoChosenCipher(JobControlRecord *jcr, UaContext *ua)
{
std::string str;
jcr->file_bsock->GetCipherMessageString(str);
str += '\n';
if (jcr->JobId != 0) {
Jmsg(jcr, M_INFO, 0, str.c_str());
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/lib/bsock.cc
Expand Up @@ -623,17 +623,17 @@ void BareosSocket::GetCipherMessageString(std::string &str) const
std::string m;
m = " Encryption: ";
m += tls_conn->TlsCipherGetName();
m += "\n";
str = m;
} else {
str = " Encryption: None\n";
str = " Encryption: None";
}
}

void BareosSocket::OutputCipherMessageString(std::function<void(const char *)> output_cb)
{
std::string str;
GetCipherMessageString(str);
str += '\n';
output_cb(str.c_str());
}

Expand Down
1 change: 1 addition & 0 deletions core/src/tests/bsock_test_connection_setup.cc
Expand Up @@ -145,6 +145,7 @@ static void CheckEncryption(const BareosSocket *UA_sock,
EXPECT_TRUE(UA_sock->tls_conn.get());
std::string cipher;
UA_sock->GetCipherMessageString(cipher);
cipher += '\n';
std::cout << cipher;
}
}
Expand Down

0 comments on commit e66646a

Please sign in to comment.