aboutsummaryrefslogtreecommitdiffstats
path: root/lib/oauth.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-03-27 15:09:55 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2011-03-27 15:09:55 +0100
commitce617f0a445df1201808a9cd29722a9cf6c96b95 (patch)
tree6ac7212932eca89a84bb311345c40149f7a2dde1 /lib/oauth.c
parentff9456329255ef8b227f9322ca8d25ef6c790e7e (diff)
Tweaks to allow authenticating to identi.ca with OAuth. Doesn't seem to work
completely for whatever the reason may be (invalid signature). I give up for now. Stuff does actually work if you generate access tokens using different software so BitlBee's definitely able to generate good signatures.
Diffstat (limited to 'lib/oauth.c')
-rw-r--r--lib/oauth.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/oauth.c b/lib/oauth.c
index 14e7797c..9c67363a 100644
--- a/lib/oauth.c
+++ b/lib/oauth.c
@@ -107,10 +107,14 @@ static char *oauth_sign( const char *method, const char *url,
static char *oauth_nonce()
{
- unsigned char bytes[9];
+ unsigned char bytes[21];
+ char *ret = g_new0( char, sizeof( bytes) / 3 * 4 + 1 );
random_bytes( bytes, sizeof( bytes ) );
- return base64_encode( bytes, sizeof( bytes ) );
+ base64_encode_real( bytes, sizeof( bytes), (unsigned char*) ret, "0123456789"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0A" );
+
+ return ret;
}
void oauth_params_add( GSList **params, const char *key, const char *value )