SSH Will Start Encrypting Secret Keys in Memory


List: openbsd-cvs Subject: CVS: src From: Damien Miller <djm () openbsd ! org> Date: 2019-06-21 4:21:05 Message-ID: eae283c2f381bd19 () openbsd ! org [Download RAW message or body] CVSROOT: /cvs Module name: src Changes by: 2019/06/20 22:21:05 Modified files: usr.bin/ssh : authfd.c authfd.h krl.c krl.h ssh-agent.c ssh-keygen.c sshconnect.c sshconnect.h sshd.c sshkey.c sshkey.h Log message: Add protection for private keys at rest in RAM against speculation and memory sidechannel attacks like Spectre, Meltdown, Rowhammer and Rambleed. This change encrypts private keys when they are not in use with a symmetic key that is derived from a relatively large “prekey” consisting of random data (currently 16KB). Attackers must recover the entire prekey with high accuracy before they can attempt to decrypt the shielded private key, but the current generation of attacks have bit error rates that, when applied cumulatively to the entire prekey, make this unlikely. Implementation-wise, keys are encrypted “shielded” when loaded and then automatically and transparently unshielded when used for signatures or when being saved/serialised.

Hopefully we can remove this in a few years time when computer architecture has become less unsafe.