00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00016 #ifndef __ZRTP_ERROR_H__
00017 #define __ZRTP_ERROR_H__
00018
00019 #include "zrtp_config.h"
00020
00034 typedef enum zrtp_protocol_error_t
00035 {
00036 zrtp_error_unknown = 0,
00037 zrtp_error_timeout = 1,
00038
00039 zrtp_error_invalid_packet = 0x10,
00040 zrtp_error_software = 0x20,
00041 zrtp_error_version = 0x30,
00042 zrtp_error_hello_mistmatch = 0x40,
00044 zrtp_error_hash_unsp = 0x51,
00045 zrtp_error_cipher_unsp = 0x52,
00046 zrtp_error_pktype_unsp = 0x53,
00047 zrtp_error_auth_unsp = 0x54,
00048 zrtp_error_sas_unsp = 0x55,
00049 zrtp_error_no_secret = 0x56,
00051 zrtp_error_possible_mitm1 = 0x61,
00052 zrtp_error_possible_mitm2 = 0x62,
00053 zrtp_error_possible_mitm3 = 0x63,
00055 zrtp_error_auth_decrypt = 0x70,
00056 zrtp_error_nonse_reuse = 0x80,
00057 zrtp_error_equal_zid = 0x90,
00058 zrtp_error_service_unavail = 0xA0,
00059 zrtp_error_goclear_unsp = 0x100,
00061 zrtp_error_wrong_zid = 0x202,
00062 zrtp_error_wrong_meshmac = 0x203,
00063 zrtp_error_count
00064 } zrtp_protocol_error_t;
00065
00072 typedef enum zrtp_status_t
00073 {
00074 zrtp_status_ok = 0,
00075 zrtp_status_fail = 1,
00076 zrtp_status_bad_param = 2,
00077 zrtp_status_alloc_fail = 3,
00078 zrtp_status_auth_fail = 4,
00079 zrtp_status_cipher_fail = 5,
00080 zrtp_status_algo_fail = 6,
00081 zrtp_status_key_expired = 7,
00082 zrtp_status_buffer_size = 8,
00083 zrtp_status_drop = 9,
00084 zrtp_status_open_fail = 10,
00085 zrtp_status_read_fail = 11,
00086 zrtp_status_write_fail = 12,
00087 zrtp_status_old_pkt = 13,
00088 zrtp_status_rp_fail = 14,
00089 zrtp_status_zrp_fail = 15,
00090 zrtp_status_crc_fail = 16,
00091 zrtp_status_rng_fail = 17,
00092 zrtp_status_wrong_state = 18,
00093 zrtp_status_attack = 19,
00094 zrtp_status_notavailable = 20,
00095 zrtp_status_count = 21
00096 } zrtp_status_t;
00097
00102 #define ZRTP_MIM2_WARNING_STR \
00103 "Possible Man-In-The-Middle-Attack! Switching to state Error\n"\
00104 "because a packet arrived that was ZRTP_DHPART2, but contained\n"\
00105 "a g^y that didn't match the previous ZRTP_COMMIT.\n"
00106
00107 #define ZRTP_MITM1_WARNING_STR "DH validating failed. (pvi is 1 or p-1), aborted\n"
00108
00109 #define ZRTP_VERIFIED_INIT_WARNING_STR \
00110 "Falling back to cleartext because a packet arrived that was\n"\
00111 "ZRTP_CONFIRM1, but which couldn't be verified - the sender must have a different\n"\
00112 "shared secret than we have.\n"
00113
00114 #define ZRTP_VERIFIED_RESP_WARNING_STR \
00115 "Falling back to cleartext because a packet arrived that was ZRTP_CONFIRM2,\n"\
00116 " but which couldn't be verified - the sender must have a different shared secret than we have.\n"
00117
00118 #define ZRTP_EQUAL_ZID_WARNING_STR \
00119 "Received a ZRTP_HELLO packet with the same ZRTP ID that we have.\n"\
00120 " This is likely due to a bug in the software. Ignoring the ZRTP_HELLO\n"\
00121 " packet, therefore this call cannot be encrypted.\n"
00122
00123 #define ZRTP_UNSUPPORTED_COMP_WARNING_STR \
00124 " Received ZRTP_HELLO packet with an algorithms field which had a\n"\
00125 " list of hashes that didn't include any of our supported hashes. Ignoring\n"\
00126 " the ZRTP_HELLO packet, therefore this call cannot be encrypted.\n"
00127
00128 #define ZRTP_NOT_UNIQUE_NONCE_WARNING_STR \
00129 " Received COMMIT with hash value already used in another stream within this ZRTP session\n"
00130
00131 #define ZRTP_RELAYED_SAS_FROM_NONMITM_STR \
00132 " Received SAS Relaying message from endpoint which haven't introduced as MiTM.\n"
00133
00136 #endif