26 #if !defined(POLARSSL_CONFIG_FILE)
29 #include POLARSSL_CONFIG_FILE
32 #if defined(POLARSSL_ERROR_C) || defined(POLARSSL_ERROR_STRERROR_DUMMY)
36 #if defined(POLARSSL_ERROR_C)
38 #if defined(POLARSSL_AES_C)
42 #if defined(POLARSSL_BASE64_C)
46 #if defined(POLARSSL_BIGNUM_C)
50 #if defined(POLARSSL_BLOWFISH_C)
54 #if defined(POLARSSL_CAMELLIA_C)
58 #if defined(POLARSSL_CCM_C)
62 #if defined(POLARSSL_CIPHER_C)
66 #if defined(POLARSSL_CTR_DRBG_C)
70 #if defined(POLARSSL_DES_C)
74 #if defined(POLARSSL_DHM_C)
78 #if defined(POLARSSL_ECP_C)
82 #if defined(POLARSSL_ENTROPY_C)
86 #if defined(POLARSSL_GCM_C)
90 #if defined(POLARSSL_HMAC_DRBG_C)
94 #if defined(POLARSSL_MD_C)
98 #if defined(POLARSSL_MD2_C)
102 #if defined(POLARSSL_MD4_C)
106 #if defined(POLARSSL_MD5_C)
110 #if defined(POLARSSL_NET_C)
114 #if defined(POLARSSL_OID_C)
118 #if defined(POLARSSL_PADLOCK_C)
122 #if defined(POLARSSL_PBKDF2_C)
126 #if defined(POLARSSL_PEM_PARSE_C) || defined(POLARSSL_PEM_WRITE_C)
130 #if defined(POLARSSL_PK_C)
134 #if defined(POLARSSL_PKCS12_C)
138 #if defined(POLARSSL_PKCS5_C)
142 #if defined(POLARSSL_RIPEMD160_C)
146 #if defined(POLARSSL_RSA_C)
150 #if defined(POLARSSL_SHA1_C)
154 #if defined(POLARSSL_SHA256_C)
158 #if defined(POLARSSL_SHA512_C)
162 #if defined(POLARSSL_SSL_TLS_C)
166 #if defined(POLARSSL_THREADING_C)
170 #if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
174 #if defined(POLARSSL_XTEA_C)
181 #if defined(_MSC_VER) && !defined snprintf && !defined(EFIX64) && \
183 #define snprintf _snprintf
194 memset( buf, 0x00, buflen );
203 use_ret = ret & 0xFF80;
208 #if defined(POLARSSL_CIPHER_C)
210 snprintf( buf, buflen,
"CIPHER - The selected feature is not available" );
212 snprintf( buf, buflen,
"CIPHER - Bad input parameters to function" );
214 snprintf( buf, buflen,
"CIPHER - Failed to allocate memory" );
216 snprintf( buf, buflen,
"CIPHER - Input data contains invalid padding and is rejected" );
218 snprintf( buf, buflen,
"CIPHER - Decryption of block requires a full block" );
220 snprintf( buf, buflen,
"CIPHER - Authentication failed (for AEAD modes)" );
223 #if defined(POLARSSL_DHM_C)
225 snprintf( buf, buflen,
"DHM - Bad input parameters to function" );
227 snprintf( buf, buflen,
"DHM - Reading of the DHM parameters failed" );
229 snprintf( buf, buflen,
"DHM - Making of the DHM parameters failed" );
231 snprintf( buf, buflen,
"DHM - Reading of the public values failed" );
233 snprintf( buf, buflen,
"DHM - Making of the public value failed" );
235 snprintf( buf, buflen,
"DHM - Calculation of the DHM secret failed" );
237 snprintf( buf, buflen,
"DHM - The ASN.1 data is not formatted correctly" );
239 snprintf( buf, buflen,
"DHM - Allocation of memory failed" );
241 snprintf( buf, buflen,
"DHM - Read/write of file failed" );
244 #if defined(POLARSSL_ECP_C)
246 snprintf( buf, buflen,
"ECP - Bad input parameters to function" );
248 snprintf( buf, buflen,
"ECP - The buffer is too small to write to" );
250 snprintf( buf, buflen,
"ECP - Requested curve not available" );
252 snprintf( buf, buflen,
"ECP - The signature is not valid" );
254 snprintf( buf, buflen,
"ECP - Memory allocation failed" );
256 snprintf( buf, buflen,
"ECP - Generation of random value, such as (ephemeral) key, failed" );
258 snprintf( buf, buflen,
"ECP - Invalid private or public key" );
260 snprintf( buf, buflen,
"ECP - Signature is valid but shorter than the user-supplied length" );
263 #if defined(POLARSSL_MD_C)
265 snprintf( buf, buflen,
"MD - The selected feature is not available" );
267 snprintf( buf, buflen,
"MD - Bad input parameters to function" );
269 snprintf( buf, buflen,
"MD - Failed to allocate memory" );
271 snprintf( buf, buflen,
"MD - Opening or reading of file failed" );
274 #if defined(POLARSSL_PEM_PARSE_C) || defined(POLARSSL_PEM_WRITE_C)
276 snprintf( buf, buflen,
"PEM - No PEM header or footer found" );
278 snprintf( buf, buflen,
"PEM - PEM string is not as expected" );
280 snprintf( buf, buflen,
"PEM - Failed to allocate memory" );
282 snprintf( buf, buflen,
"PEM - RSA IV is not in hex-format" );
284 snprintf( buf, buflen,
"PEM - Unsupported key encryption algorithm" );
286 snprintf( buf, buflen,
"PEM - Private key password can't be empty" );
288 snprintf( buf, buflen,
"PEM - Given private key password does not allow for correct decryption" );
290 snprintf( buf, buflen,
"PEM - Unavailable feature, e.g. hashing/encryption combination" );
292 snprintf( buf, buflen,
"PEM - Bad input parameters to function" );
295 #if defined(POLARSSL_PK_C)
297 snprintf( buf, buflen,
"PK - Memory alloation failed" );
299 snprintf( buf, buflen,
"PK - Type mismatch, eg attempt to encrypt with an ECDSA key" );
301 snprintf( buf, buflen,
"PK - Bad input parameters to function" );
303 snprintf( buf, buflen,
"PK - Read/write of file failed" );
305 snprintf( buf, buflen,
"PK - Unsupported key version" );
307 snprintf( buf, buflen,
"PK - Invalid key tag or value" );
309 snprintf( buf, buflen,
"PK - Key algorithm is unsupported (only RSA and EC are supported)" );
311 snprintf( buf, buflen,
"PK - Private key password can't be empty" );
313 snprintf( buf, buflen,
"PK - Given private key password does not allow for correct decryption" );
315 snprintf( buf, buflen,
"PK - The pubkey tag or value is invalid (only RSA and EC are supported)" );
317 snprintf( buf, buflen,
"PK - The algorithm tag or value is invalid" );
319 snprintf( buf, buflen,
"PK - Elliptic curve is unsupported (only NIST curves are supported)" );
321 snprintf( buf, buflen,
"PK - Unavailable feature, e.g. RSA disabled for RSA key" );
323 snprintf( buf, buflen,
"PK - The signature is valid but its length is less than expected" );
326 #if defined(POLARSSL_PKCS12_C)
328 snprintf( buf, buflen,
"PKCS12 - Bad input parameters to function" );
330 snprintf( buf, buflen,
"PKCS12 - Feature not available, e.g. unsupported encryption scheme" );
332 snprintf( buf, buflen,
"PKCS12 - PBE ASN.1 data not as expected" );
334 snprintf( buf, buflen,
"PKCS12 - Given private key password does not allow for correct decryption" );
337 #if defined(POLARSSL_PKCS5_C)
339 snprintf( buf, buflen,
"PKCS5 - Bad input parameters to function" );
341 snprintf( buf, buflen,
"PKCS5 - Unexpected ASN.1 data" );
343 snprintf( buf, buflen,
"PKCS5 - Requested encryption or digest alg not available" );
345 snprintf( buf, buflen,
"PKCS5 - Given private key password does not allow for correct decryption" );
348 #if defined(POLARSSL_RSA_C)
350 snprintf( buf, buflen,
"RSA - Bad input parameters to function" );
352 snprintf( buf, buflen,
"RSA - Input data contains invalid padding and is rejected" );
354 snprintf( buf, buflen,
"RSA - Something failed during generation of a key" );
356 snprintf( buf, buflen,
"RSA - Key failed to pass the libraries validity check" );
358 snprintf( buf, buflen,
"RSA - The public key operation failed" );
360 snprintf( buf, buflen,
"RSA - The private key operation failed" );
362 snprintf( buf, buflen,
"RSA - The PKCS#1 verification failed" );
364 snprintf( buf, buflen,
"RSA - The output buffer for decryption is not large enough" );
366 snprintf( buf, buflen,
"RSA - The random generator failed to generate non-zeros" );
369 #if defined(POLARSSL_SSL_TLS_C)
371 snprintf( buf, buflen,
"SSL - The requested feature is not available" );
373 snprintf( buf, buflen,
"SSL - Bad input parameters to function" );
375 snprintf( buf, buflen,
"SSL - Verification of the message MAC failed" );
377 snprintf( buf, buflen,
"SSL - An invalid SSL record was received" );
379 snprintf( buf, buflen,
"SSL - The connection indicated an EOF" );
381 snprintf( buf, buflen,
"SSL - An unknown cipher was received" );
383 snprintf( buf, buflen,
"SSL - The server has no ciphersuites in common with the client" );
385 snprintf( buf, buflen,
"SSL - No RNG was provided to the SSL module" );
387 snprintf( buf, buflen,
"SSL - No client certification received from the client, but required by the authentication mode" );
389 snprintf( buf, buflen,
"SSL - DESCRIPTION MISSING" );
391 snprintf( buf, buflen,
"SSL - The own certificate is not set, but needed by the server" );
393 snprintf( buf, buflen,
"SSL - The own private key or pre-shared key is not set, but needed" );
395 snprintf( buf, buflen,
"SSL - No CA Chain is set, but required to operate" );
397 snprintf( buf, buflen,
"SSL - An unexpected message was received from our peer" );
400 snprintf( buf, buflen,
"SSL - A fatal alert message was received from our peer" );
404 snprintf( buf, buflen,
"SSL - Verification of our peer failed" );
406 snprintf( buf, buflen,
"SSL - The peer notified us that the connection is going to be closed" );
408 snprintf( buf, buflen,
"SSL - Processing of the ClientHello handshake message failed" );
410 snprintf( buf, buflen,
"SSL - Processing of the ServerHello handshake message failed" );
412 snprintf( buf, buflen,
"SSL - Processing of the Certificate handshake message failed" );
414 snprintf( buf, buflen,
"SSL - Processing of the CertificateRequest handshake message failed" );
416 snprintf( buf, buflen,
"SSL - Processing of the ServerKeyExchange handshake message failed" );
418 snprintf( buf, buflen,
"SSL - Processing of the ServerHelloDone handshake message failed" );
420 snprintf( buf, buflen,
"SSL - Processing of the ClientKeyExchange handshake message failed" );
422 snprintf( buf, buflen,
"SSL - Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public" );
424 snprintf( buf, buflen,
"SSL - Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret" );
426 snprintf( buf, buflen,
"SSL - Processing of the CertificateVerify handshake message failed" );
428 snprintf( buf, buflen,
"SSL - Processing of the ChangeCipherSpec handshake message failed" );
430 snprintf( buf, buflen,
"SSL - Processing of the Finished handshake message failed" );
432 snprintf( buf, buflen,
"SSL - Memory allocation failed" );
434 snprintf( buf, buflen,
"SSL - Hardware acceleration function returned with error" );
436 snprintf( buf, buflen,
"SSL - Hardware acceleration function skipped / left alone data" );
438 snprintf( buf, buflen,
"SSL - Processing of the compression / decompression failed" );
440 snprintf( buf, buflen,
"SSL - Handshake protocol not within min/max boundaries" );
442 snprintf( buf, buflen,
"SSL - Processing of the NewSessionTicket handshake message failed" );
444 snprintf( buf, buflen,
"SSL - Session ticket has expired" );
446 snprintf( buf, buflen,
"SSL - Public key type mismatch (eg, asked for RSA key exchange and presented EC key)" );
448 snprintf( buf, buflen,
"SSL - Unknown identity received (eg, PSK identity)" );
450 snprintf( buf, buflen,
"SSL - Internal error (eg, unexpected failure in lower-level module)" );
452 snprintf( buf, buflen,
"SSL - A counter would wrap (eg, too many messages exchanged)" );
455 #if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
457 snprintf( buf, buflen,
"X509 - Unavailable feature, e.g. RSA hashing/encryption combination" );
459 snprintf( buf, buflen,
"X509 - Requested OID is unknown" );
461 snprintf( buf, buflen,
"X509 - The CRT/CRL/CSR format is invalid, e.g. different type expected" );
463 snprintf( buf, buflen,
"X509 - The CRT/CRL/CSR version element is invalid" );
465 snprintf( buf, buflen,
"X509 - The serial tag or value is invalid" );
467 snprintf( buf, buflen,
"X509 - The algorithm tag or value is invalid" );
469 snprintf( buf, buflen,
"X509 - The name tag or value is invalid" );
471 snprintf( buf, buflen,
"X509 - The date tag or value is invalid" );
473 snprintf( buf, buflen,
"X509 - The signature tag or value invalid" );
475 snprintf( buf, buflen,
"X509 - The extension tag or value is invalid" );
477 snprintf( buf, buflen,
"X509 - CRT/CRL/CSR has an unsupported version number" );
479 snprintf( buf, buflen,
"X509 - Signature algorithm (oid) is unsupported" );
481 snprintf( buf, buflen,
"X509 - Signature algorithms do not match. (see \\c ::x509_crt sig_oid)" );
483 snprintf( buf, buflen,
"X509 - Certificate verification failed, e.g. CRL, CA or signature check failed" );
485 snprintf( buf, buflen,
"X509 - Format not recognized as DER or PEM" );
487 snprintf( buf, buflen,
"X509 - Input invalid" );
489 snprintf( buf, buflen,
"X509 - Allocation of memory failed" );
491 snprintf( buf, buflen,
"X509 - Read/write of file failed" );
495 if( strlen( buf ) == 0 )
496 snprintf( buf, buflen,
"UNKNOWN ERROR CODE (%04X)", use_ret );
499 use_ret = ret & ~0xFF80;
511 if( buflen - len < 5 )
514 snprintf( buf + len, buflen - len,
" : " );
523 #if defined(POLARSSL_AES_C)
525 snprintf( buf, buflen,
"AES - Invalid key length" );
527 snprintf( buf, buflen,
"AES - Invalid data input length" );
530 #if defined(POLARSSL_ASN1_PARSE_C)
532 snprintf( buf, buflen,
"ASN1 - Out of data when parsing an ASN1 data structure" );
534 snprintf( buf, buflen,
"ASN1 - ASN1 tag was of an unexpected value" );
536 snprintf( buf, buflen,
"ASN1 - Error when trying to determine the length or invalid length" );
538 snprintf( buf, buflen,
"ASN1 - Actual length differs from expected length" );
540 snprintf( buf, buflen,
"ASN1 - Data is invalid. (not used)" );
542 snprintf( buf, buflen,
"ASN1 - Memory allocation failed" );
544 snprintf( buf, buflen,
"ASN1 - Buffer too small when writing ASN.1 data structure" );
547 #if defined(POLARSSL_BASE64_C)
549 snprintf( buf, buflen,
"BASE64 - Output buffer too small" );
551 snprintf( buf, buflen,
"BASE64 - Invalid character in input" );
554 #if defined(POLARSSL_BIGNUM_C)
556 snprintf( buf, buflen,
"BIGNUM - An error occurred while reading from or writing to a file" );
558 snprintf( buf, buflen,
"BIGNUM - Bad input parameters to function" );
560 snprintf( buf, buflen,
"BIGNUM - There is an invalid character in the digit string" );
562 snprintf( buf, buflen,
"BIGNUM - The buffer is too small to write to" );
564 snprintf( buf, buflen,
"BIGNUM - The input arguments are negative or result in illegal output" );
566 snprintf( buf, buflen,
"BIGNUM - The input argument for division is zero, which is not allowed" );
568 snprintf( buf, buflen,
"BIGNUM - The input arguments are not acceptable" );
570 snprintf( buf, buflen,
"BIGNUM - Memory allocation failed" );
573 #if defined(POLARSSL_BLOWFISH_C)
575 snprintf( buf, buflen,
"BLOWFISH - Invalid key length" );
577 snprintf( buf, buflen,
"BLOWFISH - Invalid data input length" );
580 #if defined(POLARSSL_CAMELLIA_C)
582 snprintf( buf, buflen,
"CAMELLIA - Invalid key length" );
584 snprintf( buf, buflen,
"CAMELLIA - Invalid data input length" );
587 #if defined(POLARSSL_CCM_C)
589 snprintf( buf, buflen,
"CCM - Bad input parameters to function" );
591 snprintf( buf, buflen,
"CCM - Authenticated decryption failed" );
594 #if defined(POLARSSL_CTR_DRBG_C)
596 snprintf( buf, buflen,
"CTR_DRBG - The entropy source failed" );
598 snprintf( buf, buflen,
"CTR_DRBG - Too many random requested in single call" );
600 snprintf( buf, buflen,
"CTR_DRBG - Input too large (Entropy + additional)" );
602 snprintf( buf, buflen,
"CTR_DRBG - Read/write error in file" );
605 #if defined(POLARSSL_DES_C)
607 snprintf( buf, buflen,
"DES - The data input has an invalid length" );
610 #if defined(POLARSSL_ENTROPY_C)
612 snprintf( buf, buflen,
"ENTROPY - Critical entropy source failure" );
614 snprintf( buf, buflen,
"ENTROPY - No more sources can be added" );
616 snprintf( buf, buflen,
"ENTROPY - No sources have been added to poll" );
618 snprintf( buf, buflen,
"ENTROPY - Read/write error in file" );
621 #if defined(POLARSSL_GCM_C)
623 snprintf( buf, buflen,
"GCM - Authenticated decryption failed" );
625 snprintf( buf, buflen,
"GCM - Bad input parameters to function" );
628 #if defined(POLARSSL_HMAC_DRBG_C)
630 snprintf( buf, buflen,
"HMAC_DRBG - Too many random requested in single call" );
632 snprintf( buf, buflen,
"HMAC_DRBG - Input too large (Entropy + additional)" );
634 snprintf( buf, buflen,
"HMAC_DRBG - Read/write error in file" );
636 snprintf( buf, buflen,
"HMAC_DRBG - The entropy source failed" );
639 #if defined(POLARSSL_MD2_C)
641 snprintf( buf, buflen,
"MD2 - Read/write error in file" );
644 #if defined(POLARSSL_MD4_C)
646 snprintf( buf, buflen,
"MD4 - Read/write error in file" );
649 #if defined(POLARSSL_MD5_C)
651 snprintf( buf, buflen,
"MD5 - Read/write error in file" );
654 #if defined(POLARSSL_NET_C)
656 snprintf( buf, buflen,
"NET - Failed to get an IP address for the given hostname" );
658 snprintf( buf, buflen,
"NET - Failed to open a socket" );
660 snprintf( buf, buflen,
"NET - The connection to the given server / port failed" );
662 snprintf( buf, buflen,
"NET - Binding of the socket failed" );
664 snprintf( buf, buflen,
"NET - Could not listen on the socket" );
666 snprintf( buf, buflen,
"NET - Could not accept the incoming connection" );
668 snprintf( buf, buflen,
"NET - Reading information from the socket failed" );
670 snprintf( buf, buflen,
"NET - Sending information through the socket failed" );
672 snprintf( buf, buflen,
"NET - Connection was reset by peer" );
674 snprintf( buf, buflen,
"NET - Connection requires a read call" );
676 snprintf( buf, buflen,
"NET - Connection requires a write call" );
679 #if defined(POLARSSL_OID_C)
681 snprintf( buf, buflen,
"OID - OID is not found" );
683 snprintf( buf, buflen,
"OID - output buffer is too small" );
686 #if defined(POLARSSL_PADLOCK_C)
688 snprintf( buf, buflen,
"PADLOCK - Input data should be aligned" );
691 #if defined(POLARSSL_PBKDF2_C)
693 snprintf( buf, buflen,
"PBKDF2 - Bad input parameters to function" );
696 #if defined(POLARSSL_RIPEMD160_C)
698 snprintf( buf, buflen,
"RIPEMD160 - Read/write error in file" );
701 #if defined(POLARSSL_SHA1_C)
703 snprintf( buf, buflen,
"SHA1 - Read/write error in file" );
706 #if defined(POLARSSL_SHA256_C)
708 snprintf( buf, buflen,
"SHA256 - Read/write error in file" );
711 #if defined(POLARSSL_SHA512_C)
713 snprintf( buf, buflen,
"SHA512 - Read/write error in file" );
716 #if defined(POLARSSL_THREADING_C)
718 snprintf( buf, buflen,
"THREADING - The selected feature is not available" );
720 snprintf( buf, buflen,
"THREADING - Bad input parameters to function" );
722 snprintf( buf, buflen,
"THREADING - Locking / unlocking / free failed with error code" );
725 #if defined(POLARSSL_XTEA_C)
727 snprintf( buf, buflen,
"XTEA - The data input has an invalid length" );
731 if( strlen( buf ) != 0 )
734 snprintf( buf, buflen,
"UNKNOWN ERROR CODE (%04X)", use_ret );
737 #if defined(POLARSSL_ERROR_STRERROR_BC)
738 void error_strerror(
int ret,
char *buf,
size_t buflen )
746 #if defined(POLARSSL_ERROR_STRERROR_DUMMY)
761 #if defined(POLARSSL_ERROR_STRERROR_BC)
762 void error_strerror(
int ret,
char *buf,
size_t buflen )
#define POLARSSL_ERR_PKCS5_INVALID_FORMAT
Unexpected ASN.1 data.
#define POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE
Feature not available, e.g.
#define POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED
The entropy source failed.
#define POLARSSL_ERR_PK_INVALID_ALG
The algorithm tag or value is invalid.
#define POLARSSL_ERR_MPI_INVALID_CHARACTER
There is an invalid character in the digit string.
#define POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE
The output buffer for decryption is not large enough.
#define POLARSSL_ERR_CIPHER_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED
Making of the public value failed.
#define POLARSSL_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC
Processing of the ChangeCipherSpec handshake message failed.
#define POLARSSL_ERR_PK_SIG_LEN_MISMATCH
The signature is valid but its length is less than expected.
#define POLARSSL_ERR_PK_KEY_INVALID_FORMAT
Invalid key tag or value.
#define POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE
Unavailable feature, e.g.
#define POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH
The data input has an invalid length.
#define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED
Making of the DHM parameters failed.
Password-Based Key Derivation Function 2 (from PKCS#5) DEPRECATED: use pkcs5.h instead.
#define POLARSSL_ERR_CCM_BAD_INPUT
Bad input parameters to function.
void polarssl_strerror(int errnum, char *buffer, size_t buflen)
Error code layout.
#define POLARSSL_ERR_ECP_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE
Processing of the ServerKeyExchange handshake message failed.
#define POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE
The selected feature is not available.
#define POLARSSL_ERR_PK_FILE_IO_ERROR
Read/write of file failed.
#define POLARSSL_ERR_DHM_INVALID_FORMAT
The ASN.1 data is not formatted correctly.
#define POLARSSL_ERR_MD_ALLOC_FAILED
Failed to allocate memory.
#define POLARSSL_ERR_NET_BIND_FAILED
Binding of the socket failed.
#define POLARSSL_ERR_NET_RECV_FAILED
Reading information from the socket failed.
#define POLARSSL_ERR_SSL_PK_TYPE_MISMATCH
Public key type mismatch (eg, asked for RSA key exchange and presented EC key)
#define POLARSSL_ERR_NET_WANT_WRITE
Connection requires a write call.
#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO_DONE
Processing of the ServerHelloDone handshake message failed.
#define POLARSSL_ERR_X509_INVALID_DATE
The date tag or value is invalid.
Network communication functions.
#define POLARSSL_ERR_MPI_NEGATIVE_VALUE
The input arguments are negative or result in illegal output.
#define POLARSSL_ERR_CIPHER_ALLOC_FAILED
Failed to allocate memory.
#define POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG
Unsupported key encryption algorithm.
#define POLARSSL_ERR_SSL_CONN_EOF
The connection indicated an EOF.
#define POLARSSL_ERR_ASN1_LENGTH_MISMATCH
Actual length differs from expected length.
#define POLARSSL_ERR_MD_FEATURE_UNAVAILABLE
The selected feature is not available.
#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO
Processing of the ServerHello handshake message failed.
#define POLARSSL_ERR_DHM_CALC_SECRET_FAILED
Calculation of the DHM secret failed.
Elliptic curves over GF(p)
#define POLARSSL_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED
The entropy source failed.
#define POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT
Format not recognized as DER or PEM.
#define POLARSSL_ERR_SSL_INVALID_RECORD
An invalid SSL record was received.
#define POLARSSL_ERR_DHM_MALLOC_FAILED
Allocation of memory failed.
#define POLARSSL_ERR_GCM_BAD_INPUT
Bad input parameters to function.
#define POLARSSL_ERR_X509_INVALID_FORMAT
The CRT/CRL/CSR format is invalid, e.g.
#define POLARSSL_ERR_ENTROPY_MAX_SOURCES
No more sources can be added.
#define POLARSSL_ERR_ASN1_BUF_TOO_SMALL
Buffer too small when writing ASN.1 data structure.
#define POLARSSL_ERR_PEM_MALLOC_FAILED
Failed to allocate memory.
#define POLARSSL_ERR_PKCS5_FEATURE_UNAVAILABLE
Requested encryption or digest alg not available.
#define POLARSSL_ERR_ECP_MALLOC_FAILED
Memory allocation failed.
#define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH
Given private key password does not allow for correct decryption.
#define POLARSSL_ERR_SSL_BAD_HS_NEW_SESSION_TICKET
Processing of the NewSessionTicket handshake message failed.
Configuration options (set of defines)
#define POLARSSL_ERR_X509_UNKNOWN_SIG_ALG
Signature algorithm (oid) is unsupported.
#define POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY
The peer notified us that the connection is going to be closed.
#define POLARSSL_ERR_MD5_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_ASN1_INVALID_DATA
Data is invalid.
#define POLARSSL_ERR_MD_FILE_IO_ERROR
Opening or reading of file failed.
#define POLARSSL_ERR_RSA_RNG_FAILED
The random generator failed to generate non-zeros.
#define POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG
Input too large (Entropy + additional).
#define POLARSSL_ERR_CIPHER_INVALID_PADDING
Input data contains invalid padding and is rejected.
#define POLARSSL_ERR_MPI_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_X509_INVALID_SIGNATURE
The signature tag or value invalid.
Entropy accumulator implementation.
#define POLARSSL_ERR_PBKDF2_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_SSL_HW_ACCEL_FAILED
Hardware acceleration function returned with error.
#define POLARSSL_ERR_ASN1_INVALID_LENGTH
Error when trying to determine the length or invalid length.
#define POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE
Requested curve not available.
#define POLARSSL_ERR_SSL_INVALID_MAC
Verification of the message MAC failed.
#define POLARSSL_ERR_X509_UNKNOWN_VERSION
CRT/CRL/CSR has an unsupported version number.
#define POLARSSL_ERR_SSL_NO_CLIENT_CERTIFICATE
No client certification received from the client, but required by the authentication mode...
#define POLARSSL_ERR_NET_CONN_RESET
Connection was reset by peer.
#define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT
PBE ASN.1 data not as expected.
Object Identifier (OID) database.
Public Key abstraction layer.
#define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED
Input data should be aligned.
Multi-precision integer library.
#define POLARSSL_ERR_PK_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_ECP_BUFFER_TOO_SMALL
The buffer is too small to write to.
#define POLARSSL_ERR_SSL_HW_ACCEL_FALLTHROUGH
Hardware acceleration function skipped / left alone data.
RIPE MD-160 message digest.
#define POLARSSL_ERR_PK_UNKNOWN_NAMED_CURVE
Elliptic curve is unsupported (only NIST curves are supported).
#define POLARSSL_ERR_PK_FEATURE_UNAVAILABLE
Unavailable feature, e.g.
#define POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH
Given private key password does not allow for correct decryption.
Error to string translation.
#define POLARSSL_ERR_SSL_CERTIFICATE_REQUIRED
The own certificate is not set, but needed by the server.
#define POLARSSL_ERR_PEM_PASSWORD_REQUIRED
Private key password can't be empty.
#define POLARSSL_ERR_CTR_DRBG_REQUEST_TOO_BIG
Too many random requested in single call.
#define POLARSSL_ERR_SSL_CERTIFICATE_TOO_LARGE
Our own certificate(s) is/are too large to send in an SSL message.
#define POLARSSL_ERR_ECP_VERIFY_FAILED
The signature is not valid.
#define POLARSSL_ERR_MD_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_SSL_NO_RNG
No RNG was provided to the SSL module.
#define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED
Reading of the public values failed.
#define POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR
Read/write error in file.
Threading abstraction layer.
#define POLARSSL_ERR_RSA_INVALID_PADDING
Input data contains invalid padding and is rejected.
#define POLARSSL_ERR_X509_CERT_VERIFY_FAILED
Certificate verification failed, e.g.
#define POLARSSL_ERR_OID_NOT_FOUND
OID is not found.
Privacy Enhanced Mail (PEM) decoding.
#define POLARSSL_ERR_SSL_FATAL_ALERT_MESSAGE
A fatal alert message was received from our peer.
#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
Invalid data input length.
#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL
Output buffer too small.
#define POLARSSL_ERR_MPI_DIVISION_BY_ZERO
The input argument for division is zero, which is not allowed.
#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS
Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret...
#define POLARSSL_ERR_PK_PASSWORD_REQUIRED
Private key password can't be empty.
#define POLARSSL_ERR_PK_PASSWORD_MISMATCH
Given private key password does not allow for correct decryption.
#define POLARSSL_ERR_SSL_BAD_HS_PROTOCOL_VERSION
Handshake protocol not within min/max boundaries.
#define POLARSSL_ERR_DHM_READ_PARAMS_FAILED
Reading of the DHM parameters failed.
#define POLARSSL_ERR_X509_UNKNOWN_OID
Requested OID is unknown.
#define POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE
An unexpected message was received from our peer.
#define POLARSSL_ERR_MPI_BUFFER_TOO_SMALL
The buffer is too small to write to.
#define POLARSSL_ERR_SSL_COMPRESSION_FAILED
Processing of the compression / decompression failed.
#define POLARSSL_ERR_SSL_PEER_VERIFY_FAILED
Verification of our peer failed.
XTEA block cipher (32-bit)
#define POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_NET_CONNECT_FAILED
The connection to the given server / port failed.
#define POLARSSL_ERR_AES_INVALID_KEY_LENGTH
Invalid key length.
#define POLARSSL_ERR_SHA256_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_PEM_PASSWORD_MISMATCH
Given private key password does not allow for correct decryption.
#define POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED
Decryption of block requires a full block.
#define POLARSSL_ERR_PK_MALLOC_FAILED
Memory alloation failed.
#define POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED
No CA Chain is set, but required to operate.
#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED
Session ticket has expired.
Diffie-Hellman-Merkle key exchange.
#define POLARSSL_ERR_PEM_INVALID_ENC_IV
RSA IV is not in hex-format.
#define POLARSSL_ERR_MD2_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_X509_INVALID_ALG
The algorithm tag or value is invalid.
#define POLARSSL_ERR_NET_SEND_FAILED
Sending information through the socket failed.
#define POLARSSL_ERR_NET_WANT_READ
Connection requires a read call.
#define POLARSSL_ERR_ASN1_OUT_OF_DATA
Out of data when parsing an ASN1 data structure.
#define POLARSSL_ERR_RSA_VERIFY_FAILED
The PKCS#1 verification failed.
X.509 generic defines and structures.
#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST
Processing of the CertificateRequest handshake message failed.
#define POLARSSL_ERR_ASN1_MALLOC_FAILED
Memory allocation failed.
#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_HELLO
Processing of the ClientHello handshake message failed.
#define POLARSSL_ERR_PEM_INVALID_DATA
PEM string is not as expected.
#define POLARSSL_ERR_X509_FILE_IO_ERROR
Read/write of file failed.
#define POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG
Input too large (Entropy + additional).
#define POLARSSL_ERR_GCM_AUTH_FAILED
Authenticated decryption failed.
#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE
Processing of the ClientKeyExchange handshake message failed.
#define POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED
The own private key or pre-shared key is not set, but needed.
Generic message digest wrapper.
RFC 1521 base64 encoding/decoding.
#define POLARSSL_ERR_SSL_INTERNAL_ERROR
Internal error (eg, unexpected failure in lower-level module)
#define POLARSSL_ERR_NET_ACCEPT_FAILED
Could not accept the incoming connection.
The RSA public-key cryptosystem.
#define POLARSSL_ERR_SSL_UNKNOWN_CIPHER
An unknown cipher was received.
#define POLARSSL_ERR_MPI_MALLOC_FAILED
Memory allocation failed.
#define POLARSSL_ERR_HMAC_DRBG_REQUEST_TOO_BIG
Too many random requested in single call.
#define POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH
Invalid key length.
#define POLARSSL_ERR_RSA_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_RSA_PRIVATE_FAILED
The private key operation failed.
#define POLARSSL_ERR_X509_INVALID_NAME
The name tag or value is invalid.
#define POLARSSL_ERR_PK_TYPE_MISMATCH
Type mismatch, eg attempt to encrypt with an ECDSA key.
#define POLARSSL_ERR_ECP_RANDOM_FAILED
Generation of random value, such as (ephemeral) key, failed.
#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP
Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public.
#define POLARSSL_ERR_SHA512_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH
Invalid data input length.
SHA-1 cryptographic hash function.
#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED
Key failed to pass the libraries validity check.
#define POLARSSL_ERR_SSL_BAD_HS_FINISHED
Processing of the Finished handshake message failed.
#define POLARSSL_ERR_DHM_FILE_IO_ERROR
Read/write of file failed.
#define POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED
No sources have been added to poll.
#define POLARSSL_ERR_X509_FEATURE_UNAVAILABLE
Unavailable feature, e.g.
Galois/Counter mode for 128-bit block ciphers.
#define POLARSSL_ERR_X509_INVALID_VERSION
The CRT/CRL/CSR version element is invalid.
SHA-384 and SHA-512 cryptographic hash function.
#define POLARSSL_ERR_THREADING_MUTEX_ERROR
Locking / unlocking / free failed with error code.
#define POLARSSL_ERR_SSL_UNKNOWN_IDENTITY
Unknown identity received (eg, PSK identity)
#define POLARSSL_ERR_SSL_MALLOC_FAILED
Memory allocation failed.
#define POLARSSL_ERR_X509_INVALID_EXTENSIONS
The extension tag or value is invalid.
#define POLARSSL_ERR_OID_BUF_TOO_SMALL
output buffer is too small
#define POLARSSL_ERR_RIPEMD160_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_ENTROPY_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_MPI_FILE_IO_ERROR
An error occurred while reading from or writing to a file.
#define POLARSSL_ERR_DHM_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_PKCS5_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_X509_BAD_INPUT_DATA
Input invalid.
#define POLARSSL_ERR_RSA_KEY_GEN_FAILED
Something failed during generation of a key.
VIA PadLock ACE for HW encryption/decryption supported by some processors.
#define POLARSSL_ERR_NET_SOCKET_FAILED
Failed to open a socket.
#define POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT
No PEM header or footer found.
#define POLARSSL_ERR_NET_LISTEN_FAILED
Could not listen on the socket.
#define POLARSSL_ERR_RSA_PUBLIC_FAILED
The public key operation failed.
MD4 message digest algorithm (hash function)
#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
Invalid key length.
#define POLARSSL_ERR_MD4_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_ENTROPY_SOURCE_FAILED
Critical entropy source failure.
#define POLARSSL_ERR_PK_KEY_INVALID_VERSION
Unsupported key version.
MD5 message digest algorithm (hash function)
#define POLARSSL_ERR_X509_MALLOC_FAILED
Allocation of memory failed.
#define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH
The data input has an invalid length.
SHA-224 and SHA-256 cryptographic hash function.
#define POLARSSL_ERR_PEM_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_X509_INVALID_SERIAL
The serial tag or value is invalid.
#define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH
Invalid data input length.
#define POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE
The requested feature is not available.
#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE
Processing of the Certificate handshake message failed.
#define POLARSSL_ERR_CCM_AUTH_FAILED
Authenticated decryption failed.
#define POLARSSL_ERR_THREADING_FEATURE_UNAVAILABLE
The selected feature is not available.
#define POLARSSL_ERR_ECP_INVALID_KEY
Invalid private or public key.
#define POLARSSL_ERR_PK_INVALID_PUBKEY
The pubkey tag or value is invalid (only RSA and EC are supported).
#define POLARSSL_ERR_PKCS12_BAD_INPUT_DATA
Bad input parameters to function.
MD2 message digest algorithm (hash function)
#define POLARSSL_ERR_SSL_BAD_INPUT_DATA
Bad input parameters to function.
#define POLARSSL_ERR_ASN1_UNEXPECTED_TAG
ASN1 tag was of an unexpected value.
#define POLARSSL_ERR_BASE64_INVALID_CHARACTER
Invalid character in input.
#define POLARSSL_ERR_CIPHER_AUTH_FAILED
Authentication failed (for AEAD modes).
#define POLARSSL_ERR_PK_UNKNOWN_PK_ALG
Key algorithm is unsupported (only RSA and EC are supported).
#define POLARSSL_ERR_MPI_NOT_ACCEPTABLE
The input arguments are not acceptable.
PKCS#12 Personal Information Exchange Syntax.
#define POLARSSL_ERR_X509_SIG_MISMATCH
Signature algorithms do not match.
#define POLARSSL_ERR_ECP_SIG_LEN_MISMATCH
Signature is valid but shorter than the user-supplied length.
#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY
Processing of the CertificateVerify handshake message failed.
Counter with CBC-MAC (CCM) for 128-bit block ciphers.
#define POLARSSL_ERR_SSL_COUNTER_WRAPPING
A counter would wrap (eg, too many messages exchanged).
CTR_DRBG based on AES-256 (NIST SP 800-90)
#define POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN
The server has no ciphersuites in common with the client.
HMAC_DRBG (NIST SP 800-90A)
#define POLARSSL_ERR_SHA1_FILE_IO_ERROR
Read/write error in file.
#define POLARSSL_ERR_NET_UNKNOWN_HOST
Failed to get an IP address for the given hostname.