Changeset b38d399 for lib/base64.h


Ignore:
Timestamp:
2014-11-24T05:16:09Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
9f8bb17
Parents:
e2472dd
Message:

Use glib functions for base64 decoding/encoding

This fixes several coverity warnings about 'tainted data index sink' and
a fixme about thread safety in the old base64_decode implementation.

Had to adapt the code that used base64_encode_real:

  • oauth.c: different character set order, but it's for the nonce so it doesn't matter
  • libyahoo2.c: used as part of the auth, changes "+/=" into "._-". Fixed by encoding first the usual way through glib, then replacing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/base64.h

    re2472dd rb38d399  
    2828G_MODULE_EXPORT char *tobase64( const char *text );
    2929G_MODULE_EXPORT char *base64_encode( const unsigned char *in, int len );
    30 G_MODULE_EXPORT int base64_encode_real( const unsigned char *in, int inlen, unsigned char *out, const char *b64digits );
    3130G_MODULE_EXPORT char *frombase64( const char *in );
    3231G_MODULE_EXPORT int base64_decode( const char *in, unsigned char **out );
    33 G_MODULE_EXPORT int base64_decode_real( const unsigned char *in, unsigned char *out, char *b64reverse );
Note: See TracChangeset for help on using the changeset viewer.