[OpenID] Random failures when validating signatures

Richard Davies richard at richarddavies.us
Fri Nov 14 00:06:34 UTC 2008


On Nov 13, 9:30 am, Richard Davies <rich... at richarddavies.us> wrote:
> Oh. Good suggestion. I have a btwoc() function to convert my integers
> into strings, but I don't think I was paying particular attention to
> how I was "unbtwoc()" the server_public value. I'll take a look at
> that. Thanks.

I'm using Java BigIntegers to store my numbers. As far as I can tell,
it looks like this class stores them internally in the same format
that btwoc() produces. In other words, the BigInteger.toByteArray()
method seems to be equivalent to btwoc(). And when I create a
BigInteger from a byte array (such as the server_public value), it
correctly accounts for the leading 0 byte to make the number positive.
So, as far as I can tell, I am handling the signed numbers correctly
because BigInteger handles those details for me behind the scenes.

So I'm back to square one. About half of the time, it's reporting that
the signature is invalid and I'm not where where I'm messing up in the
validation process. I still think it may be a character encoding
issue, but I'm not sure. Any other suggestions?



More information about the general mailing list