Can't login with ssh: "Couldn't obtain random bytes"

After installing tor package, after a while I can’t login with ssh. Log shows this error:

Aug 10 16:57:33 turris sshd-session[12549]: Accepted password for root from 172.27.140.9 port 49222 ssh2
Aug 10 16:57:33 turris sshd-session[12558]: fatal: Couldn't obtain random bytes (error 0x2015016)

At the same time, I can’t open Luci. Error is:
/usr/lib/lua/luci/dispatcher.lua:431: /etc/config/luci seems to be corrupt, unable to find section 'main'
but /etc/config/luci looks fine.

I have a serial console. I can see haveged daemon is running in htop.
I tried starting /etc/init.d/atsha204-feed-entropy, but no change.
cat /proc/sys/kernel/random/entropy_avail returns 256
/sys/devices/virtual/misc/hw_random/rng_available is empty. There should be a hardware RNG provided by the two ath9k wifi cards.

Help?

According to this bug report, this is caused by openssl-devcrypto engine with digests enabled, but in /etc/ssl/engines.cnf.d/devcrypto.cnf, the DIGESTS line is commented out and the default is “none”.
I wonder if it could be caused by ECB ciphers enabled, because the CIPHERS line is also commented out, has the same warning, but the default is “all”.

I uncommented both those lines and rebooted. Will see if it happens again.