mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
PolarSSL: update to current stable version (1.3.4)
I just removed Externals/polarssl/, added the new version, then deleted the following files/directories: DartConfiguration.tcl Makefile doxygen/ library/Makefile programs/ scripts/ tests/ visualc/
This commit is contained in:
220
Externals/polarssl/library/error.c
vendored
220
Externals/polarssl/library/error.c
vendored
@ -65,6 +65,10 @@
|
||||
#include "polarssl/dhm.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_ECP_C)
|
||||
#include "polarssl/ecp.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_ENTROPY_C)
|
||||
#include "polarssl/entropy.h"
|
||||
#endif
|
||||
@ -93,6 +97,10 @@
|
||||
#include "polarssl/net.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_OID_C)
|
||||
#include "polarssl/oid.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PADLOCK_C)
|
||||
#include "polarssl/padlock.h"
|
||||
#endif
|
||||
@ -101,10 +109,14 @@
|
||||
#include "polarssl/pbkdf2.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PEM_C)
|
||||
#if defined(POLARSSL_PEM_PARSE_C) || defined(POLARSSL_PEM_WRITE_C)
|
||||
#include "polarssl/pem.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PK_C)
|
||||
#include "polarssl/pk.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PKCS12_C)
|
||||
#include "polarssl/pkcs12.h"
|
||||
#endif
|
||||
@ -121,19 +133,23 @@
|
||||
#include "polarssl/sha1.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_SHA2_C)
|
||||
#include "polarssl/sha2.h"
|
||||
#if defined(POLARSSL_SHA256_C)
|
||||
#include "polarssl/sha256.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_SHA4_C)
|
||||
#include "polarssl/sha4.h"
|
||||
#if defined(POLARSSL_SHA512_C)
|
||||
#include "polarssl/sha512.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_SSL_TLS_C)
|
||||
#include "polarssl/ssl.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_X509_PARSE_C)
|
||||
#if defined(POLARSSL_THREADING_C)
|
||||
#include "polarssl/threading.h"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
|
||||
#include "polarssl/x509.h"
|
||||
#endif
|
||||
|
||||
@ -144,17 +160,23 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if defined _MSC_VER && !defined snprintf
|
||||
#if defined(_MSC_VER) && !defined snprintf && !defined(EFIX64) && \
|
||||
!defined(EFI32)
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
void error_strerror( int ret, char *buf, size_t buflen )
|
||||
void polarssl_strerror( int ret, char *buf, size_t buflen )
|
||||
{
|
||||
size_t len;
|
||||
int use_ret;
|
||||
|
||||
if( buflen == 0 )
|
||||
return;
|
||||
|
||||
memset( buf, 0x00, buflen );
|
||||
|
||||
/* Reduce buflen to make sure MSVC _snprintf() ends with \0 as well */
|
||||
buflen -= 1;
|
||||
|
||||
if( ret < 0 )
|
||||
ret = -ret;
|
||||
|
||||
@ -175,6 +197,8 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "CIPHER - Input data contains invalid padding and is rejected" );
|
||||
if( use_ret == -(POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED) )
|
||||
snprintf( buf, buflen, "CIPHER - Decryption of block requires a full block" );
|
||||
if( use_ret == -(POLARSSL_ERR_CIPHER_AUTH_FAILED) )
|
||||
snprintf( buf, buflen, "CIPHER - Authentication failed (for AEAD modes)" );
|
||||
#endif /* POLARSSL_CIPHER_C */
|
||||
|
||||
#if defined(POLARSSL_DHM_C)
|
||||
@ -190,8 +214,31 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "DHM - Making of the public value failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_DHM_CALC_SECRET_FAILED) )
|
||||
snprintf( buf, buflen, "DHM - Calculation of the DHM secret failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_DHM_INVALID_FORMAT) )
|
||||
snprintf( buf, buflen, "DHM - The ASN.1 data is not formatted correctly" );
|
||||
if( use_ret == -(POLARSSL_ERR_DHM_MALLOC_FAILED) )
|
||||
snprintf( buf, buflen, "DHM - Allocation of memory failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_DHM_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "DHM - Read/write of file failed" );
|
||||
#endif /* POLARSSL_DHM_C */
|
||||
|
||||
#if defined(POLARSSL_ECP_C)
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_BAD_INPUT_DATA) )
|
||||
snprintf( buf, buflen, "ECP - Bad input parameters to function" );
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_BUFFER_TOO_SMALL) )
|
||||
snprintf( buf, buflen, "ECP - The buffer is too small to write to" );
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE) )
|
||||
snprintf( buf, buflen, "ECP - Requested curve not available" );
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_VERIFY_FAILED) )
|
||||
snprintf( buf, buflen, "ECP - The signature is not valid" );
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_MALLOC_FAILED) )
|
||||
snprintf( buf, buflen, "ECP - Memory allocation failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_RANDOM_FAILED) )
|
||||
snprintf( buf, buflen, "ECP - Generation of random value, such as (ephemeral) key, failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_ECP_INVALID_KEY) )
|
||||
snprintf( buf, buflen, "ECP - Invalid private or public key" );
|
||||
#endif /* POLARSSL_ECP_C */
|
||||
|
||||
#if defined(POLARSSL_MD_C)
|
||||
if( use_ret == -(POLARSSL_ERR_MD_FEATURE_UNAVAILABLE) )
|
||||
snprintf( buf, buflen, "MD - The selected feature is not available" );
|
||||
@ -203,7 +250,7 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "MD - Opening or reading of file failed" );
|
||||
#endif /* POLARSSL_MD_C */
|
||||
|
||||
#if defined(POLARSSL_PEM_C)
|
||||
#if defined(POLARSSL_PEM_PARSE_C) || defined(POLARSSL_PEM_WRITE_C)
|
||||
if( use_ret == -(POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT) )
|
||||
snprintf( buf, buflen, "PEM - No PEM header or footer found" );
|
||||
if( use_ret == -(POLARSSL_ERR_PEM_INVALID_DATA) )
|
||||
@ -222,7 +269,36 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "PEM - Unavailable feature, e.g. hashing/encryption combination" );
|
||||
if( use_ret == -(POLARSSL_ERR_PEM_BAD_INPUT_DATA) )
|
||||
snprintf( buf, buflen, "PEM - Bad input parameters to function" );
|
||||
#endif /* POLARSSL_PEM_C */
|
||||
#endif /* POLARSSL_PEM_PARSE_C || POLARSSL_PEM_WRITE_C */
|
||||
|
||||
#if defined(POLARSSL_PK_C)
|
||||
if( use_ret == -(POLARSSL_ERR_PK_MALLOC_FAILED) )
|
||||
snprintf( buf, buflen, "PK - Memory alloation failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_TYPE_MISMATCH) )
|
||||
snprintf( buf, buflen, "PK - Type mismatch, eg attempt to encrypt with an ECDSA key" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_BAD_INPUT_DATA) )
|
||||
snprintf( buf, buflen, "PK - Bad input parameters to function" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "PK - Read/write of file failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_KEY_INVALID_VERSION) )
|
||||
snprintf( buf, buflen, "PK - Unsupported key version" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_KEY_INVALID_FORMAT) )
|
||||
snprintf( buf, buflen, "PK - Invalid key tag or value" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_UNKNOWN_PK_ALG) )
|
||||
snprintf( buf, buflen, "PK - Key algorithm is unsupported (only RSA and EC are supported)" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_PASSWORD_REQUIRED) )
|
||||
snprintf( buf, buflen, "PK - Private key password can't be empty" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_PASSWORD_MISMATCH) )
|
||||
snprintf( buf, buflen, "PK - Given private key password does not allow for correct decryption" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_INVALID_PUBKEY) )
|
||||
snprintf( buf, buflen, "PK - The pubkey tag or value is invalid (only RSA and EC are supported)" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_INVALID_ALG) )
|
||||
snprintf( buf, buflen, "PK - The algorithm tag or value is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_UNKNOWN_NAMED_CURVE) )
|
||||
snprintf( buf, buflen, "PK - Elliptic curve is unsupported (only NIST curves are supported)" );
|
||||
if( use_ret == -(POLARSSL_ERR_PK_FEATURE_UNAVAILABLE) )
|
||||
snprintf( buf, buflen, "PK - Unavailable feature, e.g. RSA disabled for RSA key" );
|
||||
#endif /* POLARSSL_PK_C */
|
||||
|
||||
#if defined(POLARSSL_PKCS12_C)
|
||||
if( use_ret == -(POLARSSL_ERR_PKCS12_BAD_INPUT_DATA) )
|
||||
@ -282,8 +358,8 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "SSL - An unknown cipher was received" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN) )
|
||||
snprintf( buf, buflen, "SSL - The server has no ciphersuites in common with the client" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_NO_SESSION_FOUND) )
|
||||
snprintf( buf, buflen, "SSL - No session to recover was found" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_NO_RNG) )
|
||||
snprintf( buf, buflen, "SSL - No RNG was provided to the SSL module" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_NO_CLIENT_CERTIFICATE) )
|
||||
snprintf( buf, buflen, "SSL - No client certification received from the client, but required by the authentication mode" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_CERTIFICATE_TOO_LARGE) )
|
||||
@ -291,7 +367,7 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_CERTIFICATE_REQUIRED) )
|
||||
snprintf( buf, buflen, "SSL - The own certificate is not set, but needed by the server" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED) )
|
||||
snprintf( buf, buflen, "SSL - The own private key is not set, but needed" );
|
||||
snprintf( buf, buflen, "SSL - The own private key or pre-shared key is not set, but needed" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED) )
|
||||
snprintf( buf, buflen, "SSL - No CA Chain is set, but required to operate" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE) )
|
||||
@ -319,10 +395,10 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "SSL - Processing of the ServerHelloDone handshake message failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the ClientKeyExchange handshake message failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_DHM_RP) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the ClientKeyExchange handshake message failed in DHM Read Public" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_DHM_CS) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the ClientKeyExchange handshake message failed in DHM Calculate Secret" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the CertificateVerify handshake message failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC) )
|
||||
@ -339,58 +415,56 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "SSL - Processing of the compression / decompression failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_PROTOCOL_VERSION) )
|
||||
snprintf( buf, buflen, "SSL - Handshake protocol not within min/max boundaries" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_BAD_HS_NEW_SESSION_TICKET) )
|
||||
snprintf( buf, buflen, "SSL - Processing of the NewSessionTicket handshake message failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED) )
|
||||
snprintf( buf, buflen, "SSL - Session ticket has expired" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_PK_TYPE_MISMATCH) )
|
||||
snprintf( buf, buflen, "SSL - Public key type mismatch (eg, asked for RSA key exchange and presented EC key)" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_UNKNOWN_IDENTITY) )
|
||||
snprintf( buf, buflen, "SSL - Unkown identity received (eg, PSK identity)" );
|
||||
if( use_ret == -(POLARSSL_ERR_SSL_INTERNAL_ERROR) )
|
||||
snprintf( buf, buflen, "SSL - Internal error (eg, unexpected failure in lower-level module)" );
|
||||
#endif /* POLARSSL_SSL_TLS_C */
|
||||
|
||||
#if defined(POLARSSL_X509_PARSE_C)
|
||||
#if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
|
||||
if( use_ret == -(POLARSSL_ERR_X509_FEATURE_UNAVAILABLE) )
|
||||
snprintf( buf, buflen, "X509 - Unavailable feature, e.g. RSA hashing/encryption combination" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_PEM) )
|
||||
snprintf( buf, buflen, "X509 - The PEM-encoded certificate contains invalid elements, e.g. invalid character" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_FORMAT) )
|
||||
snprintf( buf, buflen, "X509 - The certificate format is invalid, e.g. different type expected" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_VERSION) )
|
||||
snprintf( buf, buflen, "X509 - The certificate version element is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_SERIAL) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_UNKNOWN_OID) )
|
||||
snprintf( buf, buflen, "X509 - Requested OID is unknown" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_FORMAT) )
|
||||
snprintf( buf, buflen, "X509 - The CRT/CRL/CSR format is invalid, e.g. different type expected" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_VERSION) )
|
||||
snprintf( buf, buflen, "X509 - The CRT/CRL/CSR version element is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_SERIAL) )
|
||||
snprintf( buf, buflen, "X509 - The serial tag or value is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_ALG) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_ALG) )
|
||||
snprintf( buf, buflen, "X509 - The algorithm tag or value is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_NAME) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_NAME) )
|
||||
snprintf( buf, buflen, "X509 - The name tag or value is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_DATE) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_DATE) )
|
||||
snprintf( buf, buflen, "X509 - The date tag or value is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_PUBKEY) )
|
||||
snprintf( buf, buflen, "X509 - The pubkey tag or value is invalid (only RSA is supported)" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_SIGNATURE) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_SIGNATURE) )
|
||||
snprintf( buf, buflen, "X509 - The signature tag or value invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_EXTENSIONS) )
|
||||
snprintf( buf, buflen, "X509 - The extension tag or value is invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_UNKNOWN_VERSION) )
|
||||
snprintf( buf, buflen, "X509 - Certificate or CRL has an unsupported version number" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_UNKNOWN_SIG_ALG) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_UNKNOWN_VERSION) )
|
||||
snprintf( buf, buflen, "X509 - CRT/CRL/CSR has an unsupported version number" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_UNKNOWN_SIG_ALG) )
|
||||
snprintf( buf, buflen, "X509 - Signature algorithm (oid) is unsupported" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_UNKNOWN_PK_ALG) )
|
||||
snprintf( buf, buflen, "X509 - Key algorithm is unsupported (only RSA is supported)" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_SIG_MISMATCH) )
|
||||
snprintf( buf, buflen, "X509 - Certificate signature algorithms do not match. (see \\c ::x509_cert sig_oid)" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_SIG_MISMATCH) )
|
||||
snprintf( buf, buflen, "X509 - Signature algorithms do not match. (see \\c ::x509_crt sig_oid)" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_VERIFY_FAILED) )
|
||||
snprintf( buf, buflen, "X509 - Certificate verification failed, e.g. CRL, CA or signature check failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_KEY_INVALID_VERSION) )
|
||||
snprintf( buf, buflen, "X509 - Unsupported RSA key version" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_KEY_INVALID_FORMAT) )
|
||||
snprintf( buf, buflen, "X509 - Invalid RSA key tag or value" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT) )
|
||||
snprintf( buf, buflen, "X509 - Format not recognized as DER or PEM" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_INVALID_INPUT) )
|
||||
if( use_ret == -(POLARSSL_ERR_X509_BAD_INPUT_DATA) )
|
||||
snprintf( buf, buflen, "X509 - Input invalid" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_MALLOC_FAILED) )
|
||||
snprintf( buf, buflen, "X509 - Allocation of memory failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "X509 - Read/write of file failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_PASSWORD_REQUIRED) )
|
||||
snprintf( buf, buflen, "X509 - Private key password can't be empty" );
|
||||
if( use_ret == -(POLARSSL_ERR_X509_PASSWORD_MISMATCH) )
|
||||
snprintf( buf, buflen, "X509 - Given private key password does not allow for correct decryption" );
|
||||
#endif /* POLARSSL_X509_PARSE_C */
|
||||
#endif /* POLARSSL_X509_USE,X509_CREATE_C */
|
||||
|
||||
if( strlen( buf ) == 0 )
|
||||
snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret );
|
||||
@ -555,6 +629,11 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "NET - Connection requires a write call" );
|
||||
#endif /* POLARSSL_NET_C */
|
||||
|
||||
#if defined(POLARSSL_OID_C)
|
||||
if( use_ret == -(POLARSSL_ERR_OID_NOT_FOUND) )
|
||||
snprintf( buf, buflen, "OID - OID is not found" );
|
||||
#endif /* POLARSSL_OID_C */
|
||||
|
||||
#if defined(POLARSSL_PADLOCK_C)
|
||||
if( use_ret == -(POLARSSL_ERR_PADLOCK_DATA_MISALIGNED) )
|
||||
snprintf( buf, buflen, "PADLOCK - Input data should be aligned" );
|
||||
@ -570,15 +649,24 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "SHA1 - Read/write error in file" );
|
||||
#endif /* POLARSSL_SHA1_C */
|
||||
|
||||
#if defined(POLARSSL_SHA2_C)
|
||||
if( use_ret == -(POLARSSL_ERR_SHA2_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "SHA2 - Read/write error in file" );
|
||||
#endif /* POLARSSL_SHA2_C */
|
||||
#if defined(POLARSSL_SHA256_C)
|
||||
if( use_ret == -(POLARSSL_ERR_SHA256_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "SHA256 - Read/write error in file" );
|
||||
#endif /* POLARSSL_SHA256_C */
|
||||
|
||||
#if defined(POLARSSL_SHA4_C)
|
||||
if( use_ret == -(POLARSSL_ERR_SHA4_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "SHA4 - Read/write error in file" );
|
||||
#endif /* POLARSSL_SHA4_C */
|
||||
#if defined(POLARSSL_SHA512_C)
|
||||
if( use_ret == -(POLARSSL_ERR_SHA512_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "SHA512 - Read/write error in file" );
|
||||
#endif /* POLARSSL_SHA512_C */
|
||||
|
||||
#if defined(POLARSSL_THREADING_C)
|
||||
if( use_ret == -(POLARSSL_ERR_THREADING_FEATURE_UNAVAILABLE) )
|
||||
snprintf( buf, buflen, "THREADING - The selected feature is not available" );
|
||||
if( use_ret == -(POLARSSL_ERR_THREADING_BAD_INPUT_DATA) )
|
||||
snprintf( buf, buflen, "THREADING - Bad input parameters to function" );
|
||||
if( use_ret == -(POLARSSL_ERR_THREADING_MUTEX_ERROR) )
|
||||
snprintf( buf, buflen, "THREADING - Locking / unlocking / free failed with error code" );
|
||||
#endif /* POLARSSL_THREADING_C */
|
||||
|
||||
#if defined(POLARSSL_XTEA_C)
|
||||
if( use_ret == -(POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH) )
|
||||
@ -591,6 +679,13 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_ERROR_STRERROR_BC)
|
||||
void error_strerror( int ret, char *buf, size_t buflen )
|
||||
{
|
||||
polarssl_strerror( ret, buf, buflen );
|
||||
}
|
||||
#endif /* POLARSSL_ERROR_STRERROR_BC */
|
||||
|
||||
#else /* POLARSSL_ERROR_C */
|
||||
|
||||
#if defined(POLARSSL_ERROR_STRERROR_DUMMY)
|
||||
@ -600,7 +695,7 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
/*
|
||||
* Provide an non-function in case POLARSSL_ERROR_C is not defined
|
||||
*/
|
||||
void error_strerror( int ret, char *buf, size_t buflen )
|
||||
void polarssl_strerror( int ret, char *buf, size_t buflen )
|
||||
{
|
||||
((void) ret);
|
||||
|
||||
@ -608,5 +703,12 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
buf[0] = '\0';
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_ERROR_STRERROR_BC)
|
||||
void error_strerror( int ret, char *buf, size_t buflen )
|
||||
{
|
||||
polarssl_strerror( ret, buf, buflen );
|
||||
}
|
||||
#endif /* POLARSSL_ERROR_STRERROR_BC */
|
||||
#endif /* POLARSSL_ERROR_STRERROR_DUMMY */
|
||||
|
||||
#endif /* POLARSSL_ERROR_C */
|
||||
|
Reference in New Issue
Block a user