Changeset 1760
- Timestamp:
- Jan 30, 2008 9:47:57 AM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r1759 r1760 297 297 298 298 /* Check crypto availability */ 299 if (opt ->crypto_count == 0 &&299 if (opt && opt->crypto_count == 0 && 300 300 opt->use == PJMEDIA_SRTP_MANDATORY) 301 301 return PJMEDIA_SRTP_ESDPREQCRYPTO; 302 302 303 303 /* Check crypto */ 304 if (opt ->use != PJMEDIA_SRTP_DISABLED) {304 if (opt && opt->use != PJMEDIA_SRTP_DISABLED) { 305 305 for (i=0; i < opt->crypto_count; ++i) { 306 306 int cs_idx = get_crypto_idx(&opt->crypto[i].name); … … 970 970 return PJMEDIA_SRTP_ESDPINTRANSPORT; 971 971 } 972 goto BYPASS_SRTP; 972 973 } else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) { 973 974 m_loc->desc.transport = m_rem->desc.transport; … … 1013 1014 if (pj_stricmp(&m_rem->attr[i]->name, &ID_CRYPTO) != 0) 1014 1015 continue; 1015 1016 /* SRTP is disabled but there is crypto attr in remote media */1017 /* Put the checking here to save a bit memory for parsing */1018 if (srtp->setting.use == PJMEDIA_SRTP_DISABLED) {1019 //DEACTIVATE_MEDIA(pool, m_loc);1020 //return PJMEDIA_SRTP_ESDPINTRANSPORT;1021 continue;1022 }1023 1016 1024 1017 has_crypto_attr = PJ_TRUE; … … 1046 1039 1047 1040 /* Force to use test key */ 1041 /* bad keys for snom: */ 1048 1042 //char *hex_test_key = "58b29c5c8f42308120ce857e439f2d" 1049 1043 // "7810a8b10ad0b1446be5470faea496"; 1050 //pj_str_t* test_key = &srtp->setting.crypto[j].key; 1044 //char *hex_test_key = "20a26aac7ba062d356ff52b61e3993" 1045 // "ccb78078f12c64db94b9c294927fd0"; 1046 //pj_str_t *test_key = &srtp->setting.crypto[j].key; 1051 1047 //char *raw_test_key = pj_pool_zalloc(srtp->pool, 64); 1052 1048 //hex_string_to_octet_string( … … 1056 1052 //pj_strset(test_key, raw_test_key, 1057 1053 // crypto_suites[cs_idx].cipher_key_len); 1054 /* EO Force to use test key */ 1058 1055 1059 1056 if (tmp_rx_crypto.key.slen != … … 1072 1069 1073 1070 if (srtp->setting.use == PJMEDIA_SRTP_DISABLED) { 1074 /* At this point, it is ensured remote has no crypto attr*/1071 /* bypass when remote uses RTP/AVP and we disable SRTP */ 1075 1072 goto BYPASS_SRTP; 1076 1073 } else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) { -
pjproject/trunk/pjsip-apps/src/samples/streamutil.c
r1735 r1760 29 29 * \includelineno streamutil.c 30 30 */ 31 32 #include <pjlib.h> 33 #include <pjlib-util.h> 34 #include <pjmedia.h> 35 #include <pjmedia-codec.h> 36 #include <pjmedia/transport_srtp.h> 37 38 #include <stdlib.h> /* atoi() */ 39 #include <stdio.h> 40 41 #include "util.h" 31 42 32 43 … … 71 82 72 83 73 74 #include <pjlib.h>75 #include <pjlib-util.h>76 #include <pjmedia.h>77 #include <pjmedia-codec.h>78 #include <pjmedia/transport_srtp.h>79 80 #include <stdlib.h> /* atoi() */81 #include <stdio.h>82 83 #include "util.h"84 84 85 85
Note: See TracChangeset
for help on using the changeset viewer.