mozilla/browserid — pull request #2633 by lloyd (2012-10-23 21:40:51+00:00)
Title: Fix primary support on dev

This PR should fix primary support on dev. Specifically, our support was broken during key generation and certification post in-dialog authentication. This likely introduced with 3e49e6f06060e7ff03db1316f49644808cde88e7 where we removed a call to session_context at dialog startup.

A side effect of calling session_context is that it gets server supplied entropy to seed jwcrypto's random number generator. With shane's optimization, apparently session_context was getting called before generateKeypair for all codepaths except `#AUTH_RETURN` - the path where we return from the IdP after an in-dialog redirect.

This PR fixes the problem by calling `session_context` during provisioning if it has not yet been called, to ensure the PRNG is seeded.