this time, actually remove the encrypted torrent (AES-256 encrypted peer connections)
This commit is contained in:
parent
f7b5c10b2b
commit
679abf2e57
|
@ -665,12 +665,6 @@ namespace libtorrent
|
||||||
torrent_map m_torrents;
|
torrent_map m_torrents;
|
||||||
std::map<std::string, boost::shared_ptr<torrent> > m_uuids;
|
std::map<std::string, boost::shared_ptr<torrent> > m_uuids;
|
||||||
|
|
||||||
// these are all the torrents using full AES-256 encryption of
|
|
||||||
// all peer connections. When receiving a handshake that's encrypred
|
|
||||||
// these are the torrents we need to try to decrypt it with to
|
|
||||||
// find the decryption key
|
|
||||||
std::set<boost::shared_ptr<torrent> > m_encrypted_torrents;
|
|
||||||
|
|
||||||
typedef std::list<boost::shared_ptr<torrent> > check_queue_t;
|
typedef std::list<boost::shared_ptr<torrent> > check_queue_t;
|
||||||
|
|
||||||
// this has all torrents that wants to be checked in it
|
// this has all torrents that wants to be checked in it
|
||||||
|
|
|
@ -1364,12 +1364,6 @@ namespace libtorrent
|
||||||
// data into this torrent instead of replacing them
|
// data into this torrent instead of replacing them
|
||||||
bool m_merge_resume_trackers:1;
|
bool m_merge_resume_trackers:1;
|
||||||
|
|
||||||
// set to true if this torrent has been added to the session
|
|
||||||
// global list for encrypted torrents. When the torrent is
|
|
||||||
// paused it's removed and when it's started again, it's
|
|
||||||
// re-added
|
|
||||||
bool m_in_encrypted_list:1;
|
|
||||||
|
|
||||||
// state subscription. If set, a pointer to this torrent
|
// state subscription. If set, a pointer to this torrent
|
||||||
// will be added to the m_state_updates set in session_impl
|
// will be added to the m_state_updates set in session_impl
|
||||||
// whenever this torrent's state changes (any state).
|
// whenever this torrent's state changes (any state).
|
||||||
|
|
|
@ -1218,14 +1218,6 @@ namespace libtorrent
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
|
||||||
if (t->torrent_file().encryption_key().size() == 32 && !allow_encrypted)
|
|
||||||
{
|
|
||||||
disconnect(errors::invalid_info_hash, 2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (t->is_paused() && (!t->is_auto_managed()
|
if (t->is_paused() && (!t->is_auto_managed()
|
||||||
|| !m_ses.m_settings.incoming_starts_queued_torrents))
|
|| !m_ses.m_settings.incoming_starts_queued_torrents))
|
||||||
{
|
{
|
||||||
|
|
|
@ -830,7 +830,6 @@ namespace aux {
|
||||||
PRINT_OFFSETOF(torrent_info, m_created_by)
|
PRINT_OFFSETOF(torrent_info, m_created_by)
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
PRINT_OFFSETOF(torrent_info, m_ssl_root_cert)
|
PRINT_OFFSETOF(torrent_info, m_ssl_root_cert)
|
||||||
PRINT_OFFSETOF(torrent_info, m_aes_key)
|
|
||||||
#endif
|
#endif
|
||||||
PRINT_OFFSETOF(torrent_info, m_info_dict)
|
PRINT_OFFSETOF(torrent_info, m_info_dict)
|
||||||
PRINT_OFFSETOF(torrent_info, m_creation_date)
|
PRINT_OFFSETOF(torrent_info, m_creation_date)
|
||||||
|
|
|
@ -428,7 +428,6 @@ namespace libtorrent
|
||||||
, m_magnet_link(false)
|
, m_magnet_link(false)
|
||||||
, m_apply_ip_filter(p.flags & add_torrent_params::flag_apply_ip_filter)
|
, m_apply_ip_filter(p.flags & add_torrent_params::flag_apply_ip_filter)
|
||||||
, m_merge_resume_trackers(p.flags & add_torrent_params::flag_merge_resume_trackers)
|
, m_merge_resume_trackers(p.flags & add_torrent_params::flag_merge_resume_trackers)
|
||||||
, m_in_encrypted_list(false)
|
|
||||||
, m_state_subscription(p.flags & add_torrent_params::flag_update_subscribe)
|
, m_state_subscription(p.flags & add_torrent_params::flag_update_subscribe)
|
||||||
, m_in_state_updates(false)
|
, m_in_state_updates(false)
|
||||||
{
|
{
|
||||||
|
@ -1491,14 +1490,6 @@ namespace libtorrent
|
||||||
if (!cert.empty()) init_ssl(cert);
|
if (!cert.empty()) init_ssl(cert);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
|
||||||
if (m_torrent_file->encryption_key().size() == 32 && !m_in_encrypted_list)
|
|
||||||
{
|
|
||||||
m_ses.m_encrypted_torrents.insert(shared_from_this());
|
|
||||||
m_in_encrypted_list = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_file_priority.resize(m_torrent_file->num_files(), 1);
|
m_file_priority.resize(m_torrent_file->num_files(), 1);
|
||||||
m_file_progress.resize(m_torrent_file->num_files(), 0);
|
m_file_progress.resize(m_torrent_file->num_files(), 0);
|
||||||
|
|
||||||
|
@ -3369,14 +3360,6 @@ namespace libtorrent
|
||||||
|
|
||||||
if (m_abort) return;
|
if (m_abort) return;
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
|
||||||
if (m_torrent_file->is_valid() && m_torrent_file->encryption_key().size() == 32 && m_in_encrypted_list)
|
|
||||||
{
|
|
||||||
m_ses.m_encrypted_torrents.erase(shared_from_this());
|
|
||||||
m_in_encrypted_list = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_abort = true;
|
m_abort = true;
|
||||||
// if the torrent is paused, it doesn't need
|
// if the torrent is paused, it doesn't need
|
||||||
// to announce with even=stopped again.
|
// to announce with even=stopped again.
|
||||||
|
@ -6813,14 +6796,6 @@ namespace libtorrent
|
||||||
TORRENT_ASSERT(m_ses.is_network_thread());
|
TORRENT_ASSERT(m_ses.is_network_thread());
|
||||||
if (!is_paused()) return;
|
if (!is_paused()) return;
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
|
||||||
if (m_torrent_file->is_valid() && m_torrent_file->encryption_key().size() == 32 && m_in_encrypted_list)
|
|
||||||
{
|
|
||||||
m_ses.m_encrypted_torrents.erase(shared_from_this());
|
|
||||||
m_in_encrypted_list = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
for (extension_list_t::iterator i = m_extensions.begin()
|
for (extension_list_t::iterator i = m_extensions.begin()
|
||||||
, end(m_extensions.end()); i != end; ++i)
|
, end(m_extensions.end()); i != end; ++i)
|
||||||
|
@ -6972,14 +6947,6 @@ namespace libtorrent
|
||||||
TORRENT_ASSERT(m_ses.is_network_thread());
|
TORRENT_ASSERT(m_ses.is_network_thread());
|
||||||
if (is_paused()) return;
|
if (is_paused()) return;
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
|
||||||
if (m_torrent_file->is_valid() && m_torrent_file->encryption_key().size() == 32 && !m_in_encrypted_list)
|
|
||||||
{
|
|
||||||
m_ses.m_encrypted_torrents.insert(shared_from_this());
|
|
||||||
m_in_encrypted_list = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
for (extension_list_t::iterator i = m_extensions.begin()
|
for (extension_list_t::iterator i = m_extensions.begin()
|
||||||
, end(m_extensions.end()); i != end; ++i)
|
, end(m_extensions.end()); i != end; ++i)
|
||||||
|
|
|
@ -470,7 +470,6 @@ namespace libtorrent
|
||||||
, m_created_by(t.m_created_by)
|
, m_created_by(t.m_created_by)
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
, m_ssl_root_cert(t.m_ssl_root_cert)
|
, m_ssl_root_cert(t.m_ssl_root_cert)
|
||||||
, m_aes_key(t.m_aes_key)
|
|
||||||
#endif
|
#endif
|
||||||
, m_creation_date(t.m_creation_date)
|
, m_creation_date(t.m_creation_date)
|
||||||
, m_info_hash(t.m_info_hash)
|
, m_info_hash(t.m_info_hash)
|
||||||
|
@ -761,7 +760,6 @@ namespace libtorrent
|
||||||
m_created_by.swap(ti.m_created_by);
|
m_created_by.swap(ti.m_created_by);
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
m_ssl_root_cert.swap(ti.m_ssl_root_cert);
|
m_ssl_root_cert.swap(ti.m_ssl_root_cert);
|
||||||
m_aes_key.swap(ti.m_aes_key);
|
|
||||||
#endif
|
#endif
|
||||||
boost::uint32_t tmp;
|
boost::uint32_t tmp;
|
||||||
SWAP(m_multifile, ti.m_multifile);
|
SWAP(m_multifile, ti.m_multifile);
|
||||||
|
@ -943,8 +941,6 @@ namespace libtorrent
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
m_ssl_root_cert = info.dict_find_string_value("ssl-cert");
|
m_ssl_root_cert = info.dict_find_string_value("ssl-cert");
|
||||||
|
|
||||||
m_aes_key = info.dict_find_string_value("encryption-key");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue