Changeset ce617f0 for lib


Ignore:
Timestamp:
2011-03-27T14:09:55Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f01bc6f
Parents:
ff94563
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/oauth.c

    rff94563 rce617f0  
    108108static char *oauth_nonce()
    109109{
    110         unsigned char bytes[9];
     110        unsigned char bytes[21];
     111        char *ret = g_new0( char, sizeof( bytes) / 3 * 4 + 1 );
    111112       
    112113        random_bytes( bytes, sizeof( bytes ) );
    113         return base64_encode( bytes, sizeof( bytes ) );
     114        base64_encode_real( bytes, sizeof( bytes), (unsigned char*) ret, "0123456789"
     115                            "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0A" );
     116       
     117        return ret;
    114118}
    115119
Note: See TracChangeset for help on using the changeset viewer.