- Timestamp:
- 2006-06-25T14:07:01Z (19 years ago)
- Branches:
- master
- Children:
- 6e1fed7
- Parents:
- df1694b
- Location:
- lib
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/Makefile
rdf1694b r7ed3199 10 10 11 11 # [SH] Program variables 12 objects = $(EVENT_HANDLER) http_client.o ini.o md5.o misc.o proxy.o rc4.o sha.o $(SSL_CLIENT) url.o12 objects = base64.o $(EVENT_HANDLER) http_client.o ini.o md5.o misc.o proxy.o rc4.o sha.o $(SSL_CLIENT) url.o 13 13 14 14 CFLAGS += -Wall -
lib/misc.c
rdf1694b r7ed3199 82 82 83 83 return ret; 84 }85 86 char *tobase64(const char *text)87 {88 char *out;89 int len;90 91 len = strlen(text);92 out = g_malloc((len + 2) /* the == padding */93 / 3 /* every 3-byte block */94 * 4 /* becomes a 4-byte one */95 + 1); /* and of course, ASCIIZ! */96 97 base64_encode_real(text, len, out, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");98 99 return out;100 }101 102 void base64_encode_real(const unsigned char *in, int inlen, unsigned char *out, char *b64digits)103 {104 for (; inlen >= 3; inlen -= 3)105 {106 *out++ = b64digits[in[0] >> 2];107 *out++ = b64digits[((in[0]<<4) & 0x30) | (in[1]>>4)];108 *out++ = b64digits[((in[1]<<2) & 0x3c) | (in[2]>>6)];109 *out++ = b64digits[in[2] & 0x3f];110 in += 3;111 }112 if (inlen > 0)113 {114 *out++ = b64digits[in[0] >> 2];115 if (inlen > 1)116 {117 *out++ = b64digits[((in[0]<<4) & 0x30) | (in[1]>>4)];118 *out++ = b64digits[((in[1]<<2) & 0x3c)];119 }120 else121 {122 *out++ = b64digits[((in[0]<<4) & 0x30) | (in[1]>>4)];123 *out++ = b64digits[64];124 }125 *out++ = b64digits[64];126 }127 *out = '\0';128 84 } 129 85 -
lib/misc.h
rdf1694b r7ed3199 30 30 G_MODULE_EXPORT char *add_cr( char *text ); 31 31 G_MODULE_EXPORT char *strip_newlines(char *source); 32 G_MODULE_EXPORT char *tobase64( const char *text );33 G_MODULE_EXPORT void base64_encode_real( const unsigned char *in, int inlen, unsigned char *out, char *b64digits );34 32 G_MODULE_EXPORT char *normalize( const char *s ); 35 33 G_MODULE_EXPORT void info_string_append( GString *str, char *newline, char *name, char *value ); -
lib/proxy.c
rdf1694b r7ed3199 41 41 #include "nogaim.h" 42 42 #include "proxy.h" 43 #include "base64.h" 43 44 44 45 char proxyhost[128] = ""; -
lib/rc4.c
rdf1694b r7ed3199 5 5 * * 6 6 * Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net> * 7 * *8 7 * * 9 8 * This program is free software; you can redistribute it and/or modify * -
lib/rc4.h
rdf1694b r7ed3199 5 5 * * 6 6 * Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net> * 7 * *8 7 * * 9 8 * This program is free software; you can redistribute it and/or modify *
Note: See TracChangeset
for help on using the changeset viewer.