diff --git a/src/allmydata/_auto_deps.py b/src/allmydata/_auto_deps.py index 8a37bd34b..a4b165572 100644 --- a/src/allmydata/_auto_deps.py +++ b/src/allmydata/_auto_deps.py @@ -42,7 +42,8 @@ install_requires = [ # * foolscap >= 0.12.3 provides tcp/tor/i2p connection handlers we need, # and allocate_tcp_port # * foolscap >= 0.12.5 has ConnectionInfo and ReconnectionInfo - "foolscap >= 0.12.5", + # * foolscap >= 0.12.6 has an i2p.sam_endpoint() that takes kwargs + "foolscap >= 0.12.6", # Needed for SFTP. # pycrypto 2.2 doesn't work due to diff --git a/src/allmydata/test/test_connections.py b/src/allmydata/test/test_connections.py index c336a5c3c..fff0e55ea 100644 --- a/src/allmydata/test/test_connections.py +++ b/src/allmydata/test/test_connections.py @@ -158,7 +158,7 @@ class I2P(unittest.TestCase): with mock.patch("foolscap.connections.i2p.default", return_value=h1) as f: h = n._make_i2p_handler() - self.assertEqual(f.mock_calls, [mock.call(reactor)]) + self.assertEqual(f.mock_calls, [mock.call(reactor, keyfile=None)]) self.assertIdentical(h, h1) def test_samport(self): diff --git a/src/allmydata/test/test_i2p_provider.py b/src/allmydata/test/test_i2p_provider.py index 50fb7995f..242c7c444 100644 --- a/src/allmydata/test/test_i2p_provider.py +++ b/src/allmydata/test/test_i2p_provider.py @@ -221,7 +221,7 @@ class Provider(unittest.TestCase): h = p.get_i2p_handler() cfs.assert_called_with(reactor, "ep_desc") self.assertIs(h, handler) - i2p.sam_endpoint.assert_called_with(ep) + i2p.sam_endpoint.assert_called_with(ep, keyfile=None) def test_handler_launch(self): i2p = mock.Mock() @@ -292,7 +292,7 @@ class Provider(unittest.TestCase): p = i2p_provider.Provider("basedir", FakeConfig(), reactor) h = p.get_i2p_handler() self.assertIs(h, handler) - i2p.default.assert_called_with(reactor) + i2p.default.assert_called_with(reactor, keyfile=None) class Provider_CheckI2PConfig(unittest.TestCase): def test_default(self): diff --git a/src/allmydata/util/i2p_provider.py b/src/allmydata/util/i2p_provider.py index 91391e24c..10777e16a 100644 --- a/src/allmydata/util/i2p_provider.py +++ b/src/allmydata/util/i2p_provider.py @@ -147,13 +147,14 @@ class Provider(service.MultiService): sam_port = self._get_i2p_config("sam.port", None) launch = self._get_i2p_config("launch", False, boolean=True) configdir = self._get_i2p_config("i2p.configdir", None) + keyfile = self._get_i2p_config("dest.private_key_file", None) if sam_port: if launch: raise ValueError("tahoe.cfg [i2p] must not set both " "sam.port and launch") ep = clientFromString(self._reactor, sam_port) - return self._i2p.sam_endpoint(ep) + return self._i2p.sam_endpoint(ep, keyfile=keyfile) if launch: executable = self._get_i2p_config("i2p.executable", None) @@ -162,7 +163,7 @@ class Provider(service.MultiService): if configdir: return self._i2p.local_i2p(configdir) - return self._i2p.default(self._reactor) + return self._i2p.default(self._reactor, keyfile=keyfile) def check_dest_config(self): if self._get_i2p_config("dest", False, boolean=True):