chunk 5 of CMP contribution to OpenSSL
[openssl.git] / crypto / cmp / cmp_err.c
1 /*
2  * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
3  * Copyright Nokia 2007-2019
4  * Copyright Siemens AG 2015-2019
5  *
6  * Licensed under the Apache License 2.0 (the "License").  You may not use
7  * this file except in compliance with the License.  You can obtain a copy
8  * in the file LICENSE in the source distribution or at
9  * https://www.openssl.org/source/license.html
10  */
11
12 #include <openssl/err.h>
13 #include <openssl/cmperr.h>
14
15 #ifndef OPENSSL_NO_ERR
16
17 static const ERR_STRING_DATA CMP_str_reasons[] = {
18     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PARSING_PKISTATUS),
19     "error parsing pkistatus"},
20     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILURE_OBTAINING_RANDOM),
21     "failure obtaining random"},
22     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_ARGS), "invalid args"},
23     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_SAN_SOURCES),
24     "multiple san sources"},
25     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_SENDER_IDENTIFICATION),
26     "missing sender identification"},
27     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NO_STDIO), "no stdio"},
28     {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NULL_ARGUMENT), "null argument"},
29     {0, NULL}
30 };
31
32 #endif
33
34 int ERR_load_CMP_strings(void)
35 {
36 #ifndef OPENSSL_NO_ERR
37     if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
38         ERR_load_strings_const(CMP_str_reasons);
39 #endif
40     return 1;
41 }