It seems like ClientThread() and TunnelThread() both use the same keyfile, at the same offset. This means that key material is used twice, not once, enabling a MITM attacker to recover plaintext.
You might want to only use key material once, not twice.
It seems like
ClientThread()
andTunnelThread()
both use the same keyfile, at the same offset. This means that key material is used twice, not once, enabling a MITM attacker to recover plaintext. You might want to only use key material once, not twice.