[OTR-dev] Hang during key generation

Ian Goldberg ian at cypherpunks.ca
Sun Jul 1 17:22:26 EDT 2007

On Sun, Jul 01, 2007 at 07:10:16PM +0300, Gabriel Schulhof wrote:
> Hi!
> I've started to hack on a Maemo port for pidgin-otr, and I've run into my
> first hurdle:
> When I push the "Generate" button int the config dialog, it causes Pidgin
> to hang. I have stepped through both pidgin-otr and libotr and the crucial
> call seems to be
> privkey.c:414: gcry_pk_genkey(&key, parms);
> This hangs in such a way that there's no CPU activity and, when I
> interrupt the process, it tells me it's inside select() - so, waiting for
> events, I assume. Now, I realize that's inside libgcrypt and not libotr,
> but I'm just wondering if someone on this list has encountered this
> behaviour before, and if so, what the resolution towards successful key
> creation was.
> TIA for your help,

It's gathering randomness from /dev/random.  Normally, the kernel will
block reads until some randomish events happen (mouse moves, disk reads,
etc.).  I don't know what the Maemo does for randomness.  If all else
fails, change libgcrypt to read from /dev/urandom instead; you'll get
cryptographic randomness instead of entropic randomness, but in all
honesty, that's usually good enough.

   - Ian

More information about the OTR-dev mailing list