php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58921 Character encoding causing auth problems
Submitted: 2009-10-26 15:33 UTC Modified: 2010-05-03 09:49 UTC
From: jrossiter at dlvr dot it Assigned: datibbaw (profile)
Status: No Feedback Package: oauth (PECL)
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
 [2009-10-26 15:33 UTC] jrossiter at dlvr dot it
Description:
------------
The issue described in this Twitter-API bug (http://code.google.com/p/twitter-api/issues/detail?id=433) still seems to be affecting this library.

Posting to Twitter with a message containing "?" is failing with Bad Auth.

Reproduce code:
---------------
$msg = "Blah Blah ?";
$oauth = new OAuth(self::$oauth_key, self::$oauth_sec, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
$oauth->setToken($cred['token'],$cred['secret']);
$oauth->disableSSLChecks();
$oauth->fetch("https://www.twitter.com/statuses/update.json", array('status' => $msg),  OAUTH_HTTP_METHOD_POST);

Expected result:
----------------
Request is made with correct signature/data.

Actual result:
--------------
Request fails due to apparent signature/data mismatch.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-26 17:38 UTC] jrossiter at dlvr dot it
Note, specifically this fails with chr(0xe9).  Frequently during file editing this is converted to chr(0xc3).chr(0xa9) which works fine.

A revision to the reproduction code... it only fails if there are characters *after* the 0xe9 char.
 [2009-10-31 15:07 UTC] jawed@php.net
Thanks for the bug report, I will investigate further.
 [2009-11-06 09:22 UTC] datibbaw@php.net
Hi,

What version of OAuth are you using?

Please run the following:
$ php -dextension=oauth.so --ri oauth
 [2009-11-06 14:47 UTC] jrossiter at dlvr dot it
I swear that I had to input that when entering the bug - don't know why it isn't recorded.

OAuth

OAuth support => enabled
PLAINTEXT support => not supported
RSA-SHA1 support => not supported
HMAC-SHA1 support => enabled
source version => $Id: oauth.c,v 1.56 2009/05/10 06:40:59 jawed Exp $
version => 0.99.9
 [2009-11-06 19:32 UTC] datibbaw@php.net
I couldn't reproduce this on my own branch; feel free to give it a spin, it's in the OAUTH_1A_STREAMS branch which has some added features such as support for PHP streams and forward compatibility for Unicode support.

I'll try the trunk version as well to see what has changed in the meantime
 [2009-12-04 19:06 UTC] jrossiter at dlvr dot it
I encountered another issue along the same lines and finally had a chance to try out the OAUTH_1A_STREAMS branch.

It did seem to resolve the problem, but we'll be testing it further.  I haven't tried it with this bug's specific test case yet.
 [2010-05-03 09:49 UTC] datibbaw@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC