Hi again
A few extra considerations.
The underlying problem I had was that urlencode in PHP turns tildes into %7E
1. Up until recently, that was not a problem, suddenly it has become one.
2. I got the idea to use urlencode from libraries, that the
documentation was linking to. Though not being an official spec, it
should be noted in the code that urlencoding will break the assertion.
Better yet, accept urlencoded data...?
3. The PHP-example given in the remote verification API uses raw posted
data, read from the $_POST superglobal array. With the addition of
filters in PHP 5.2, it is recommended to use code like this:
$assertion = filter_input(
INPUT_POST,
'assertion',
FILTER_UNSAFE_RAW,
FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH
);
The flags will remove all ASCII control characters (below 0-31) and
anything above 127. I will update the doc, but please verify that an
assertion never, ever will contain a character not within this range.
Thanks for all help!
1.
https://developer.mozilla.org/en-US/docs/Persona/Remote_Verification_API
2012-11-08 17:58, Lloyd Hilaiel skrev:
> Time for a thursday call to action!
>
> This is lame. Our error message here didn't do Lars any favors. When a
> malformed string is passed to the verifier we say "no certificates
> found" back to the person who is trying to adopt persona.
>
> I filed a bug, it's trivial to make it so the next community member who
> goes to use persona has a better experience:
>
>
https://github.com/mozilla/jwcrypto/issues/54
>
> Integrating the new version of jwcrypto that does a better job of
> telling you what went wrong will require updating verifier tests in
> browserid repo.
>
> I think this is 2 person hours or so. fmarier? bwarner? got some time?
> I volunteer to review and merge or even update verifier tests and add
> new cases of malformed assertions.
>
> can haz better?
>
> lloyd