我有一个应用程序,它是一个支持以下协商关键算法的 SSH 客户端。
diffie-hellman-group-exchange-sha1 diffie-hellman-group14-sha1 diffie-hellman-group-exchange-sha256
我没有更改 SSH 客户端的选项,因此我正在尝试解决使用 Twisted 的 SSH 服务器上的问题。SSH 服务器实际上是在 Kippo 蜜罐中实现的,但根本问题在于 Twisted。
我看到 Twisted 在第 221 行支持 diffie-hellman-group-exchange-sha1 和 diffie-hellman-group1-sha1: https ://github.com/twisted/twisted/blob/38421d6fcffa1ddb590e51df0e1c6cba6f29d052/twisted/conch/ssh/transport .py
我看到 diffie-hellman-group-exchange-sha1 在第 60 行被禁用: py" rel="nofollow">https://github.com/twisted/twisted/blob/38421d6fcffa1ddb590e51df0e1c6cba6f29d052/twisted/conch/ssh/factory.py
diffie-hellman-group-exchange-sha1 支持但后来被禁用。我的应用程序的 SSH 客户端无法协商密钥以建立与使用 Twisted 的 SSH 服务器的 SSH 连接。
我在禁用它之前在代码中看到了这个注释“log.msg('disabling diffie-hellman-group-exchange,因为我们找不到模文件')”如果我尝试强制 Twisted 使用 diffie-hellman-group-exchange- sha1 我收到以下错误。
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 586, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 199, in doRead
rval = self.protocol.dataReceived(data)
File "/home/sudopwn/kippo-master/kippo/core/ssh.py", line 150, in dataReceived
transport.SSHServerTransport.dataReceived(self, data)
File "/usr/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 438, in dataReceived
self.dispatchMessage(messageNum, packet[1:])
File "/usr/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 453, in dispatchMessage
f(payload)
File "/usr/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 950, in ssh_KEX_DH_GEX_REQUEST
self.g, self.p = self.factory.getDHPrime(ideal)
File "/usr/lib/python2.7/dist-packages/twisted/conch/ssh/factory.py", line 126, in getDHPrime
primesKeys = self.primes.keys()
exceptions.AttributeError: 'NoneType' object has no attribute ‘keys'
是否有允许启用 diffie-hellman-group-exchange-sha1 的解决方法或解决方案?