hammer2 - Implement aes_256_cbc session encryption
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 13 May 2012 00:43:17 +0000 (17:43 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 13 May 2012 00:53:47 +0000 (17:53 -0700)
commit5cf97ec5e50db147a4b71da930cbf41b7ce49b95
tree3b1292a588fbc88ff5e72040a3d2d6b4885bad9f
parentd365564473a20a528d07c59cad8ee2f4bea5546f
hammer2 - Implement aes_256_cbc session encryption

* The AES session key and initial iv[] are transmitted in the public key
  exchange.

* The actual AES session key and initial iv[] is the data received XOR'd
  with the data sent, so if the public key exchange is broken (even if
  the verifier succeeds), the rest of the session will die a horrible
  death.

* We use aes_256_cbc and in addition to the iv[] being adjusted by the
  data in-flight we also inject some random data in each message header
  to mix iv[] up even more than it would be normally.

* We also check the message sequence number, which is embedded in the
  random data (the raw msg header's salt field), though the iv[] should
  catch any replays.

* NOTE: Verifier is still weak, but the session key and iv[] exchange
  is very strong.
sbin/hammer2/cmd_rsa.c
sbin/hammer2/crypto.c
sbin/hammer2/hammer2.h
sbin/hammer2/msg.c
sbin/hammer2/network.h