Ignore:
Timestamp:
May 22, 2007 9:55:31 PM (15 years ago)
Author:
bennylp
Message:

Fixed ticket #286: Bug in STUN FINGERPRINT verification and logging STUN message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/stun_msg.c

    r1275 r1289  
    16571657 
    16581658        /* Check if FINGERPRINT attribute is present */ 
    1659         if (GETVAL16H(pdu, msg_len + 20) == PJ_STUN_ATTR_FINGERPRINT) { 
    1660             pj_uint16_t attr_len = GETVAL16H(pdu, msg_len + 22); 
    1661             pj_uint32_t fingerprint = GETVAL32H(pdu, msg_len + 24); 
     1659        if (GETVAL16H(pdu, msg_len + 20 - 8) == PJ_STUN_ATTR_FINGERPRINT) { 
     1660            pj_uint16_t attr_len = GETVAL16H(pdu, msg_len + 20 - 8 + 2); 
     1661            pj_uint32_t fingerprint = GETVAL32H(pdu, msg_len + 20 - 8 + 4); 
    16621662            pj_uint32_t crc; 
    16631663 
     
    16651665                return PJNATH_ESTUNINATTRLEN; 
    16661666 
    1667             crc = pj_crc32_calc(pdu, msg_len + 20); 
     1667            crc = pj_crc32_calc(pdu, msg_len + 20 - 8); 
    16681668            crc ^= STUN_XOR_FINGERPRINT; 
    16691669 
Note: See TracChangeset for help on using the changeset viewer.