Changeset 1924
- Timestamp:
- Apr 13, 2008 9:48:44 PM (17 years ago)
- Location:
- pjproject/trunk/pjnath
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/stun_msg.h
r1923 r1924 1159 1159 * message. 1160 1160 */ 1161 PJ_STUN_NO_AUTHENTICATE = 4 1161 PJ_STUN_NO_AUTHENTICATE = 4, 1162 1163 /** 1164 * Disable FINGERPRINT verification. This option can be used when calling 1165 * #pj_stun_msg_check() and #pj_stun_msg_decode() to disable the 1166 * verification of FINGERPRINT, for example when the STUN usage says when 1167 * FINGERPRINT mechanism shall not * be used. 1168 */ 1169 PJ_STUN_NO_FINGERPRINT_CHECK = 8 1162 1170 }; 1163 1171 -
pjproject/trunk/pjnath/src/pjnath/stun_msg.c
r1877 r1924 1869 1869 1870 1870 /* Check if FINGERPRINT attribute is present */ 1871 if (GETVAL16H(pdu, msg_len + 20 - 8) == PJ_STUN_ATTR_FINGERPRINT) { 1871 if ((options & PJ_STUN_NO_FINGERPRINT_CHECK )==0 && 1872 GETVAL16H(pdu, msg_len + 20 - 8) == PJ_STUN_ATTR_FINGERPRINT) 1873 { 1872 1874 pj_uint16_t attr_len = GETVAL16H(pdu, msg_len + 20 - 8 + 2); 1873 1875 pj_uint32_t fingerprint = GETVAL32H(pdu, msg_len + 20 - 8 + 4); -
pjproject/trunk/pjnath/src/pjturn-srv/allocation.c
r1913 r1924 826 826 perm->expiry.sec += PJ_TURN_PERM_TIMEOUT; 827 827 828 /* Register to hash table */ 829 pj_hash_set(alloc->pool, alloc->peer_table, &perm->hkey.peer_addr, 830 pj_sockaddr_get_len(&perm->hkey.peer_addr), 0, perm); 828 /* Register to hash table (only the address part!) */ 829 pj_hash_set(alloc->pool, alloc->peer_table, 830 pj_sockaddr_get_addr(&perm->hkey.peer_addr), 831 pj_sockaddr_get_addr_len(&perm->hkey.peer_addr), 0, perm); 831 832 832 833 return perm; … … 846 847 847 848 /* Remove from permission hash table */ 848 pj_hash_set(NULL, alloc->peer_table, &perm->hkey.peer_addr, 849 pj_sockaddr_get_len(&perm->hkey.peer_addr), 0, NULL); 849 pj_hash_set(NULL, alloc->peer_table, 850 pj_sockaddr_get_addr(&perm->hkey.peer_addr), 851 pj_sockaddr_get_addr_len(&perm->hkey.peer_addr), 0, NULL); 850 852 851 853 /* Remove from channel hash table, if assigned a channel number */ … … 866 868 pj_turn_permission *perm; 867 869 870 PJ_UNUSED_ARG(addr_len); 871 868 872 /* Lookup in peer hash table */ 869 perm = (pj_turn_permission*) pj_hash_get(alloc->peer_table, peer_addr, 870 addr_len, NULL); 873 perm = (pj_turn_permission*) 874 pj_hash_get(alloc->peer_table, 875 pj_sockaddr_get_addr(peer_addr), 876 pj_sockaddr_get_addr_len(peer_addr), 877 NULL); 871 878 return perm ? check_permission_expiry(perm) : NULL; 872 879 } … … 921 928 * our stun_on_rx_request() or stun_on_rx_indication() 922 929 * callbacks. 930 * 931 * Note: currently it is necessary to specify the 932 * PJ_STUN_NO_FINGERPRINT_CHECK otherwise the FINGERPRINT 933 * attribute inside STUN Send Indication message will mess up 934 * with fingerprint checking. 923 935 */ 924 unsigned options = PJ_STUN_CHECK_PACKET ;936 unsigned options = PJ_STUN_CHECK_PACKET | PJ_STUN_NO_FINGERPRINT_CHECK; 925 937 unsigned parsed_len = 0; 926 938 -
pjproject/trunk/pjnath/src/pjturn-srv/auth.c
r1882 r1924 34 34 } g_cred[] = 35 35 { 36 { "user", "passwd" }, 36 { "100", "100" }, 37 { "700", "700" }, 38 { "701", "701" }, 39 { "702", "702" } 37 40 }; 38 41 -
pjproject/trunk/pjnath/src/pjturn-srv/main.c
r1913 r1924 20 20 #include "auth.h" 21 21 22 #define REALM "pjsip.org" 22 #define REALM "pjsip.org" 23 #define TURN_PORT PJ_STUN_TURN_PORT 24 //#define TURN_PORT 34780 25 23 26 24 27 static pj_caching_pool g_cp; … … 139 142 140 143 status = pj_turn_listener_create_udp(srv, pj_AF_INET(), NULL, 141 PJ_STUN_PORT, 1, 0, &listener);144 TURN_PORT, 1, 0, &listener); 142 145 if (status != PJ_SUCCESS) 143 146 return err("Error creating UDP listener", status); 144 147 145 148 status = pj_turn_listener_create_tcp(srv, pj_AF_INET(), NULL, 146 PJ_STUN_PORT, 1, 0, &listener);149 TURN_PORT, 1, 0, &listener); 147 150 if (status != PJ_SUCCESS) 148 151 return err("Error creating listener", status); -
pjproject/trunk/pjnath/src/pjturn-srv/server.c
r1913 r1924 582 582 583 583 /* Check that this is a STUN message */ 584 options = PJ_STUN_CHECK_PACKET ;584 options = PJ_STUN_CHECK_PACKET | PJ_STUN_NO_FINGERPRINT_CHECK; 585 585 if (pkt->transport->listener->tp_type == PJ_TURN_TP_UDP) 586 586 options |= PJ_STUN_IS_DATAGRAM;
Note: See TracChangeset
for help on using the changeset viewer.