[+] TLSErrorToString

[*] Send break should always perserve writeptr
This commit is contained in:
Reece Wilson 2022-08-31 16:09:45 +01:00
parent 2b72228b9e
commit f1ac21a379
4 changed files with 8 additions and 5 deletions

View File

@ -14,6 +14,7 @@
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/ssl.h>
#include <mbedtls/x509.h>
#include <mbedtls/error.h>
namespace Aurora::IO::TLS
{

View File

@ -35,7 +35,7 @@ namespace Aurora::IO::TLS
if (gSupportedSuites.empty())
{
auto iItr = mbedtls_ssl_list_ciphersuites();
auto iItr = ::mbedtls_ssl_list_ciphersuites();
while (auto cipher = *(iItr++))
{
@ -48,7 +48,7 @@ namespace Aurora::IO::TLS
AUKN_SYM AuUInt16 CipherSuiteFromString(const AuString &string)
{
auto pSuite = mbedtls_ssl_ciphersuite_from_string(string.c_str());
auto pSuite = ::mbedtls_ssl_ciphersuite_from_string(string.c_str());
if (!pSuite)
{
SysPushErrorCrypt("Unknown ciphersuite: {}", string);
@ -60,7 +60,7 @@ namespace Aurora::IO::TLS
AUKN_SYM AuString CipherSuiteToString(AuUInt16 uCipherSuite)
{
auto pSuite = mbedtls_ssl_ciphersuite_from_id(uCipherSuite);
auto pSuite = ::mbedtls_ssl_ciphersuite_from_id(uCipherSuite);
if (!pSuite)
{
SysPushErrorCrypt("Unknown ciphersuite: {} ({:02x})", uCipherSuite, uCipherSuite);

View File

@ -19,7 +19,9 @@ namespace Aurora::IO::TLS
AuString TLSErrorToString(int iError)
{
return {};
char description[1024];
::mbedtls_strerror(iError, description, AuArraySize(description));
return description;
}
void TLSInit()

View File

@ -126,7 +126,7 @@ namespace Aurora::IO::TLS
// ...
if (!uCount)
{
return false;
return true;
}
// mbedtls tick