]>
Commit | Line | Data |
---|---|---|
b6cff313 | 1 | /* |
52df25cf RS |
2 | * Generated by util/mkerr.pl DO NOT EDIT |
3 | * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. | |
408f9065 | 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 | |
408f9065 DSH |
9 | */ |
10 | ||
408f9065 DSH |
11 | #include <openssl/err.h> |
12 | #include "e_capi_err.h" | |
13 | ||
408f9065 DSH |
14 | #ifndef OPENSSL_NO_ERR |
15 | ||
0f113f3e | 16 | static ERR_STRING_DATA CAPI_str_functs[] = { |
52df25cf RS |
17 | {ERR_PACK(0, CAPI_F_CAPI_CERT_GET_FNAME, 0), "capi_cert_get_fname"}, |
18 | {ERR_PACK(0, CAPI_F_CAPI_CTRL, 0), "capi_ctrl"}, | |
19 | {ERR_PACK(0, CAPI_F_CAPI_CTX_NEW, 0), "capi_ctx_new"}, | |
20 | {ERR_PACK(0, CAPI_F_CAPI_CTX_SET_PROVNAME, 0), "capi_ctx_set_provname"}, | |
21 | {ERR_PACK(0, CAPI_F_CAPI_DSA_DO_SIGN, 0), "capi_dsa_do_sign"}, | |
22 | {ERR_PACK(0, CAPI_F_CAPI_GET_KEY, 0), "capi_get_key"}, | |
23 | {ERR_PACK(0, CAPI_F_CAPI_GET_PKEY, 0), "capi_get_pkey"}, | |
24 | {ERR_PACK(0, CAPI_F_CAPI_GET_PROVNAME, 0), "capi_get_provname"}, | |
25 | {ERR_PACK(0, CAPI_F_CAPI_GET_PROV_INFO, 0), "capi_get_prov_info"}, | |
26 | {ERR_PACK(0, CAPI_F_CAPI_INIT, 0), "capi_init"}, | |
27 | {ERR_PACK(0, CAPI_F_CAPI_LIST_CONTAINERS, 0), "capi_list_containers"}, | |
28 | {ERR_PACK(0, CAPI_F_CAPI_LOAD_PRIVKEY, 0), "capi_load_privkey"}, | |
29 | {ERR_PACK(0, CAPI_F_CAPI_OPEN_STORE, 0), "capi_open_store"}, | |
30 | {ERR_PACK(0, CAPI_F_CAPI_RSA_PRIV_DEC, 0), "capi_rsa_priv_dec"}, | |
31 | {ERR_PACK(0, CAPI_F_CAPI_RSA_PRIV_ENC, 0), "capi_rsa_priv_enc"}, | |
32 | {ERR_PACK(0, CAPI_F_CAPI_RSA_SIGN, 0), "capi_rsa_sign"}, | |
33 | {ERR_PACK(0, CAPI_F_CAPI_VTRACE, 0), "capi_vtrace"}, | |
34 | {ERR_PACK(0, CAPI_F_CERT_SELECT_DIALOG, 0), "cert_select_dialog"}, | |
5816586b | 35 | {ERR_PACK(0, CAPI_F_CLIENT_CERT_SELECT, 0), ""}, |
52df25cf | 36 | {ERR_PACK(0, CAPI_F_WIDE_TO_ASC, 0), "wide_to_asc"}, |
0f113f3e MC |
37 | {0, NULL} |
38 | }; | |
39 | ||
40 | static ERR_STRING_DATA CAPI_str_reasons[] = { | |
52df25cf RS |
41 | {ERR_PACK(0, 0, CAPI_R_CANT_CREATE_HASH_OBJECT), "cant create hash object"}, |
42 | {ERR_PACK(0, 0, CAPI_R_CANT_FIND_CAPI_CONTEXT), "cant find capi context"}, | |
43 | {ERR_PACK(0, 0, CAPI_R_CANT_GET_KEY), "cant get key"}, | |
44 | {ERR_PACK(0, 0, CAPI_R_CANT_SET_HASH_VALUE), "cant set hash value"}, | |
45 | {ERR_PACK(0, 0, CAPI_R_CRYPTACQUIRECONTEXT_ERROR), | |
46 | "cryptacquirecontext error"}, | |
47 | {ERR_PACK(0, 0, CAPI_R_CRYPTENUMPROVIDERS_ERROR), | |
48 | "cryptenumproviders error"}, | |
49 | {ERR_PACK(0, 0, CAPI_R_DECRYPT_ERROR), "decrypt error"}, | |
50 | {ERR_PACK(0, 0, CAPI_R_ENGINE_NOT_INITIALIZED), "engine not initialized"}, | |
51 | {ERR_PACK(0, 0, CAPI_R_ENUMCONTAINERS_ERROR), "enumcontainers error"}, | |
52 | {ERR_PACK(0, 0, CAPI_R_ERROR_ADDING_CERT), "error adding cert"}, | |
53 | {ERR_PACK(0, 0, CAPI_R_ERROR_CREATING_STORE), "error creating store"}, | |
54 | {ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_FRIENDLY_NAME), | |
55 | "error getting friendly name"}, | |
56 | {ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO), | |
57 | "error getting key provider info"}, | |
58 | {ERR_PACK(0, 0, CAPI_R_ERROR_OPENING_STORE), "error opening store"}, | |
59 | {ERR_PACK(0, 0, CAPI_R_ERROR_SIGNING_HASH), "error signing hash"}, | |
60 | {ERR_PACK(0, 0, CAPI_R_FILE_OPEN_ERROR), "file open error"}, | |
61 | {ERR_PACK(0, 0, CAPI_R_FUNCTION_NOT_SUPPORTED), "function not supported"}, | |
62 | {ERR_PACK(0, 0, CAPI_R_GETUSERKEY_ERROR), "getuserkey error"}, | |
63 | {ERR_PACK(0, 0, CAPI_R_INVALID_DIGEST_LENGTH), "invalid digest length"}, | |
64 | {ERR_PACK(0, 0, CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), | |
65 | "invalid dsa public key blob magic number"}, | |
66 | {ERR_PACK(0, 0, CAPI_R_INVALID_LOOKUP_METHOD), "invalid lookup method"}, | |
67 | {ERR_PACK(0, 0, CAPI_R_INVALID_PUBLIC_KEY_BLOB), "invalid public key blob"}, | |
68 | {ERR_PACK(0, 0, CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), | |
69 | "invalid rsa public key blob magic number"}, | |
70 | {ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_ERROR), "pubkey export error"}, | |
71 | {ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR), | |
72 | "pubkey export length error"}, | |
73 | {ERR_PACK(0, 0, CAPI_R_UNKNOWN_COMMAND), "unknown command"}, | |
74 | {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_ALGORITHM_NID), | |
75 | "unsupported algorithm nid"}, | |
76 | {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PADDING), "unsupported padding"}, | |
77 | {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM), | |
78 | "unsupported public key algorithm"}, | |
79 | {ERR_PACK(0, 0, CAPI_R_WIN32_ERROR), "win32 error"}, | |
0f113f3e MC |
80 | {0, NULL} |
81 | }; | |
408f9065 DSH |
82 | |
83 | #endif | |
84 | ||
52df25cf RS |
85 | static int lib_code = 0; |
86 | static int error_loaded = 0; | |
408f9065 | 87 | |
52df25cf | 88 | static int ERR_load_CAPI_strings(void) |
0f113f3e | 89 | { |
52df25cf RS |
90 | if (lib_code == 0) |
91 | lib_code = ERR_get_next_error_library(); | |
408f9065 | 92 | |
52df25cf | 93 | if (!error_loaded) { |
408f9065 | 94 | #ifndef OPENSSL_NO_ERR |
52df25cf RS |
95 | ERR_load_strings(lib_code, CAPI_str_functs); |
96 | ERR_load_strings(lib_code, CAPI_str_reasons); | |
408f9065 | 97 | #endif |
52df25cf | 98 | error_loaded = 1; |
0f113f3e | 99 | } |
52df25cf | 100 | return 1; |
0f113f3e | 101 | } |
408f9065 DSH |
102 | |
103 | static void ERR_unload_CAPI_strings(void) | |
0f113f3e | 104 | { |
52df25cf | 105 | if (error_loaded) { |
408f9065 | 106 | #ifndef OPENSSL_NO_ERR |
52df25cf RS |
107 | ERR_unload_strings(lib_code, CAPI_str_functs); |
108 | ERR_unload_strings(lib_code, CAPI_str_reasons); | |
408f9065 | 109 | #endif |
52df25cf | 110 | error_loaded = 0; |
0f113f3e MC |
111 | } |
112 | } | |
408f9065 DSH |
113 | |
114 | static void ERR_CAPI_error(int function, int reason, char *file, int line) | |
0f113f3e | 115 | { |
52df25cf RS |
116 | if (lib_code == 0) |
117 | lib_code = ERR_get_next_error_library(); | |
118 | ERR_PUT_error(lib_code, function, reason, file, line); | |
0f113f3e | 119 | } |