Ignore:
Timestamp:
Oct 7, 2009 8:38:02 AM (15 years ago)
Author:
bennylp
Message:

More ticket #960: STUN compatibility problem with RFC 3489 servers (in encoding SERVER-NAME or SOFTWARE attribute)

  • rollback the previous fix in r2916 since it is broken. It fails various authentication scenarios due to alignment of USERNAME attribute
  • this fix only applies old alignment rule to SERVERNAME attribute or when STUN magic is not used in the message
  • also disabled test vectors from draft-denis-behave-rfc3489bis-test-vectors-02, it fails with this fix
File:
1 edited

Legend:

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

    r2916 r2928  
    12361236    PUTVAL16H(buf, 0, ca->hdr.type); 
    12371237 
    1238     /* Set the length to be 4-bytes aligned so that we can 
    1239      * communicate with RFC 3489 endpoints 
     1238    /* Special treatment for SOFTWARE attribute: 
     1239     * This attribute had caused interop problem when talking to  
     1240     * legacy RFC 3489 STUN servers, due to different "length" 
     1241     * rules with RFC 5389. 
    12401242     */ 
    1241     PUTVAL16H(buf, 2, (pj_uint16_t)((ca->value.slen + 3) & (~3))); 
     1243    if (msghdr->magic != PJ_STUN_MAGIC || 
     1244        ca->hdr.type == PJ_STUN_ATTR_SOFTWARE) 
     1245    { 
     1246        /* Set the length to be 4-bytes aligned so that we can 
     1247         * communicate with RFC 3489 endpoints 
     1248         */ 
     1249        PUTVAL16H(buf, 2, (pj_uint16_t)((ca->value.slen + 3) & (~3))); 
     1250    } else { 
     1251        /* Use RFC 5389 rule */ 
     1252        PUTVAL16H(buf, 2, (pj_uint16_t)ca->value.slen); 
     1253    } 
    12421254 
    12431255    /* Copy the string */ 
Note: See TracChangeset for help on using the changeset viewer.