Changeset 5079
- Timestamp:
- Apr 23, 2015 11:58:22 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r4728 r5079 31 31 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 32 32 33 #if defined(PJ_HAS_SSL_SOCK) && (PJ_HAS_SSL_SOCK != 0) 34 # include <openssl/rand.h> 35 36 /* Suppress compile warning of OpenSSL deprecation (OpenSSL is deprecated 37 * since MacOSX 10.7). 38 */ 39 #if defined(PJ_DARWINOS) && PJ_DARWINOS==1 40 # pragma GCC diagnostic ignored "-Wdeprecated-declarations" 41 #endif 42 43 #endif 44 33 45 #if defined(PJMEDIA_EXTERNAL_SRTP) && (PJMEDIA_EXTERNAL_SRTP != 0) 34 46 # include <srtp/srtp.h> 47 # include <srtp/crypto_kernel.h> 35 48 #else 36 49 # include <srtp.h> … … 1085 1098 key_ok = PJ_TRUE; 1086 1099 1100 1101 #if defined(PJ_HAS_SSL_SOCK) && (PJ_HAS_SSL_SOCK != 0) 1102 err = RAND_bytes((unsigned char*)key, 1103 crypto_suites[cs_idx].cipher_key_len); 1104 if (err != 1) { 1105 PJ_LOG(5,(THIS_FILE, "Failed generating random key")); 1106 return PJMEDIA_ERRNO_FROM_LIBSRTP(1); 1107 } 1108 #else 1087 1109 err = crypto_get_random((unsigned char*)key, 1088 1110 crypto_suites[cs_idx].cipher_key_len); … … 1092 1114 return PJMEDIA_ERRNO_FROM_LIBSRTP(err); 1093 1115 } 1116 #endif 1094 1117 for (i=0; i<crypto_suites[cs_idx].cipher_key_len && key_ok; ++i) 1095 1118 if (key[i] == 0) key_ok = PJ_FALSE;
Note: See TracChangeset
for help on using the changeset viewer.