]>
Commit | Line | Data |
---|---|---|
b6cff313 | 1 | /* |
52df25cf | 2 | * Generated by util/mkerr.pl DO NOT EDIT |
cbfa5b03 | 3 | * Copyright 1995-2019 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_reasons[] = { |
52df25cf RS |
17 | {ERR_PACK(0, 0, CAPI_R_CANT_CREATE_HASH_OBJECT), "cant create hash object"}, |
18 | {ERR_PACK(0, 0, CAPI_R_CANT_FIND_CAPI_CONTEXT), "cant find capi context"}, | |
19 | {ERR_PACK(0, 0, CAPI_R_CANT_GET_KEY), "cant get key"}, | |
20 | {ERR_PACK(0, 0, CAPI_R_CANT_SET_HASH_VALUE), "cant set hash value"}, | |
21 | {ERR_PACK(0, 0, CAPI_R_CRYPTACQUIRECONTEXT_ERROR), | |
22 | "cryptacquirecontext error"}, | |
23 | {ERR_PACK(0, 0, CAPI_R_CRYPTENUMPROVIDERS_ERROR), | |
24 | "cryptenumproviders error"}, | |
25 | {ERR_PACK(0, 0, CAPI_R_DECRYPT_ERROR), "decrypt error"}, | |
26 | {ERR_PACK(0, 0, CAPI_R_ENGINE_NOT_INITIALIZED), "engine not initialized"}, | |
27 | {ERR_PACK(0, 0, CAPI_R_ENUMCONTAINERS_ERROR), "enumcontainers error"}, | |
28 | {ERR_PACK(0, 0, CAPI_R_ERROR_ADDING_CERT), "error adding cert"}, | |
29 | {ERR_PACK(0, 0, CAPI_R_ERROR_CREATING_STORE), "error creating store"}, | |
30 | {ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_FRIENDLY_NAME), | |
31 | "error getting friendly name"}, | |
32 | {ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO), | |
33 | "error getting key provider info"}, | |
34 | {ERR_PACK(0, 0, CAPI_R_ERROR_OPENING_STORE), "error opening store"}, | |
35 | {ERR_PACK(0, 0, CAPI_R_ERROR_SIGNING_HASH), "error signing hash"}, | |
36 | {ERR_PACK(0, 0, CAPI_R_FILE_OPEN_ERROR), "file open error"}, | |
37 | {ERR_PACK(0, 0, CAPI_R_FUNCTION_NOT_SUPPORTED), "function not supported"}, | |
38 | {ERR_PACK(0, 0, CAPI_R_GETUSERKEY_ERROR), "getuserkey error"}, | |
39 | {ERR_PACK(0, 0, CAPI_R_INVALID_DIGEST_LENGTH), "invalid digest length"}, | |
40 | {ERR_PACK(0, 0, CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), | |
41 | "invalid dsa public key blob magic number"}, | |
42 | {ERR_PACK(0, 0, CAPI_R_INVALID_LOOKUP_METHOD), "invalid lookup method"}, | |
43 | {ERR_PACK(0, 0, CAPI_R_INVALID_PUBLIC_KEY_BLOB), "invalid public key blob"}, | |
44 | {ERR_PACK(0, 0, CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), | |
45 | "invalid rsa public key blob magic number"}, | |
46 | {ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_ERROR), "pubkey export error"}, | |
47 | {ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR), | |
48 | "pubkey export length error"}, | |
49 | {ERR_PACK(0, 0, CAPI_R_UNKNOWN_COMMAND), "unknown command"}, | |
50 | {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_ALGORITHM_NID), | |
51 | "unsupported algorithm nid"}, | |
52 | {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PADDING), "unsupported padding"}, | |
53 | {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM), | |
54 | "unsupported public key algorithm"}, | |
55 | {ERR_PACK(0, 0, CAPI_R_WIN32_ERROR), "win32 error"}, | |
0f113f3e MC |
56 | {0, NULL} |
57 | }; | |
408f9065 DSH |
58 | |
59 | #endif | |
60 | ||
52df25cf RS |
61 | static int lib_code = 0; |
62 | static int error_loaded = 0; | |
408f9065 | 63 | |
52df25cf | 64 | static int ERR_load_CAPI_strings(void) |
0f113f3e | 65 | { |
52df25cf RS |
66 | if (lib_code == 0) |
67 | lib_code = ERR_get_next_error_library(); | |
408f9065 | 68 | |
52df25cf | 69 | if (!error_loaded) { |
408f9065 | 70 | #ifndef OPENSSL_NO_ERR |
52df25cf | 71 | ERR_load_strings(lib_code, CAPI_str_reasons); |
408f9065 | 72 | #endif |
52df25cf | 73 | error_loaded = 1; |
0f113f3e | 74 | } |
52df25cf | 75 | return 1; |
0f113f3e | 76 | } |
408f9065 DSH |
77 | |
78 | static void ERR_unload_CAPI_strings(void) | |
0f113f3e | 79 | { |
52df25cf | 80 | if (error_loaded) { |
408f9065 | 81 | #ifndef OPENSSL_NO_ERR |
52df25cf | 82 | ERR_unload_strings(lib_code, CAPI_str_reasons); |
408f9065 | 83 | #endif |
52df25cf | 84 | error_loaded = 0; |
0f113f3e MC |
85 | } |
86 | } | |
408f9065 DSH |
87 | |
88 | static void ERR_CAPI_error(int function, int reason, char *file, int line) | |
0f113f3e | 89 | { |
52df25cf RS |
90 | if (lib_code == 0) |
91 | lib_code = ERR_get_next_error_library(); | |
92 | ERR_PUT_error(lib_code, function, reason, file, line); | |
0f113f3e | 93 | } |