#include <gnutls_int.h>
#include "gnutls_errors.h"
#include <libtasn1.h>
Go to the source code of this file.
Defines | |
#define | _(String) (String) |
#define | N_(String) (String) |
#define | ERROR_ENTRY(desc, name, fatal) { desc, #name, name, fatal} |
#define | GNUTLS_ERROR_LOOP(b) |
#define | GNUTLS_ERROR_ALG_LOOP(a) GNUTLS_ERROR_LOOP( if(p->number == error) { a; break; } ) |
Typedefs | |
typedef struct MHD_gnutls_error_entry | MHD_gnutls_error_entry |
Functions | |
int | MHD_gtls_error_is_fatal (int error) |
void | MHD_gtls_perror (int error) |
const char * | MHD_gtls_strerror (int error) |
const char * | MHD__gnutls_strerror (int error) |
int | MHD_gtls_asn2err (int asn_err) |
void | MHD_gtls_log (int level, const char *fmt,...) |
void | MHD__gnutls_null_log (void *n,...) |
Variables | |
LOG_FUNC | MHD__gnutls_log_func |
static const MHD_gnutls_error_entry | MHD_gtls_error_algorithms [] |
#define _ | ( | String | ) | (String) |
Definition at line 33 of file gnutls_errors.c.
Referenced by MHD__gnutls_strerror(), MHD_gtls_perror(), and MHD_gtls_strerror().
#define ERROR_ENTRY | ( | desc, | |||
name, | |||||
fatal | ) | { desc, #name, name, fatal} |
Definition at line 38 of file gnutls_errors.c.
#define GNUTLS_ERROR_ALG_LOOP | ( | a | ) | GNUTLS_ERROR_LOOP( if(p->number == error) { a; break; } ) |
Definition at line 252 of file gnutls_errors.c.
Referenced by MHD__gnutls_strerror(), MHD_gtls_error_is_fatal(), MHD_gtls_perror(), and MHD_gtls_strerror().
#define GNUTLS_ERROR_LOOP | ( | b | ) |
Value:
const MHD_gnutls_error_entry *p; \ for(p = MHD_gtls_error_algorithms; p->desc != NULL; p++) { b ; }
Definition at line 248 of file gnutls_errors.c.
#define N_ | ( | String | ) | (String) |
Definition at line 34 of file gnutls_errors.c.
typedef struct MHD_gnutls_error_entry MHD_gnutls_error_entry |
Definition at line 48 of file gnutls_errors.c.
void MHD__gnutls_null_log | ( | void * | n, | |
... | ||||
) |
Definition at line 402 of file gnutls_errors.c.
const char* MHD__gnutls_strerror | ( | int | error | ) |
int MHD_gtls_asn2err | ( | int | asn_err | ) |
Definition at line 343 of file gnutls_errors.c.
References ASN1_DER_ERROR, ASN1_DER_OVERFLOW, ASN1_ELEMENT_NOT_FOUND, ASN1_ERROR_TYPE_ANY, ASN1_FILE_NOT_FOUND, ASN1_GENERIC_ERROR, ASN1_IDENTIFIER_NOT_FOUND, ASN1_MEM_ALLOC_ERROR, ASN1_MEM_ERROR, ASN1_SYNTAX_ERROR, ASN1_TAG_ERROR, ASN1_TAG_IMPLICIT, ASN1_VALUE_NOT_FOUND, ASN1_VALUE_NOT_VALID, GNUTLS_E_ASN1_DER_ERROR, GNUTLS_E_ASN1_DER_OVERFLOW, GNUTLS_E_ASN1_ELEMENT_NOT_FOUND, GNUTLS_E_ASN1_GENERIC_ERROR, GNUTLS_E_ASN1_IDENTIFIER_NOT_FOUND, GNUTLS_E_ASN1_SYNTAX_ERROR, GNUTLS_E_ASN1_TAG_ERROR, GNUTLS_E_ASN1_TAG_IMPLICIT, GNUTLS_E_ASN1_TYPE_ANY_ERROR, GNUTLS_E_ASN1_VALUE_NOT_FOUND, GNUTLS_E_ASN1_VALUE_NOT_VALID, GNUTLS_E_FILE_ERROR, GNUTLS_E_MEMORY_ERROR, and GNUTLS_E_SHORT_MEMORY_BUFFER.
Referenced by MHD__gnutls_cert_get_issuer_dn(), MHD__gnutls_global_init(), MHD__gnutls_x509_crt_get_extension(), MHD__gnutls_x509_decode_octet_string(), MHD__gnutls_x509_der_encode(), MHD__gnutls_x509_export_int(), MHD__gnutls_x509_ext_extract_keyUsage(), MHD__gnutls_x509_get_pk_algorithm(), MHD__gnutls_x509_read_int(), MHD__gnutls_x509_read_rsa_params(), MHD__gnutls_x509_read_value(), MHD__gnutls_x509_write_int(), MHD__gnutls_x509_write_rsa_params(), MHD_gnutls_x509_crt_get_version(), MHD_gnutls_x509_crt_import(), and MHD_gnutls_x509_crt_init().
int MHD_gtls_error_is_fatal | ( | int | error | ) |
MHD_gtls_error_is_fatal - Returns non-zero in case of a fatal error : is an error returned by a gnutls function. Error should be a negative value.
If a function returns a negative value you may feed that value to this function to see if it is fatal. Returns 1 for a fatal error 0 otherwise. However you may want to check the error code manually, since some non-fatal errors to the protocol may be fatal for you (your program).
This is only useful if you are dealing with errors from the record layer or the handshake layer.
For positive values, 0 is returned.
Definition at line 274 of file gnutls_errors.c.
References GNUTLS_ERROR_ALG_LOOP.
Referenced by MHD_gtls_io_read_buffered(), MHD_gtls_recv_int(), and MHD_gtls_send_int().
void MHD_gtls_log | ( | int | level, | |
const char * | fmt, | |||
... | ||||
) |
void MHD_gtls_perror | ( | int | error | ) |
MHD_gtls_perror - prints a string to stderr with a description of an error : is an error returned by a gnutls function. Error is always a negative value.
This function is like perror(). The only difference is that it accepts an error number returned by a gnutls function.
Definition at line 296 of file gnutls_errors.c.
References _, and GNUTLS_ERROR_ALG_LOOP.
const char* MHD_gtls_strerror | ( | int | error | ) |
MHD_gtls_strerror - Returns a string with a description of an error : is an error returned by a gnutls function. Error is always a negative value.
This function is similar to strerror(). Differences: it accepts an error number returned by a gnutls function; In case of an unknown error a descriptive string is sent instead of NULL.
Definition at line 317 of file gnutls_errors.c.
References _, and GNUTLS_ERROR_ALG_LOOP.
Referenced by MHD_gtls_remove_unwanted_ciphersuites().
Definition at line 53 of file gnutls_global.c.
Referenced by MHD_gtls_global_set_log_function(), and MHD_gtls_log().
const MHD_gnutls_error_entry MHD_gtls_error_algorithms[] [static] |
Definition at line 50 of file gnutls_errors.c.