summaryrefslogtreecommitdiffstats
path: root/src/mbedTLS++
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2023-05-11 22:05:17 +0200
committerMattes D <github@xoft.cz>2023-05-16 23:50:37 +0200
commitc9522fb740200ccef6230cec452c48efb31e5394 (patch)
tree7e74d70699e13dd0a92444a1a0add7a3059ac7ca /src/mbedTLS++
parentTry a timeout for jobs. (diff)
downloadcuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.gz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.bz2
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.lz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.xz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.zst
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.zip
Diffstat (limited to 'src/mbedTLS++')
-rw-r--r--src/mbedTLS++/BlockingSslClientSocket.cpp14
-rw-r--r--src/mbedTLS++/Sha1Checksum.cpp4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/mbedTLS++/BlockingSslClientSocket.cpp b/src/mbedTLS++/BlockingSslClientSocket.cpp
index bc9d07157..6e6410879 100644
--- a/src/mbedTLS++/BlockingSslClientSocket.cpp
+++ b/src/mbedTLS++/BlockingSslClientSocket.cpp
@@ -137,7 +137,7 @@ bool cBlockingSslClientSocket::Connect(const AString & a_ServerName, UInt16 a_Po
if (ret != 0)
{
- Printf(m_LastErrorText, "SSL initialization failed: -0x%x", -ret);
+ m_LastErrorText = fmt::format(FMT_STRING("SSL initialization failed: -0x{:x}"), -ret);
return false;
}
@@ -150,7 +150,7 @@ bool cBlockingSslClientSocket::Connect(const AString & a_ServerName, UInt16 a_Po
ret = m_Ssl.Handshake();
if (ret != 0)
{
- Printf(m_LastErrorText, "SSL handshake failed: -0x%x", -ret);
+ m_LastErrorText = fmt::format(FMT_STRING("SSL handshake failed: -0x{:x}"), -ret);
return false;
}
@@ -169,8 +169,8 @@ void cBlockingSslClientSocket::SetExpectedPeerName(AString a_ExpectedPeerName)
if (!m_ExpectedPeerName.empty())
{
LOGWARNING(
- "SSL: Trying to set multiple expected peer names, only the last one will be used. Name: %s",
- a_ExpectedPeerName.c_str()
+ "SSL: Trying to set multiple expected peer names, only the last one will be used. %s overwriting the previous %s",
+ a_ExpectedPeerName, m_ExpectedPeerName
);
}
@@ -216,7 +216,7 @@ bool cBlockingSslClientSocket::Send(const void * a_Data, size_t a_NumBytes)
{
ASSERT(res != MBEDTLS_ERR_SSL_WANT_READ); // This should never happen with callback-based SSL
ASSERT(res != MBEDTLS_ERR_SSL_WANT_WRITE); // This should never happen with callback-based SSL
- Printf(m_LastErrorText, "Data cannot be written to SSL context: -0x%x", -res);
+ m_LastErrorText = fmt::format(FMT_STRING("Data cannot be written to SSL context: -0x{:x}"), -res);
return false;
}
else
@@ -241,7 +241,7 @@ int cBlockingSslClientSocket::Receive(void * a_Data, size_t a_MaxBytes)
int res = m_Ssl.ReadPlain(a_Data, a_MaxBytes);
if (res < 0)
{
- Printf(m_LastErrorText, "Data cannot be read form SSL context: -0x%x", -res);
+ m_LastErrorText = fmt::format(FMT_STRING("Data cannot be read from SSL context: -0x{:x}"), -res);
}
return res;
}
@@ -250,7 +250,7 @@ int cBlockingSslClientSocket::Receive(void * a_Data, size_t a_MaxBytes)
-void cBlockingSslClientSocket::Disconnect(void)
+void cBlockingSslClientSocket::Disconnect()
{
// Ignore if not connected
if (!m_IsConnected)
diff --git a/src/mbedTLS++/Sha1Checksum.cpp b/src/mbedTLS++/Sha1Checksum.cpp
index 8ed7976ae..4c4c92298 100644
--- a/src/mbedTLS++/Sha1Checksum.cpp
+++ b/src/mbedTLS++/Sha1Checksum.cpp
@@ -91,7 +91,7 @@ void cSha1Checksum::DigestToHex(const Checksum & a_Digest, AString & a_Out)
a_Out.reserve(40);
for (int i = 0; i < 20; i++)
{
- AppendPrintf(a_Out, "%x", a_Digest[i]);
+ a_Out.append(fmt::format(FMT_STRING("{:02x}"), a_Digest[i]));
}
}
@@ -123,7 +123,7 @@ void cSha1Checksum::DigestToJava(const Checksum & a_Digest, AString & a_Out)
a_Out.reserve(40);
for (int i = 0; i < 20; i++)
{
- AppendPrintf(a_Out, "%02x", Digest[i]);
+ a_Out.append(fmt::format(FMT_STRING("{:02x}"), Digest[i]));
}
while ((a_Out.length() > 0) && (a_Out[0] == '0'))
{