Check for errors allocating the error strings.
[openssl.git] / crypto / ct / ct_err.c
1 /*
2  * Generated by util/mkerr.pl DO NOT EDIT
3  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4  *
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
9  */
10
11 #include <stdio.h>
12 #include <openssl/err.h>
13 #include <openssl/ct.h>
14
15 /* BEGIN ERROR CODES */
16 #ifndef OPENSSL_NO_ERR
17
18 # define ERR_FUNC(func) ERR_PACK(ERR_LIB_CT,func,0)
19 # define ERR_REASON(reason) ERR_PACK(ERR_LIB_CT,0,reason)
20
21 static ERR_STRING_DATA CT_str_functs[] = {
22     {ERR_FUNC(CT_F_CTLOG_NEW), "CTLOG_new"},
23     {ERR_FUNC(CT_F_CTLOG_NEW_FROM_BASE64), "CTLOG_new_from_base64"},
24     {ERR_FUNC(CT_F_CTLOG_NEW_FROM_CONF), "ctlog_new_from_conf"},
25     {ERR_FUNC(CT_F_CTLOG_NEW_NULL), "CTLOG_new_null"},
26     {ERR_FUNC(CT_F_CTLOG_STORE_LOAD_CTX_NEW), "ctlog_store_load_ctx_new"},
27     {ERR_FUNC(CT_F_CTLOG_STORE_LOAD_FILE), "CTLOG_STORE_load_file"},
28     {ERR_FUNC(CT_F_CTLOG_STORE_LOAD_LOG), "ctlog_store_load_log"},
29     {ERR_FUNC(CT_F_CTLOG_STORE_NEW), "CTLOG_STORE_new"},
30     {ERR_FUNC(CT_F_CT_BASE64_DECODE), "ct_base64_decode"},
31     {ERR_FUNC(CT_F_CT_POLICY_EVAL_CTX_NEW), "CT_POLICY_EVAL_CTX_new"},
32     {ERR_FUNC(CT_F_CT_V1_LOG_ID_FROM_PKEY), "ct_v1_log_id_from_pkey"},
33     {ERR_FUNC(CT_F_I2O_SCT), "i2o_SCT"},
34     {ERR_FUNC(CT_F_I2O_SCT_LIST), "i2o_SCT_LIST"},
35     {ERR_FUNC(CT_F_I2O_SCT_SIGNATURE), "i2o_SCT_signature"},
36     {ERR_FUNC(CT_F_O2I_SCT), "o2i_SCT"},
37     {ERR_FUNC(CT_F_O2I_SCT_LIST), "o2i_SCT_LIST"},
38     {ERR_FUNC(CT_F_O2I_SCT_SIGNATURE), "o2i_SCT_signature"},
39     {ERR_FUNC(CT_F_SCT_CTX_NEW), "SCT_CTX_new"},
40     {ERR_FUNC(CT_F_SCT_NEW), "SCT_new"},
41     {ERR_FUNC(CT_F_SCT_NEW_FROM_BASE64), "SCT_new_from_base64"},
42     {ERR_FUNC(CT_F_SCT_SET0_LOG_ID), "SCT_set0_log_id"},
43     {ERR_FUNC(CT_F_SCT_SET1_EXTENSIONS), "SCT_set1_extensions"},
44     {ERR_FUNC(CT_F_SCT_SET1_LOG_ID), "SCT_set1_log_id"},
45     {ERR_FUNC(CT_F_SCT_SET1_SIGNATURE), "SCT_set1_signature"},
46     {ERR_FUNC(CT_F_SCT_SET_LOG_ENTRY_TYPE), "SCT_set_log_entry_type"},
47     {ERR_FUNC(CT_F_SCT_SET_SIGNATURE_NID), "SCT_set_signature_nid"},
48     {ERR_FUNC(CT_F_SCT_SET_VERSION), "SCT_set_version"},
49     {ERR_FUNC(CT_F_SCT_VERIFY), "SCT_verify"},
50     {ERR_FUNC(CT_F_SCT_VERIFY_V1), "SCT_verify_v1"},
51     {0, NULL}
52 };
53
54 static ERR_STRING_DATA CT_str_reasons[] = {
55     {ERR_REASON(CT_R_BASE64_DECODE_ERROR), "base64 decode error"},
56     {ERR_REASON(CT_R_INVALID_LOG_ID_LENGTH), "invalid log id length"},
57     {ERR_REASON(CT_R_LOG_CONF_INVALID), "log conf invalid"},
58     {ERR_REASON(CT_R_LOG_CONF_INVALID_KEY), "log conf invalid key"},
59     {ERR_REASON(CT_R_LOG_CONF_MISSING_DESCRIPTION),
60      "log conf missing description"},
61     {ERR_REASON(CT_R_LOG_CONF_MISSING_KEY), "log conf missing key"},
62     {ERR_REASON(CT_R_LOG_KEY_INVALID), "log key invalid"},
63     {ERR_REASON(CT_R_SCT_INVALID), "sct invalid"},
64     {ERR_REASON(CT_R_SCT_INVALID_SIGNATURE), "sct invalid signature"},
65     {ERR_REASON(CT_R_SCT_LIST_INVALID), "sct list invalid"},
66     {ERR_REASON(CT_R_SCT_LOG_ID_MISMATCH), "sct log id mismatch"},
67     {ERR_REASON(CT_R_SCT_NOT_SET), "sct not set"},
68     {ERR_REASON(CT_R_SCT_UNSUPPORTED_VERSION), "sct unsupported version"},
69     {ERR_REASON(CT_R_UNRECOGNIZED_SIGNATURE_NID),
70      "unrecognized signature nid"},
71     {ERR_REASON(CT_R_UNSUPPORTED_ENTRY_TYPE), "unsupported entry type"},
72     {ERR_REASON(CT_R_UNSUPPORTED_VERSION), "unsupported version"},
73     {0, NULL}
74 };
75
76 #endif
77
78 int ERR_load_CT_strings(void)
79 {
80 #ifndef OPENSSL_NO_ERR
81
82     if (ERR_func_error_string(CT_str_functs[0].error) == NULL) {
83         ERR_load_strings(0, CT_str_functs);
84         ERR_load_strings(0, CT_str_reasons);
85     }
86 #endif
87     return 1;
88 }