[OTR-dev] Hang during key generation

Gabriel Schulhof nix at go-nix.ca
Mon Jul 2 00:10:15 EDT 2007


Hi!

On Mon, July 2, 2007 00:22, Ian Goldberg wrote:
> It's gathering randomness from /dev/random.  Normally, the kernel will
> block reads until some randomish events happen (mouse moves, disk reads,
> etc.).

That's what I figured out later on. I also found that libgcrypt can be
passed a progress function pointer that is then called with parameters
indicating what libgcrypt needs and what it's doing and how complete it
is:

void gcry_set_progress_handler (gcry_handler_progress_t CB, void *CB_DATA);

where

void (*gcry_handler_progress_t) (void *, const char *, int, int, int);

I'm thinking about putting a wrapper for this mechanism into libotr, so I
can in turn pass a function pointer to libotr and not only make the
"Please wait" dialog responsive (by executing
while(g_main_context_iteration(NULL, FALSE)); inside the progress
handler), but also maybe add a "Cancel" option.

However, before I proceed I need to study the code for both pidgin-otr and
libotr a little further, because I need to see all the uses pidgin-otr
makes of libotr and which of those uses involve long operations. I also
need to see just how often libgcrypt calls the progress handler, since
libgcrypt itself doesn't do the select() inside a main loop :o(

I will try to experiment with these things. If the progress indicator
works as advertised, it might even tell what kinds of things are
considered sources of randomness on Maemo.

Cheers,



Gabriel



More information about the OTR-dev mailing list