Bug fixes + framework implementation needed by OpenSSH's sshd