1 #ifndef __DIGI_DOC_ERROR_H__ 2 #define __DIGI_DOC_ERROR_H__ 34 #define ERR_UNSUPPORTED_DIGEST 1 35 #define ERR_FILE_READ 2 36 #define ERR_FILE_WRITE 3 37 #define ERR_DIGEST_LEN 4 39 #define ERR_SIGNATURE_LEN 6 40 #define ERR_PRIVKEY_READ 7 41 #define ERR_PUBKEY_READ 8 42 #define ERR_CERT_READ 9 43 #define ERR_SIGNEDINFO_CREATE 10 44 #define ERR_SIGNEDINFO_DATA 11 45 #define ERR_SIGNEDINFO_FINAL 12 46 #define ERR_UNSUPPORTED_FORMAT 13 47 #define ERR_BAD_INDEX 14 48 #define ERR_TIMESTAMP_DECODE 15 49 #define ERR_DIGIDOC_PARSE 16 50 #define ERR_UNSUPPORTED_SIGNATURE 17 51 #define ERR_CERT_STORE_READ 18 52 #define ERR_SIGPROP_DIGEST 19 53 #define ERR_COMPARE 20 54 #define ERR_DOC_DIGEST 21 55 #define ERR_MIME_DIGEST 22 56 #define ERR_SIGNATURE 23 57 #define ERR_CERT_INVALID 24 58 #define ERR_OCSP_UNSUCCESSFUL 25 59 #define ERR_OCSP_UNKNOWN_TYPE 26 60 #define ERR_OCSP_NO_BASIC_RESP 27 61 #define ERR_OCSP_WRONG_VERSION 28 62 #define ERR_OCSP_WRONG_RESPID 29 63 #define ERR_OCSP_ONE_RESPONSE 30 64 #define ERR_OCSP_RESP_STATUS 31 65 #define ERR_OCSP_NO_SINGLE_EXT 32 66 #define ERR_OCSP_NO_NONCE 33 67 #define ERR_NOTARY_NO_SIGNATURE 34 68 #define ERR_NOTARY_SIG_MATCH 35 69 #define ERR_SIGNERS_CERT_NOT_TRUSTED 36 71 #define ERR_WRONG_CERT 37 72 #define ERR_NULL_POINTER 38 73 #define ERR_NULL_CERT_POINTER 39 74 #define ERR_NULL_SER_NUM_POINTER 40 75 #define ERR_NULL_KEY_POINTER 41 76 #define ERR_EMPTY_STRING 42 77 #define ERR_BAD_DATAFILE_INDEX 43 78 #define ERR_BAD_DATAFILE_COUNT 44 79 #define ERR_BAD_ATTR_COUNT 45 80 #define ERR_BAD_ATTR_INDEX 46 81 #define ERR_BAD_SIG_INDEX 47 82 #define ERR_BAD_SIG_COUNT 48 83 #define ERR_BAD_ROLE_INDEX 49 84 #define ERR_BAD_DOCINFO_COUNT 50 85 #define ERR_BAD_DOCINFO_INDEX 51 86 #define ERR_BAD_NOTARY_INDEX 52 87 #define ERR_BAD_NOTARY_ID 53 88 #define ERR_BAD_NOTARY_COUNT 54 89 #define ERR_X509_DIGEST 55 90 #define ERR_CERT_LENGTH 56 91 #define ERR_PKCS_LIB_LOAD 57 92 #define ERR_PKCS_SLOT_LIST 58 93 #define ERR_PKCS_WRONG_SLOT 59 94 #define ERR_PKCS_LOGIN 60 95 #define ERR_PKCS_PK 61 96 #define ERR_PKCS_CERT_LOC 62 97 #define ERR_PKCS_CERT_DECODE 63 98 #define ERR_PKCS_SIGN_DATA 64 99 #define ERR_PKCS_CARD_READ 65 100 #define ERR_CSP_NO_CARD_DATA 66 101 #define ERR_CSP_OPEN_STORE 67 102 #define ERR_CSP_CERT_FOUND 68 103 #define ERR_CSP_SIGN 69 104 #define ERR_CSP_NO_HASH_START 70 105 #define ERR_CSP_NO_HASH 71 106 #define ERR_CSP_NO_HASH_RESULT 72 107 #define ERR_CSP_OPEN_KEY 73 108 #define ERR_CSP_READ_KEY 74 109 #define ERR_OCSP_SIGN_NOT_SUPPORTED 75 110 #define ERR_OCSP_SIGN_CSP_NAME 76 111 #define ERR_CSP_CERT_DECODE 77 112 #define ERR_OCSP_SIGN_PKCS_NAME 78 113 #define ERR_OCSP_SIGN_OSLL_CERT 79 114 #define ERR_OCSP_SIGN 80 115 #define ERR_CERT_ISSUER 81 116 #define ERR_OCSP_PKCS12_CONTAINER 82 117 #define ERR_MODIFY_SIGNED_DOC 83 118 #define ERR_NOTARY_EXISTS 84 119 #define ERR_UNSUPPORTED_CERT_SEARCH 85 120 #define ERR_INCORRECT_CERT_SEARCH 86 121 #define ERR_BAD_OCSP_RESPONSE_DIGEST 87 122 #define ERR_LAST_ESTID_CACHED 88 123 #define ERR_BAD_DATAFILE_XML 89 124 #define ERR_UNSUPPORTED_VERSION 90 125 #define ERR_UNSUPPORTED_CHARSET 91 126 #define ERR_PKCS12_EXPIRED 92 127 #define ERR_CSP_USER_CANCEL 93 128 #define ERR_CSP_NODEFKEY_CONTAINER 94 129 #define ERR_CONNECTION_FAILURE 95 130 #define ERR_WRONG_URL_OR_PROXY 96 131 #define ERR_NULL_PARAM 97 132 #define ERR_BAD_ALLOC 98 133 #define ERR_CONF_FILE 99 134 #define ERR_CONF_LINE 100 135 #define ERR_OCSP_CERT_REVOKED 101 136 #define ERR_OCSP_CERT_UNKNOWN 102 137 #define ERR_OCSP_PKCS12_NO_FILE 103 138 #define ERR_OCSP_PKCS12_NO_PASSWD 104 139 #define ERR_BAD_DATAFILE_CONTENT_TYPE 105 140 #define ERR_OCSP_WRONG_URL 106 141 #define ERR_OCSP_MALFORMED 107 142 #define ERR_OCSP_INTERNALERR 108 143 #define ERR_OCSP_TRYLATER 109 144 #define ERR_OCSP_SIGREQUIRED 110 145 #define ERR_OCSP_UNAUTHORIZED 111 146 #define ERR_UNKNOWN_CA 112 148 #define ERR_DENC_ENC_METHOD 113 149 #define ERR_DENC_ENC_XMLNS 114 150 #define ERR_DENC_BAD_PROP_IDX 115 151 #define ERR_DENC_BAD_KEY_IDX 116 152 #define ERR_DENC_KEY_STATUS 117 153 #define ERR_DENC_DATA_STATUS 118 154 #define ERR_DENC_DECRYPT 119 155 #define ERR_CHARSET_CONVERT 120 156 #define ERR_COMPRESS 121 157 #define ERR_DECOMPRESS 122 158 #define ERR_OCSP_CERT_NOTFOUND 123 159 #define ERR_INVALID_CONTENT 124 160 #define ERR_DENC_NO_KEY_FOUND 125 161 #define ERR_OCSP_RESP_NOT_TRUSTED 126 162 #define ERR_PRIV_CERT_NOT_FOUND 127 163 #define ERR_NO_OCSP 128 164 #define ERR_OCSP_WRONG_SIGNATURE 129 165 #define ERR_BAD_PARAM 130 166 #define ERR_GENERIC_SOAP_ERR 131 168 #define ERR_TS_TIMESTAMPINFO_TYPE 132 169 #define ERR_TS_BAD_INCLUDEINFO_IDX 133 170 #define ERR_TS_BAD_TIMESTAMPINFO_IDX 134 171 #define ERR_TS_CREATE_TS_REQ 135 172 #define ERR_CREATE_NONCE 136 173 #define ERR_TXT2OID 137 174 #define ERR_HTTP_ERR 138 176 #define ERR_BAD_CERTID_IDX 139 177 #define ERR_BAD_CERTVALUE_IDX 140 178 #define ERR_TS_VERIFY 141 179 #define ERR_TS_REQUEST 142 180 #define ERR_TSA_NOT_TRUSTED 143 181 #define ERR_ORPHONED_SIGNATURE 144 183 #define ERR_WPKI_UNKNOWN_USER 145 184 #define ERR_WPKI_INVALID_PHONE_NO 146 185 #define ERR_WPKI_UNTRUSTED_SRVICE 147 186 #define ERR_WPKI_UNTRUSTED_USER 148 188 #define ERR_WPKI_UNUSABLE_PHONE 149 189 #define ERR_WPKI_TIMEOUT 150 190 #define ERR_WPKI_CANCELLED 151 191 #define ERR_WPKI_MID_NOT_READY 152 192 #define ERR_WPKI_PHONE_NOT_REACHABLE 153 193 #define ERR_WPKI_SENDING_ERROR 154 194 #define ERR_WPKI_SIM_ERROR 155 195 #define ERR_WPKI_SERVICE_ERR 156 197 #define ERR_ZIP_FILE_READ 157 199 #define ERR_MANIFEST 159 200 #define ERR_DATAFILE_NOT_MANIFEST 160 201 #define ERR_SIG_INVALID_PROFILE 161 202 #define ERR_SIGNERS_CERT_NON_REPU 162 203 #define ERR_OCSP_NONCE_SIGVAL_NOMATCH 163 204 #define ERR_VALIDATE 164 205 #define ERR_OCSP_NONCE_INVALID 165 206 #define ERR_SIGVAL_ASN1 166 207 #define ERR_MAX_1_ROLES 167 208 #define ERR_DF_NAME 168 209 #define ERR_DF_WRONG_DIG 169 210 #define ERR_ISSUER_XMLNS 170 211 #define ERR_OLD_VERSION 171 212 #define ERR_TEST_SIGNATURE 172 213 #define ERR_UNKNOWN_ERROR 173 214 #define ERR_TRANSFORM_UNSUPPORTED 174 215 #define ERR_NETWORK_SYNC 175 216 #define ERR_XML_VALIDATION 176 218 #define ERROR_BUF_LENGTH 20 226 typedef int ErrorClass;
249 extern CRITICAL_SECTION cs_ddocErrors;
253 EXP_OPTION
long checkErrors();
256 EXP_OPTION
char* getErrorString(
int code);
259 EXP_OPTION ErrorClass getErrorClass(
int code);
262 EXP_OPTION
ErrorInfo* getErrorInfo(
void);
265 EXP_OPTION
int hasUnreadErrors(
void);
268 EXP_OPTION
void clearErrors(
void);
270 EXP_OPTION
void addError(
int code,
char *fileName,
int line,
char *assertion);
272 EXP_OPTION
int checkDigiDocErrors(
void);
274 EXP_OPTION
int getLastError();
277 EXP_OPTION
int getLastErrorsIdx();
281 EXP_OPTION
ErrorInfo* getErrorsInfo(
int nIdx);
284 EXP_OPTION
int checkUnknownErr();
288 #define SET_LAST_ERROR(code) (addError((code), __FILE__, __LINE__, "")) 289 #define SET_LAST_ERROR_IF_NOT(expr, code) { if(!(expr)) addError((code), __FILE__, __LINE__, #expr); } 290 #define SET_LAST_ERROR_RETURN(code, retVal) { SET_LAST_ERROR(code); return (retVal); } 291 #define SET_LAST_ERROR_RETURN_IF_NOT(expr, code, retVal) { if(!(expr)) { addError((code), __FILE__, __LINE__, #expr); return (retVal); } } 292 #define SET_LAST_ERROR_RETURN_VOID_IF_NOT(expr, code) { if(!(expr)) { addError((code), __FILE__, __LINE__, #expr); return; } } 293 #define SET_LAST_ERROR_RETURN_VOID_IF(expr, code) { if(expr) { addError((code), __FILE__, __LINE__, #expr); return; } } 294 #define RETURN_IF_NOT(expr, code) SET_LAST_ERROR_RETURN_IF_NOT((expr), (code), (code)); 295 #define RETURN_IF_NULL(p) RETURN_IF_NOT((p), ERR_NULL_POINTER); 296 #define RETURN_VOID_IF_NULL(p) SET_LAST_ERROR_RETURN_VOID_IF_NOT((p), ERR_NULL_POINTER); 297 #define RETURN_OBJ_IF_NULL(p, obj) SET_LAST_ERROR_RETURN_IF_NOT((p), ERR_NULL_POINTER, (obj)); 298 #define SET_LAST_ERROR_RETURN_CODE(code) { SET_LAST_ERROR(code); return (code); } 299 #define RETURN_IF_NULL_PARAM(p) RETURN_IF_NOT((p), ERR_NULL_PARAM); 300 #define RETURN_IF_BAD_ALLOC(p) RETURN_IF_NOT((p), ERR_BAD_ALLOC) 301 #define RETURN_VOID_IF_BAD_ALLOC(p) SET_LAST_ERROR_RETURN_VOID_IF_NOT((p), ERR_BAD_ALLOC); Definition: DigiDocError.h:221
Definition: DigiDocError.h:241