Go to the documentation of this file.
113 #include <inttypes.h>
116 #if defined(OPENSSL_WINDOWS)
125 #include "../internal.h"
172 if (src->
data != NULL) {
243 if (
error->file == NULL) {
253 if (
error->data == NULL) {
269 if (
error->data != NULL) {
339 state->to_free = NULL;
379 }
else if (a_key > b_key) {
391 const char *string_data) {
405 if (lib >= (1 << 6) ||
key >= (1 << 11)) {
415 return &string_data[(*result) & 0x7fff];
419 "invalid library (0)",
424 "Diffie-Hellman routines",
425 "public key routines",
426 "memory buffer routines",
427 "object identifier routines",
430 "X.509 certificate routines",
431 "ASN.1 encoding routines",
432 "configuration file routines",
433 "common libcrypto routines",
434 "elliptic curve routines",
440 "random number generator",
451 "Trust Token functions",
452 "User defined functions",
466 return ret == NULL ?
"unknown library" :
ret;
470 return "OPENSSL_internal";
479 return strerror(reason);
491 return "malloc failure";
493 return "function should not have been called";
495 return "passed a null parameter";
497 return "internal error";
511 return ret == NULL ?
"unknown error" :
ret;
542 char lib_buf[64], reason_buf[64];
543 if (lib_str == NULL) {
548 if (reason_str == NULL) {
549 BIO_snprintf(reason_buf,
sizeof(reason_buf),
"reason(%u)", reason);
550 reason_str = reason_buf;
554 packed_error, lib_str, reason_str);
556 if (strlen(
buf) ==
len - 1) {
559 static const unsigned num_colons = 4;
563 if (
len <= num_colons) {
569 for (
i = 0;
i < num_colons;
i++) {
570 char *colon = strchr(s,
':');
571 char *last_pos = &
buf[
len - 1] - num_colons +
i;
573 if (colon == NULL || colon > last_pos) {
602 if (packed_error == 0) {
616 assert(
msg[msg_len] ==
'\0');
618 int res = fputs(
msg, fp);
619 return res < 0 ? 0 : 1;
652 #if defined(OPENSSL_WINDOWS)
653 reason = GetLastError();
675 size_t alloced, new_len,
len = 0, substr_len;
686 for (
i = 0;
i <
num;
i++) {
687 substr = va_arg(
args,
const char *);
688 if (substr == NULL) {
692 substr_len = strlen(substr);
693 new_len =
len + substr_len;
694 if (new_len > alloced) {
697 if (alloced + 20 + 1 < alloced) {
703 alloced = new_len + 20;
705 if (new_buf == NULL) {
730 static const unsigned buf_len = 256;
774 if (
state->top == 0) {
803 for (
size_t i = 0;
i <
state->num_errors;
i++) {
822 size_t num_errors =
state->top >=
state->bottom
827 if (
ret->errors == NULL) {
832 ret->num_errors = num_errors;
834 for (
size_t i = 0;
i < num_errors;
i++) {
842 if (
state == NULL ||
state->num_errors == 0) {
852 for (
size_t i = 0;
i <
state->num_errors;
i++) {
void ERR_load_BIO_strings(void)
#define CRYPTO_STATIC_MUTEX_INIT
uint32_t ERR_peek_error_line(const char **file, int *line)
void ERR_clear_system_error(void)
void ERR_restore_state(const ERR_SAVE_STATE *state)
void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state)
static const char * err_string_lookup(uint32_t lib, uint32_t key, const uint32_t *values, size_t num_values, const char *string_data)
static void err_add_error_vdata(unsigned num, va_list args)
const grpc_generator::File * file
uint32_t ERR_peek_error(void)
static uint32_t get_error_values(int inc, int top, const char **file, int *line, const char **data, int *flags)
#define CRYPTO_STATIC_MUTEX_unlock_write
struct err_error_st errors[ERR_NUM_ERRORS]
int(* ERR_print_errors_callback_t)(const char *str, size_t len, void *ctx)
const size_t kOpenSSLReasonValuesLen
void ERR_put_error(int library, int unused, int reason, const char *file, unsigned line)
uint32_t ERR_get_error_line_data(const char **file, int *line, const char **data, int *flags)
static struct test_ctx ctx
uint32_t ERR_peek_last_error_line_data(const char **file, int *line, const char **data, int *flags)
uint32_t ERR_peek_error_line_data(const char **file, int *line, const char **data, int *flags)
uint32_t ERR_get_error(void)
void ERR_remove_thread_state(const CRYPTO_THREADID *tid)
#define CRYPTO_get_thread_local
static void * OPENSSL_memset(void *dst, int c, size_t n)
static void err_set_error_data(char *data)
static const char * err_reason_error_string(uint32_t packed_error)
void ERR_add_error_dataf(const char *format,...)
static void err_clear(struct err_error_st *error)
int ERR_get_next_error_library(void)
const char kOpenSSLReasonStringData[]
#define CRYPTO_set_thread_local
static struct CRYPTO_STATIC_MUTEX global_next_library_mutex
#define ERR_GET_REASON(packed_error)
#define ERR_R_PASSED_NULL_PARAMETER
#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED
static const char *const kLibraryNames[ERR_NUM_LIBS]
#define CRYPTO_STATIC_MUTEX_lock_write
ERR_SAVE_STATE * ERR_save_state(void)
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
#define ERR_GET_LIB(packed_error)
static int print_errors_to_file(const char *msg, size_t msg_len, void *ctx)
#define ERR_R_INTERNAL_ERROR
#define ERR_PACK(lib, reason)
static void err_copy(struct err_error_st *dst, const struct err_error_st *src)
int ERR_pop_to_mark(void)
OPENSSL_MSVC_PRAGMA(warning(disable:4702))
const char * ERR_lib_error_string(uint32_t packed_error)
void ERR_clear_error(void)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
_W64 unsigned int uintptr_t
static ERR_STATE * err_get_state(void)
void ERR_load_crypto_strings(void)
static const char * err_lib_error_string(uint32_t packed_error)
int push(void *desc, unsigned char *buf, unsigned len)
#define ERR_ERROR_STRING_BUF_LEN
uint32_t ERR_peek_last_error(void)
uint32_t ERR_get_error_line(const char **file, int *line)
void ERR_add_error_data(unsigned count,...)
char * ERR_error_string(uint32_t packed_error, char *ret)
void ERR_print_errors_cb(ERR_print_errors_callback_t callback, void *ctx)
uint32_t ERR_peek_last_error_line(const char **file, int *line)
UniquePtr< SSL_SESSION > ret
std::array< int64_t, Size > values
const uint32_t kOpenSSLReasonValues[]
void ERR_remove_state(unsigned long pid)
const char * ERR_reason_error_string(uint32_t packed_error)
void ERR_print_errors_fp(FILE *file)
struct err_error_st * errors
void ERR_free_strings(void)
struct err_state_st ERR_STATE
char * ERR_error_string_n(uint32_t packed_error, char *buf, size_t len)
const char * ERR_func_error_string(uint32_t packed_error)
void ERR_load_RAND_strings(void)
static void err_state_free(void *statep)
void ERR_load_ERR_strings(void)
static int global_next_library
@ OPENSSL_THREAD_LOCAL_ERR
static upb_pb_encoder_segment * top(upb_pb_encoder *e)
static struct rpc_state state
#define ERR_R_MALLOC_FAILURE
static int err_string_cmp(const void *a, const void *b)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:15