summaryrefslogtreecommitdiffstats
path: root/src/PolarSSL++/BufferedSslContext.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-30 16:00:06 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2017-08-30 16:00:06 +0200
commit84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7 (patch)
treeaa1648c2ba260b8576673677435481d371eec7b0 /src/PolarSSL++/BufferedSslContext.cpp
parentUpdate core plugins to latest version (#3951) (diff)
downloadcuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.gz
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.bz2
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.lz
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.xz
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.zst
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.zip
Diffstat (limited to '')
-rw-r--r--src/mbedTLS++/BufferedSslContext.cpp (renamed from src/PolarSSL++/BufferedSslContext.cpp)14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/PolarSSL++/BufferedSslContext.cpp b/src/mbedTLS++/BufferedSslContext.cpp
index c8d4736f7..5cdf04323 100644
--- a/src/PolarSSL++/BufferedSslContext.cpp
+++ b/src/mbedTLS++/BufferedSslContext.cpp
@@ -1,4 +1,4 @@
-
+
// BufferedSslContext.cpp
// Implements the cBufferedSslContext class representing a SSL context with the SSL peer data backed by a cByteBuffer
@@ -53,17 +53,17 @@ size_t cBufferedSslContext::ReadOutgoing(void * a_Data, size_t a_DataMaxSize)
int cBufferedSslContext::ReceiveEncrypted(unsigned char * a_Buffer, size_t a_NumBytes)
{
- // Called when PolarSSL wants to read encrypted data from the SSL peer
+ // Called when mbedTLS wants to read encrypted data from the SSL peer
// Read the data from the buffer inside this object, where the owner has stored them using WriteIncoming():
size_t NumBytes = std::min(a_NumBytes, m_IncomingData.GetReadableSpace());
if (NumBytes == 0)
{
- return POLARSSL_ERR_NET_WANT_READ;
+ return MBEDTLS_ERR_SSL_WANT_READ;
}
if (!m_IncomingData.ReadBuf(a_Buffer, NumBytes))
{
m_IncomingData.ResetRead();
- return POLARSSL_ERR_NET_RECV_FAILED;
+ return MBEDTLS_ERR_NET_RECV_FAILED;
}
m_IncomingData.CommitRead();
return static_cast<int>(NumBytes);
@@ -75,15 +75,15 @@ int cBufferedSslContext::ReceiveEncrypted(unsigned char * a_Buffer, size_t a_Num
int cBufferedSslContext::SendEncrypted(const unsigned char * a_Buffer, size_t a_NumBytes)
{
- // Called when PolarSSL wants to write encrypted data to the SSL peer
+ // Called when mbedTLS wants to write encrypted data to the SSL peer
// Write the data into the buffer inside this object, where the owner can later read them using ReadOutgoing():
if (!m_OutgoingData.CanWriteBytes(a_NumBytes))
{
- return POLARSSL_ERR_NET_WANT_WRITE;
+ return MBEDTLS_ERR_SSL_WANT_WRITE;
}
if (!m_OutgoingData.Write(reinterpret_cast<const char *>(a_Buffer), a_NumBytes))
{
- return POLARSSL_ERR_NET_SEND_FAILED;
+ return MBEDTLS_ERR_NET_SEND_FAILED;
}
return static_cast<int>(a_NumBytes);
}