1 /*
2 * Generated by util/mkerr.pl DO NOT EDIT
3 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
4 *
5 * Licensed under the Apache License 2.0 (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 <openssl/err.h>
12 #include "crypto/sm2err.h"
13
14 #ifndef OPENSSL_NO_SM2
15
16 # ifndef OPENSSL_NO_ERR
17
18 static const ERR_STRING_DATA SM2_str_reasons[] = {
19 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ASN1_ERROR), "asn1 error"},
20 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_BAD_SIGNATURE), "bad signature"},
21 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_BUFFER_TOO_SMALL), "buffer too small"},
22 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_DIST_ID_TOO_LARGE), "dist id too large"},
23 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ID_NOT_SET), "id not set"},
24 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ID_TOO_LARGE), "id too large"},
25 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_CURVE), "invalid curve"},
26 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_DIGEST), "invalid digest"},
27 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_DIGEST_TYPE),
28 "invalid digest type"},
29 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_ENCODING), "invalid encoding"},
30 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_FIELD), "invalid field"},
31 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_PRIVATE_KEY),
32 "invalid private key"},
33 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_NO_PARAMETERS_SET), "no parameters set"},
34 {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_USER_ID_TOO_LARGE), "user id too large"},
35 {0, NULL}
36 };
37
38 # endif
39
ossl_err_load_SM2_strings(void)40 int ossl_err_load_SM2_strings(void)
41 {
42 # ifndef OPENSSL_NO_ERR
43 if (ERR_reason_error_string(SM2_str_reasons[0].error) == NULL)
44 ERR_load_strings_const(SM2_str_reasons);
45 # endif
46 return 1;
47 }
48 #else
49 NON_EMPTY_TRANSLATION_UNIT
50 #endif
51