Ignore:
Timestamp:
Jun 25, 2009 12:46:00 PM (15 years ago)
Author:
bennylp
Message:

Ticket #837: SHA1 encryption may corrupt STUN packets with MESSAGE-INTEGRITY

  • backported changes from #836
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0/pjlib-util/src/pjlib-util/sha1.c

    r1001 r2809  
    106106 
    107107 
    108 static void SHA1_Transform(pj_uint32_t state[5], const pj_uint8_t buffer[64]); 
     108static void SHA1_Transform(pj_uint32_t state[5], pj_uint8_t buffer[64]); 
    109109 
    110110#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) 
     
    132132 
    133133/* Hash a single 512-bit block. This is the core of the algorithm. */ 
    134 static void SHA1_Transform(pj_uint32_t state[5], const pj_uint8_t buffer[64]) 
     134static void SHA1_Transform(pj_uint32_t state[5], pj_uint8_t buffer[64]) 
    135135{ 
    136136    pj_uint32_t a, b, c, d, e; 
     
    216216        SHA1_Transform(context->state, context->buffer); 
    217217        for ( ; i + 63 < len; i += 64) { 
    218             SHA1_Transform(context->state, data + i); 
     218            pj_uint8_t tmp[64]; 
     219            pj_memcpy(tmp, data + i, 64); 
     220            SHA1_Transform(context->state, tmp); 
    219221        } 
    220222        j = 0; 
Note: See TracChangeset for help on using the changeset viewer.