return zrtp_status_bad_param; \
}
-/*----------------------------------------------------------------------------*/
zrtp_status_t zrtp_def_cache_init(zrtp_global_t* a_zrtp)
{
zrtp_status_t s = zrtp_status_ok;
}
}
-/*----------------------------------------------------------------------------*/
+
zrtp_status_t zrtp_def_cache_set_verified( const zrtp_stringn_t* one_ZID,
const zrtp_stringn_t* another_ZID,
uint32_t verified)
new_elem = get_elem(id, 0);
if (new_elem) {
new_elem->verified = verified;
- }
+ }
zrtp_mutex_unlock(def_cache_protector);
return (new_elem) ? zrtp_status_ok : zrtp_status_fail;
}
-/*----------------------------------------------------------------------------*/
static zrtp_status_t cache_put( const zrtp_stringn_t* one_ZID,
const zrtp_stringn_t* another_ZID,
zrtp_shared_secret_t *rss,
}
-/*----------------------------------------------------------------------------*/
static zrtp_status_t cache_get( const zrtp_stringn_t* one_ZID,
const zrtp_stringn_t* another_ZID,
zrtp_shared_secret_t *rss,
return cache_get(one_ZID, another_ZID, rss, 0, 1);
}
-/*-----------------------------------------------------------------------------*/
zrtp_status_t zrtp_def_cache_set_presh_counter( const zrtp_stringn_t* one_zid,
const zrtp_stringn_t* another_zid,
uint32_t counter)
return (new_elem) ? zrtp_status_ok : zrtp_status_fail;
}
-/*-----------------------------------------------------------------------------*/
void zrtp_cache_create_id( const zrtp_stringn_t* first_ZID,
const zrtp_stringn_t* second_ZID,
zrtp_cache_id_t id )
zrtp_memcpy((char*)id+sizeof(zrtp_zid_t), second_ZID->buffer, sizeof(zrtp_zid_t));
}
-/*-----------------------------------------------------------------------------*/
zrtp_cache_elem_t* zrtp_def_cache_get2(const zrtp_cache_id_t id, int is_mitm)
{
return get_elem(id, is_mitm);
}
-/*-----------------------------------------------------------------------------*/
+
static zrtp_cache_elem_t* get_elem(const zrtp_cache_id_t id, uint8_t is_mitm)
{
mlist_t* node = NULL;
return NULL;
}
-/*----------------------------------------------------------------------------*/
static void cache_make_cross(zrtp_cache_elem_t* from, zrtp_cache_elem_t* to, uint8_t is_upload)
{
if (!to) {
return s;
}
-/*---------------------------------------------------------------------------*/
+
#define ZRTP_DOWN_CACHE_RETURN(s, f) \
{\
if (zrtp_status_ok != s) { \