Description of problem:
Generating of RSASHA1 keys is very slow since openssl upgrade.
It seems that last working version is openssl-1.0.1e-4.fc19.1.x86_64
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. dnssec-keygen example.com
It takes minutes to generate the key.
It takes less than a second to generate the key.
This is actually a fixed bug. dnssec-keygen changes RNG in OpenSSL so it reads random numbers directly from /dev/random. There was a bug in the old openssl builds that made OpenSSL to ignore the RNG engine modification.
You can use -r /dev/urandom to speed the key generation up.
I see. Does it mean that /dev/urandom was used before the fix? Are the keys generated before less secure?
Yes, to the first question. To the second question - theoretically they are less secure, but in practice this is not a real problem unless you generate the keys on a machine that has almost no entropy source and do it immediately after installation. As there always is at least some entropy source and the previous RNG state is saved and reloaded on reboot the keys generated after some time of the machine running after installation should be secure enough.
Note that for example ssh-keygen uses the /dev/urandom as well.
Using /dev/random is in general not recommended unless you have a fast entropy source - possibly hardware one. And even more the dnssec-keygen does it in a wrong way because it reads much more random bytes than necessary from the /dev/random.
Great explanation. Thank you! I'm fine with that.