mozilla/browserid-crypto — pull request #102 by rfk (2014-10-24 06:39:32+00:00)
Title: Dont forcibly upgrade old-format keys during serialization

As noted in:

https://github.com/mozilla/fxa-auth-server/pull/831

It is currently impossible to upgrade fxa-auth-server to use the latest version of browserid-crypto, due to a bad interaction in handling old-format data. When the server signs a client's old-format pubkey, it converts the serialized version into the new format. When the client then goes to use that signed certificate with an old-format assertion, confusion happens.

Given that we're not going to push for new-format structures any time soon, it seems like the simplest solution is to preserve the original formatting during serialization - old-format keys should get old-format serialization, new-format keys should be new-format serialization.

@callahad @fmarier thoughts?

Oh, and as an added bonus, this PR also removes an accidental duplicate serialization of the pubkey when signing a certificate.