Changeset 1151


Ignore:
Timestamp:
Apr 4, 2007 5:49:28 PM (17 years ago)
Author:
bennylp
Message:

Added PJ_STUN_NO_AUTHENTICATE option to disable authentication in STUN session

Location:
pjproject/trunk/pjnath
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/include/pjnath/stun_msg.h

    r1150 r1151  
    10301030     * decode the packet. 
    10311031     */ 
    1032     PJ_STUN_CHECK_PACKET    = 2 
     1032    PJ_STUN_CHECK_PACKET    = 2, 
     1033 
     1034    /** 
     1035     * This option current is only valid for #pj_stun_session_on_rx_pkt(). 
     1036     * When specified, it tells the session NOT to authenticate the 
     1037     * message. 
     1038     */ 
     1039    PJ_STUN_NO_AUTHENTICATE = 4 
    10331040}; 
    10341041 
  • pjproject/trunk/pjnath/src/pjnath/stun_session.c

    r1141 r1151  
    957957    } 
    958958 
    959     /* Authenticate the message */ 
    960     status = authenticate_msg(sess, packet, pkt_size, msg, tmp_pool,  
    961                               src_addr, src_addr_len); 
    962     if (status != PJ_SUCCESS) { 
    963         goto on_return; 
     959    /* Authenticate the message, unless PJ_STUN_NO_AUTHENTICATE 
     960     * is specified in the option. 
     961     */ 
     962    if ((options & PJ_STUN_NO_AUTHENTICATE) == 0) { 
     963        status = authenticate_msg(sess, packet, pkt_size, msg, tmp_pool, 
     964                                  src_addr, src_addr_len); 
     965        if (status != PJ_SUCCESS) { 
     966            goto on_return; 
     967        } 
    964968    } 
    965969 
     
    993997 
    994998 
     999 
  • pjproject/trunk/pjnath/src/pjstun-client/client_main.c

    r1150 r1151  
    3030#define REQ_IP          NULL                /* IP address string */ 
    3131 
     32#define OPTIONS         PJ_STUN_NO_AUTHENTICATE 
    3233 
    3334static struct global 
     
    157158                if (pj_stun_msg_check(buffer, len, PJ_STUN_IS_DATAGRAM)==PJ_SUCCESS) { 
    158159                    rc = pj_stun_session_on_rx_pkt(g.sess, buffer, len,  
    159                                                    0,  
     160                                                   OPTIONS,  
    160161                                                   NULL, &addr, addrlen); 
    161162                    if (rc != PJ_SUCCESS) 
Note: See TracChangeset for help on using the changeset viewer.