Rich Salz | b6cff31 | 2016-05-17 17:38:18 -0400 | [diff] [blame] | 1 | /* |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 2 | * Generated by util/mkerr.pl DO NOT EDIT |
| 3 | * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 4 | * |
Rich Salz | b6cff31 | 2016-05-17 17:38:18 -0400 | [diff] [blame] | 5 | * Licensed under the OpenSSL license (the "License"). You may not use |
| 6 | * this file except in compliance with the License. You can obtain a copy |
| 7 | * in the file LICENSE in the source distribution or at |
| 8 | * https://www.openssl.org/source/license.html |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 9 | */ |
| 10 | |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 11 | #include <openssl/err.h> |
| 12 | #include "e_ossltest_err.h" |
| 13 | |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 14 | #ifndef OPENSSL_NO_ERR |
| 15 | |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 16 | static ERR_STRING_DATA OSSLTEST_str_functs[] = { |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 17 | {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"}, |
Rich Salz | 5816586 | 2017-06-07 16:29:15 -0400 | [diff] [blame] | 18 | {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0), ""}, |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 19 | {0, NULL} |
| 20 | }; |
| 21 | |
| 22 | static ERR_STRING_DATA OSSLTEST_str_reasons[] = { |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 23 | {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"}, |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 24 | {0, NULL} |
| 25 | }; |
| 26 | |
| 27 | #endif |
| 28 | |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 29 | static int lib_code = 0; |
| 30 | static int error_loaded = 0; |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 31 | |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 32 | static int ERR_load_OSSLTEST_strings(void) |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 33 | { |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 34 | if (lib_code == 0) |
| 35 | lib_code = ERR_get_next_error_library(); |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 36 | |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 37 | if (!error_loaded) { |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 38 | #ifndef OPENSSL_NO_ERR |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 39 | ERR_load_strings(lib_code, OSSLTEST_str_functs); |
| 40 | ERR_load_strings(lib_code, OSSLTEST_str_reasons); |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 41 | #endif |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 42 | error_loaded = 1; |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 43 | } |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 44 | return 1; |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | static void ERR_unload_OSSLTEST_strings(void) |
| 48 | { |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 49 | if (error_loaded) { |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 50 | #ifndef OPENSSL_NO_ERR |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 51 | ERR_unload_strings(lib_code, OSSLTEST_str_functs); |
| 52 | ERR_unload_strings(lib_code, OSSLTEST_str_reasons); |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 53 | #endif |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 54 | error_loaded = 0; |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 55 | } |
| 56 | } |
| 57 | |
| 58 | static void ERR_OSSLTEST_error(int function, int reason, char *file, int line) |
| 59 | { |
Rich Salz | 52df25c | 2017-06-07 15:12:03 -0400 | [diff] [blame] | 60 | if (lib_code == 0) |
| 61 | lib_code = ERR_get_next_error_library(); |
| 62 | ERR_PUT_error(lib_code, function, reason, file, line); |
Matt Caswell | 2d5d70b | 2015-06-16 12:59:37 +0100 | [diff] [blame] | 63 | } |