Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | #include <openssl/err.h> | - |
12 | #include "internal/sm2err.h" | - |
13 | | - |
14 | #ifndef OPENSSL_NO_ERR | - |
15 | | - |
16 | static const ERR_STRING_DATA SM2_str_functs[] = { | - |
17 | {ERR_PACK(ERR_LIB_SM2, SM2_F_PKEY_SM2_COPY, 0), "pkey_sm2_copy"}, | - |
18 | {ERR_PACK(ERR_LIB_SM2, SM2_F_PKEY_SM2_CTRL, 0), "pkey_sm2_ctrl"}, | - |
19 | {ERR_PACK(ERR_LIB_SM2, SM2_F_PKEY_SM2_CTRL_STR, 0), "pkey_sm2_ctrl_str"}, | - |
20 | {ERR_PACK(ERR_LIB_SM2, SM2_F_PKEY_SM2_DIGEST_CUSTOM, 0), | - |
21 | "pkey_sm2_digest_custom"}, | - |
22 | {ERR_PACK(ERR_LIB_SM2, SM2_F_PKEY_SM2_INIT, 0), "pkey_sm2_init"}, | - |
23 | {ERR_PACK(ERR_LIB_SM2, SM2_F_PKEY_SM2_SIGN, 0), "pkey_sm2_sign"}, | - |
24 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_COMPUTE_MSG_HASH, 0), | - |
25 | "sm2_compute_msg_hash"}, | - |
26 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_COMPUTE_USERID_DIGEST, 0), | - |
27 | "sm2_compute_userid_digest"}, | - |
28 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_COMPUTE_Z_DIGEST, 0), | - |
29 | "sm2_compute_z_digest"}, | - |
30 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_DECRYPT, 0), "sm2_decrypt"}, | - |
31 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_ENCRYPT, 0), "sm2_encrypt"}, | - |
32 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_PLAINTEXT_SIZE, 0), "sm2_plaintext_size"}, | - |
33 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_SIGN, 0), "sm2_sign"}, | - |
34 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_SIG_GEN, 0), "sm2_sig_gen"}, | - |
35 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_SIG_VERIFY, 0), "sm2_sig_verify"}, | - |
36 | {ERR_PACK(ERR_LIB_SM2, SM2_F_SM2_VERIFY, 0), "sm2_verify"}, | - |
37 | {0, NULL} | - |
38 | }; | - |
39 | | - |
40 | static const ERR_STRING_DATA SM2_str_reasons[] = { | - |
41 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ASN1_ERROR), "asn1 error"}, | - |
42 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_BAD_SIGNATURE), "bad signature"}, | - |
43 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_BUFFER_TOO_SMALL), "buffer too small"}, | - |
44 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_DIST_ID_TOO_LARGE), "dist id too large"}, | - |
45 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ID_NOT_SET), "id not set"}, | - |
46 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_ID_TOO_LARGE), "id too large"}, | - |
47 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_CURVE), "invalid curve"}, | - |
48 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_DIGEST), "invalid digest"}, | - |
49 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_DIGEST_TYPE), | - |
50 | "invalid digest type"}, | - |
51 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_ENCODING), "invalid encoding"}, | - |
52 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_INVALID_FIELD), "invalid field"}, | - |
53 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_NO_PARAMETERS_SET), "no parameters set"}, | - |
54 | {ERR_PACK(ERR_LIB_SM2, 0, SM2_R_USER_ID_TOO_LARGE), "user id too large"}, | - |
55 | {0, NULL} | - |
56 | }; | - |
57 | | - |
58 | #endif | - |
59 | | - |
60 | int ERR_load_SM2_strings(void) | - |
61 | { | - |
62 | #ifndef OPENSSL_NO_ERR | - |
63 | if (ERR_func_error_string(SM2_str_functs[0].error) == NULL) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
64 | ERR_load_strings_const(SM2_str_functs); | - |
65 | ERR_load_strings_const(SM2_str_reasons); | - |
66 | } never executed: end of block | 0 |
67 | #endif | - |
68 | return 1; never executed: return 1; | 0 |
69 | } | - |
| | |