Ignore:
Timestamp:
Mar 15, 2016 3:57:39 AM (8 years ago)
Author:
nanang
Message:

Close #1847: Upgraded libsrtp version to 1.5.4 and added support for AES-CM-256 crypto.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/srtp/crypto/replay/rdb.c

    r4130 r5261  
    4545 
    4646 
     47#ifdef HAVE_CONFIG_H 
     48    #include <config.h> 
     49#endif 
     50 
    4751#include "rdb.h" 
    4852 
     
    7175 
    7276err_status_t 
    73 rdb_check(const rdb_t *rdb, uint32_t index) { 
     77rdb_check(const rdb_t *rdb, uint32_t p_index) { 
    7478   
    7579  /* if the index appears after (or at very end of) the window, its good */ 
    76   if (index >= rdb->window_start + rdb_bits_in_bitmask) 
     80  if (p_index >= rdb->window_start + rdb_bits_in_bitmask) 
    7781    return err_status_ok; 
    7882   
    7983  /* if the index appears before the window, its bad */ 
    80   if (index < rdb->window_start) 
     84  if (p_index < rdb->window_start) 
    8185    return err_status_replay_old; 
    8286 
    8387  /* otherwise, the index appears within the window, so check the bitmask */ 
    84   if (v128_get_bit(&rdb->bitmask, (index - rdb->window_start)) == 1) 
     88  if (v128_get_bit(&rdb->bitmask, (p_index - rdb->window_start)) == 1) 
    8589    return err_status_replay_fail;     
    8690       
     
    99103 
    100104err_status_t 
    101 rdb_add_index(rdb_t *rdb, uint32_t index) { 
     105rdb_add_index(rdb_t *rdb, uint32_t p_index) { 
    102106  int delta;   
    103107 
    104   /* here we *assume* that index > rdb->window_start */ 
     108  /* here we *assume* that p_index > rdb->window_start */ 
    105109 
    106   delta = (index - rdb->window_start);     
     110  delta = (p_index - rdb->window_start);     
    107111  if (delta < rdb_bits_in_bitmask) { 
    108112 
    109     /* if the index is within the window, set the appropriate bit */ 
     113    /* if the p_index is within the window, set the appropriate bit */ 
    110114    v128_set_bit(&rdb->bitmask, delta); 
    111115 
Note: See TracChangeset for help on using the changeset viewer.