]> git.ipfire.org Git - thirdparty/openssl.git/blame - engines/e_ossltest_err.c
Create provider errors and use them
[thirdparty/openssl.git] / engines / e_ossltest_err.c
CommitLineData
b6cff313 1/*
52df25cf
RS
2 * Generated by util/mkerr.pl DO NOT EDIT
3 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
2d5d70b1 4 *
ab3fa1c0 5 * Licensed under the Apache License 2.0 (the "License"). You may not use
b6cff313
RS
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
2d5d70b1
MC
9 */
10
2d5d70b1
MC
11#include <openssl/err.h>
12#include "e_ossltest_err.h"
13
2d5d70b1
MC
14#ifndef OPENSSL_NO_ERR
15
2d5d70b1 16static ERR_STRING_DATA OSSLTEST_str_functs[] = {
52df25cf 17 {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"},
5816586b 18 {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0), ""},
2d5d70b1
MC
19 {0, NULL}
20};
21
22static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
52df25cf 23 {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"},
2d5d70b1
MC
24 {0, NULL}
25};
26
27#endif
28
52df25cf
RS
29static int lib_code = 0;
30static int error_loaded = 0;
2d5d70b1 31
52df25cf 32static int ERR_load_OSSLTEST_strings(void)
2d5d70b1 33{
52df25cf
RS
34 if (lib_code == 0)
35 lib_code = ERR_get_next_error_library();
2d5d70b1 36
52df25cf 37 if (!error_loaded) {
2d5d70b1 38#ifndef OPENSSL_NO_ERR
52df25cf
RS
39 ERR_load_strings(lib_code, OSSLTEST_str_functs);
40 ERR_load_strings(lib_code, OSSLTEST_str_reasons);
2d5d70b1 41#endif
52df25cf 42 error_loaded = 1;
2d5d70b1 43 }
52df25cf 44 return 1;
2d5d70b1
MC
45}
46
47static void ERR_unload_OSSLTEST_strings(void)
48{
52df25cf 49 if (error_loaded) {
2d5d70b1 50#ifndef OPENSSL_NO_ERR
52df25cf
RS
51 ERR_unload_strings(lib_code, OSSLTEST_str_functs);
52 ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
2d5d70b1 53#endif
52df25cf 54 error_loaded = 0;
2d5d70b1
MC
55 }
56}
57
58static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
59{
52df25cf
RS
60 if (lib_code == 0)
61 lib_code = ERR_get_next_error_library();
62 ERR_PUT_error(lib_code, function, reason, file, line);
2d5d70b1 63}