"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/h323ep.cxx" between
h323plus-1_26_9.tar.gz and h323plus-1_27_0.tar.gz

About: H.323 Plus offers libraries for voice (VoIP) and videoconferencing using H.323.

h323ep.cxx  (h323plus-1_26_9):h323ep.cxx  (h323plus-1_27_0)
skipping to change at line 158 skipping to change at line 158
BYTE H323EndPoint::defaultT35CountryCode = 9; // Country code for Australia BYTE H323EndPoint::defaultT35CountryCode = 9; // Country code for Australia
BYTE H323EndPoint::defaultT35Extension = 0; BYTE H323EndPoint::defaultT35Extension = 0;
WORD H323EndPoint::defaultManufacturerCode = 61; // Allocated by Australian Com munications Authority, Oct 2000; WORD H323EndPoint::defaultManufacturerCode = 61; // Allocated by Australian Com munications Authority, Oct 2000;
//////////////////////////////////////////////////////////////////////////////// ////// //////////////////////////////////////////////////////////////////////////////// //////
// TLS Context (This may be moved later on to its own file) - SH // TLS Context (This may be moved later on to its own file) - SH
#ifdef H323_TLS #ifdef H323_TLS
extern "C" { extern "C" {
#include <openssl/opensslv.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/rand.h> #include <openssl/rand.h>
} }
void tls_info_cb(const SSL * s, int where, int ret) void tls_info_cb(const SSL * s, int where, int ret)
{ {
const char * str = NULL; const char * str = NULL;
int w = where & ~SSL_ST_MASK; int w = where & ~SSL_ST_MASK;
skipping to change at line 272 skipping to change at line 273
#endif #endif
if (m_context) { if (m_context) {
SSL_CTX_free(m_context); SSL_CTX_free(m_context);
m_context = NULL; m_context = NULL;
} }
m_context = SSL_CTX_new(SSLv23_method()); m_context = SSL_CTX_new(SSLv23_method());
SSL_CTX_set_options(m_context, SSL_OP_NO_SSLv2); // remove unsafe SSLv2 (e g. due to DROWN) SSL_CTX_set_options(m_context, SSL_OP_NO_SSLv2); // remove unsafe SSLv2 (e g. due to DROWN)
SSL_CTX_set_options(m_context, SSL_OP_NO_SSLv3); // remove unsafe SSLv3 (e g. due to POODLE) SSL_CTX_set_options(m_context, SSL_OP_NO_SSLv3); // remove unsafe SSLv3 (e g. due to POODLE)
SSL_CTX_set_options(m_context, SSL_OP_NO_COMPRESSION); // remove unsafe SSL compression (eg. due to CRIME)
SSL_CTX_set_mode(m_context, SSL_MODE_AUTO_RETRY); // handle re-negotiation s automatically SSL_CTX_set_mode(m_context, SSL_MODE_AUTO_RETRY); // handle re-negotiation s automatically
#if PTLIB_VER < 2120 #if PTLIB_VER < 2120
context = m_context; context = m_context;
#endif #endif
// no anonymous DH (ADH), no <= 64 bit (LOW), no export ciphers (EXP), no MD 5 + RC4, no elliptic curve ciphers (ECDH + ECDSA) // no anonymous DH (ADH), no <= 64 bit (LOW), no export ciphers (EXP), no MD 5 + RC4, no elliptic curve ciphers (ECDH + ECDSA)
PString cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:!RC4:!ECDH:!ECDSA:@STRENGTH"; PString cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:!RC4:!ECDH:!ECDSA:@STRENGTH";
SetCipherList(cipherList); SetCipherList(cipherList);
SSL_CTX_set_info_callback(m_context, tls_info_cb); SSL_CTX_set_info_callback(m_context, tls_info_cb);
skipping to change at line 435 skipping to change at line 437
} }
PBoolean H323_TLSContext::SetDHParameters(const PBYTEArray & dh_p, const PBYTEAr ray & dh_g) PBoolean H323_TLSContext::SetDHParameters(const PBYTEArray & dh_p, const PBYTEAr ray & dh_g)
{ {
DH *dh = DH_new(); DH *dh = DH_new();
if (dh == NULL) { if (dh == NULL) {
PTRACE(2, "TLS\tFailed to allocate DH"); PTRACE(2, "TLS\tFailed to allocate DH");
return false; return false;
}; };
dh->p = BN_bin2bn(dh_p, dh_p.GetSize(), NULL); BIGNUM* p = BN_bin2bn(dh_p, dh_p.GetSize(), NULL);
dh->g = BN_bin2bn(dh_g, dh_g.GetSize(), NULL); BIGNUM* g = BN_bin2bn(dh_g, dh_g.GetSize(), NULL);
if (p != NULL && g != NULL)
{
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
dh->p = p;
dh->g = g;
#else
if (!DH_set0_pqg(dh, p, NULL, g)) {
BN_free(g);
BN_free(p);
DH_free(dh);
return false;
}
#endif
}
else {
if (g)
BN_free(g);
if (p)
BN_free(p);
DH_free(dh);
return false;
}
#if PTLIB_VER < 2120 #if PTLIB_VER < 2120
ssl_ctx_st * m_context = context; ssl_ctx_st * m_context = context;
#endif #endif
if (SSL_CTX_set_tmp_dh(m_context, dh) != 1) { if (SSL_CTX_set_tmp_dh(m_context, dh) != 1) {
DH_free(dh); DH_free(dh);
return false; return false;
} }
skipping to change at line 959 skipping to change at line 983
// Clean up any connections that the cleaner thread missed // Clean up any connections that the cleaner thread missed
CleanUpConnections(); CleanUpConnections();
#ifdef H323_TLS #ifdef H323_TLS
if (m_transportContext) { if (m_transportContext) {
delete m_transportContext; delete m_transportContext;
} }
// OpenSSL Cleanup // OpenSSL Cleanup
EVP_cleanup(); EVP_cleanup();
CRYPTO_cleanup_all_ex_data(); CRYPTO_cleanup_all_ex_data();
ERR_remove_state(0); #if (OPENSSL_VERSION_NUMBER < 0x10100000L)
ERR_remove_thread_state(NULL);
#endif
ERR_free_strings(); ERR_free_strings();
#endif #endif
#ifdef P_STUN #ifdef P_STUN
delete natMethods; delete natMethods;
#endif #endif
#ifdef H323_H460P #ifdef H323_H460P
delete presenceHandler; delete presenceHandler;
#endif #endif
skipping to change at line 2050 skipping to change at line 2076
if ((_remoteParty.Find(':') == P_MAX_INDEX) && (remoteParty.Find('@') == P_M AX_INDEX)) { if ((_remoteParty.Find(':') == P_MAX_INDEX) && (remoteParty.Find('@') == P_M AX_INDEX)) {
if (number.Left(5) *= "h323:") if (number.Left(5) *= "h323:")
number = number.Mid(5); number = number.Mid(5);
if (remoteParty.Left(6) *= "h323s:") { if (remoteParty.Left(6) *= "h323s:") {
number = number.Mid(6); number = number.Mid(6);
proto = "h323s"; proto = "h323s";
} }
PINDEX i; PINDEX i;
for (i = 0; i < number.GetLength(); ++i) for (i = 0; i < number.GetLength(); ++i) {
if (!isdigit(number[i])) if (!isdigit(number[i]))
break; break;
if (i >= number.GetLength()) { }
PString str; if (i >= number.GetLength()) {
if (PDNS::ENUMLookup(number, "E2U+h323", str)) { PString str;
if (PDNS::ENUMLookup(number, "E2U+h323", str)) {
str.Replace("+",""); str.Replace("+","");
if ((str.Find("//1") != P_MAX_INDEX) && if ((str.Find("//1") != P_MAX_INDEX) &&
(str.Find('@') != P_MAX_INDEX)) { (str.Find('@') != P_MAX_INDEX)) {
remoteParty = proto + ":" + number + str.Mid(str.Find('@')-1); remoteParty = proto + ":" + number + str.Mid(str.Find('@')-1);
} else { } else {
remoteParty = str; remoteParty = str;
} }
PTRACE(4, "H323\tENUM converted remote party " << _remoteParty << " to PTRACE(4, "H323\tENUM converted remote party " << _remoteParty << "
" << remoteParty); to " << remoteParty);
} else { } else {
PTRACE(4, "H323\tENUM Cannot resolve remote party " << _remoteParty); PTRACE(4, "H323\tENUM Cannot resolve remote party " << _remoteParty)
return false; ;
return false;
} }
} }
} }
#ifdef H323_IPV6 #ifdef H323_IPV6
// Again horrible code should be able to get interface listing for a given pro tocol - SH // Again horrible code should be able to get interface listing for a given pro tocol - SH
PBoolean ipv6IPv4Discover = false; PBoolean ipv6IPv4Discover = false;
if (PIPSocket::GetDefaultIpAddressFamily() == AF_INET6) { if (PIPSocket::GetDefaultIpAddressFamily() == AF_INET6) {
PIPSocket::SetDefaultIpAddressFamilyV4(); PIPSocket::SetDefaultIpAddressFamilyV4();
ipv6IPv4Discover = true; ipv6IPv4Discover = true;
} }
#endif #endif
 End of changes. 8 change blocks. 
17 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)