zrtp_callback_cache_t Struct Reference
[ZRTP Cache]

Data types and functions related to shared secrets. More...

#include <zrtp_iface.h>


Data Fields

zrtp_status_t(* on_init )(zrtp_global_t *zrtp)
 Cache initialization.
void(* on_down )()
 Cache deinitialization.
zrtp_status_t(* on_put )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss)
 Add/Update cache value.
zrtp_status_t(* on_get )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss, int prev_requested)
 Return secret cache associated with specified pair of ZIDs.
zrtp_status_t(* on_set_verified )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t verified)
 Set/clear cache verification flag.
zrtp_status_t(* on_get_verified )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t *verified)
 Return cache verification flag.
zrtp_status_t(* on_reset_since )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid)
 Should set Secure Since cache aparemeter to current date and time.
zrtp_status_t(* on_put_mitm )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss)
 Add/Update cache value for MiTM endpoint.
zrtp_status_t(* on_get_mitm )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss)
 Return secret cache for MiTM endpoint.
zrtp_status_t(* on_presh_counter_get )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t *counter)
 Return Preshared calls counter.
zrtp_status_t(* on_presh_counter_set )(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t counter)
 Increase/reset Preshared streams counter made between two endpoints (ZIDs).


Detailed Description

Data types and functions related to shared secrets.

Field Documentation

void(* on_down)()

Cache deinitialization.

libzrtp calls this function when zrtp cache is no longer needed at zrtp_down().

See also:
zrtp_callback_cache_t::on_init()

zrtp_status_t(* on_get)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss, int prev_requested)

Return secret cache associated with specified pair of ZIDs.

This function should return the secret associated with the specified pair of ZIDs. In addition to the secret value, TTL (rss->ttl) and cache timestamp (rss->lastused_at) value should be also returned.

Parameters:
one_zid - one side's ZID;
another_zid - the other side's ZID;
prev_requested - if this parameter value is 1, the function should return the previous secret's value. If this parameter value is 0, the function should return the current secret's value;
rss - structure that needs to be filled in.
Returns:
  • zrtp_status_ok - if operation is successful;
  • zrtp_status_fail - if the secret cannot be found;
  • some error code from zrtp_status_t if an error occurred.
See also:
zrtp_callback_cache_t::on_put

zrtp_status_t(* on_get_mitm)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss)

Return secret cache for MiTM endpoint.

This function is analogy to zrtp_callback_cache_t::on_get but for MiTM endpoint.

Todo:
Add more detail description
See also:
zrtp_callback_cache_t::on_get zrtp_callback_cache_t::on_put_mitm

zrtp_status_t(* on_get_verified)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t *verified)

Return cache verification flag.

This function return the secret verification flag associated with a pair of ZIDs.

Parameters:
one_zid - first ZID for cache identification;
another_zid - second ZID for cache identification;
verified - verification flag to be filled in
Returns:
  • zrtp_status_ok if flag is successfully returned;
  • zrtp_status_fail if the secret cannot be found;
  • some other error code from zrtp_status_t if another error occurred.

zrtp_status_t(* on_init)(zrtp_global_t *zrtp)

Cache initialization.

libzrtp calls this function before start using cache routine at zrtp_init().

Parameters:
zrtp - libzrtp global context;
See also:
zrtp_callback_cache_t::on_down()

zrtp_status_t(* on_presh_counter_get)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t *counter)

Return Preshared calls counter.

This function should return the preshared calls counter associated with a pair of ZIDs.

Parameters:
one_zid - first ZID for cache identification;
another_zid - second ZID for cache identification;
counter - preshared calls counter to be filled in
Returns:
  • zrtp_status_ok if counter is successfully returned;
  • zrtp_status_fail if the secret cannot be found;
  • some other error code from zrtp_status_t if another error occurred.

zrtp_status_t(* on_presh_counter_set)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t counter)

Increase/reset Preshared streams counter made between two endpoints (ZIDs).

This function should set the preshared calls counter associated with a pair of ZIDs. Function is optional and should be implemented if your prodict uses Preshared keys exchange.

Parameters:
one_zid - first ZID for;
another_zid - second ZID;
counter - Preshared calls counter.
Returns:
  • zrtp_status_ok if the counter is successfully modified;
  • zrtp_status_fail if the secret cannot be found;
  • some other error code from zrtp_status_t if another error occurred.

zrtp_status_t(* on_put)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss)

Add/Update cache value.

Interface function for entering the retained secret to the cache. This function should guarantee permanent storage in the cache. The implementation algorithm is the following:

  • if the entry associated with a given pair of ZIDs does not exist, the value should be stored in cache.
  • if the entry already exists, the current secret value becomes stored as the previous one. The new value becomes stored as the current one. Besides rss->value a timestamp (rss->lastused_at) and cache TTL(rss->ttl) should be updated.

Parameters:
one_zid - ZID of one side;
another_zid - ZID of the other side;
rss - a structure storing the value of the secret that needs to be saved.
Returns:
  • zrtp_status_ok if operation is successful;
  • some error code from zrtp_status_t in case of error.
See also:
zrtp_callback_cache_t::on_get

zrtp_status_t(* on_put_mitm)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, zrtp_shared_secret_t *rss)

Add/Update cache value for MiTM endpoint.

This function is analogy to zrtp_callback_cache_t::on_put but for MiTM endpoint.

Todo:
Add more detail description
See also:
zrtp_callback_cache_t::on_put zrtp_callback_cache_t::on_get_mitm

zrtp_status_t(* on_reset_since)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid)

Should set Secure Since cache aparemeter to current date and time.

This function is optional and may be ommited.

Parameters:
one_zid - first ZID for cache identification;
another_zid - second ZID for cache identification;
Returns:
  • zrtp_status_ok if the oprtation finished sucessfully.
  • some other error code from zrtp_status_t if another error occurred.

zrtp_status_t(* on_set_verified)(const zrtp_stringn_t *one_zid, const zrtp_stringn_t *another_zid, uint32_t verified)

Set/clear cache verification flag.

This function should set the secret verification flag associated with a pair of ZIDs.

Warning:
For internal use only. To change the verification flag from the user space use the zrtp_verified_set() function.
Parameters:
one_zid - first ZID for cache identification;
another_zid - second ZID for cache identification;
verified - verification flag (value can be 0 or 1).
Returns:
  • zrtp_status_ok if flag is successfully modified;
  • zrtp_status_fail if the secret cannot be found;
  • some other error code from zrtp_status_t if another error occurred.


The documentation for this struct was generated from the following file:

Generated on Wed Dec 9 17:31:06 2009 for libzrtp  zfone