Changeset 1cda4f3


Ignore:
Timestamp:
2006-05-26T15:02:09Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
6fb6410
Parents:
eecccf1
Message:

Fix some unresolved symbols.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    reecccf1 r1cda4f3  
    528528}
    529529#else
     530int ipc_master_listen_socket()
     531{
    530532        /* FIXME: Open named pipe \\.\BITLBEE */
     533        return 0;
     534}
    531535#endif
    532536
  • irc_commands.c

    reecccf1 r1cda4f3  
    544544                ipc_to_master( cmd );
    545545       
     546#ifndef _WIN32
    546547        irc_reply( irc, 382, "%s :Rehashing", CONF_FILE );
     548#endif
    547549}
    548550
  • protocols/oscar/AUTHORS

    reecccf1 r1cda4f3  
    2828E: awwaiid@auk.cx
    2929D: Figured out original password roasting
    30 
    31 
  • protocols/ssl_sspi.c

    reecccf1 r1cda4f3  
    3232#include <sspi.h>
    3333#include <schannel.h>
     34#include "sock.h"
    3435
    3536static gboolean initialized = FALSE;
     
    4243        gpointer data;
    4344        gboolean established;
    44         int inpa;
    4545        CredHandle cred;                /* SSL credentials */
    4646        CtxtHandle context;             /* SSL context */
    4747        SecPkgContext_StreamSizes sizes;
     48
     49        char *host;
     50
     51        char *pending_raw_data;
     52        gsize pending_raw_data_len;
     53        char *pending_data;
     54        gsize pending_data_len;
    4855};
    4956
    5057static void ssl_connected(gpointer, gint, GaimInputCondition);
    5158
    52 void sspi_global_init( void )
     59void sspi_global_init(void)
    5360{
    5461        /* FIXME */
    5562}
    5663
    57 void sspi_global_deinit( void )
     64void sspi_global_deinit(void)
    5865{
    5966        /* FIXME */
    6067}
    6168
    62 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )
    63 {
    64         struct scd *conn = g_new0( struct scd, 1 );
     69void *ssl_connect(char *host, int port, ssl_input_function func, gpointer data)
     70{
     71        struct scd *conn = g_new0(struct scd, 1);
    6572               
    66         conn->fd = proxy_connect( host, port, ssl_connected, conn );
     73        conn->fd = proxy_connect(host, port, ssl_connected, conn);
     74        sock_make_nonblocking(conn->fd);
    6775        conn->func = func;
    6876        conn->data = data;
    69         conn->inpa = -1;
    70        
    71         if( conn->fd < 0 )
     77        conn->host = g_strdup(host);
     78       
     79        if (conn->fd < 0)
    7280        {
    73                 g_free( conn );
    74                 return( NULL );
    75         }
    76        
    77         if( !initialized )
     81                g_free(conn);
     82                return NULL;
     83        }
     84       
     85        if (!initialized)
    7886        {
    7987                sspi_global_init();
    8088                initialized = TRUE;
    81                 atexit( sspi_global_deinit );
     89                atexit(sspi_global_deinit);
    8290        }
    8391
     
    8593}
    8694
    87 static void ssl_connected(gpointer data, gint fd, GaimInputCondition cond)
    88 {
    89         struct scd *conn = data;
     95static void ssl_connected(gpointer _conn, gint fd, GaimInputCondition cond)
     96{
     97        struct scd *conn = _conn;
    9098        SCHANNEL_CRED ssl_cred;
    9199        TimeStamp timestamp;
     
    97105                ISC_REQ_MANUAL_CRED_VALIDATION;
    98106        ULONG a;
     107        gsize size = 0;
     108        gchar *data = NULL;
    99109
    100110        memset(&ssl_cred, 0, sizeof(SCHANNEL_CRED));
     
    105115
    106116        if (st != SEC_E_OK) {
    107                 conn->func( conn->data, NULL, cond );
     117                conn->func(conn->data, NULL, cond);
    108118                return;
    109        
     119        }
    110120       
    111121        do {
    112122                /* initialize buffers */
    113             ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = buf;
     123            ibuf[0].cbBuffer = size; ibuf[0].pvBuffer = data;
    114124            ibuf[1].cbBuffer = 0; ibuf[1].pvBuffer = NULL;
    115125            obuf[0].cbBuffer = 0; obuf[0].pvBuffer = NULL;
     
    122132            ibufs.pBuffers = ibuf; obufs.pBuffers = obuf;
    123133
    124                 st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, &timestamp); 
     134                st = InitializeSecurityContext(&conn->cred, size?&conn->context:NULL, conn->host, req, 0, SECURITY_NETWORK_DREP, size?&ibufs:NULL, 0, &conn->context, &obufs, &a, &timestamp); 
    125135        if (obuf[0].pvBuffer && obuf[0].cbBuffer) {
     136                        /* FIXME: Check return value */
    126137                        send(conn->fd, obuf[0].pvBuffer, obuf[0].cbBuffer, 0);
    127138                }
     
    131142                        break;
    132143                case SEC_I_CONTINUE_NEEDED:
    133 
     144                        break;
     145                case SEC_E_INCOMPLETE_MESSAGE:
     146                        break;
     147                case SEC_E_OK:
     148                        break;
    134149                }
    135150       
    136 
    137151                QueryContextAttributes(&conn->context, SECPKG_ATTR_STREAM_SIZES, &conn->sizes);
    138152        } while (1);
    139153
    140         conn->func( conn->data, conn, cond );
    141 }
    142 
    143 int ssl_read( void *conn, char *retdata, int len )
     154        conn->func(conn->data, conn, cond);
     155}
     156
     157int ssl_read(void *conn, char *retdata, int len)
    144158{
    145159        struct scd *scd = conn;
     
    165179        SECURITY_STATUS st = DecryptMessage(&scd->context, &msg, 0, NULL);
    166180
     181        if (st != SEC_E_OK) {
     182                /* FIXME */
     183                return -1;
     184        }
     185
    167186        for (i = 0; i < 4; i++) {
    168187                if (buf[i].BufferType == SECBUFFER_DATA) {
     
    173192
    174193        g_free(data);
    175         return( -1 );
    176 }
    177 
    178 int ssl_write( void *conn, const char *userdata, int len )
     194        return -1;
     195}
     196
     197int ssl_write(void *conn, const char *userdata, int len)
    179198{
    180199        struct scd *scd = conn;
     
    214233}
    215234
    216 void ssl_disconnect( void *conn )
     235void ssl_disconnect(void *conn)
    217236{
    218237        struct scd *scd = conn;
     
    244263        FreeCredentialsHandle(&scd->cred);
    245264
    246         closesocket( scd->fd );
     265        closesocket(scd->fd);
     266        g_free(scd->host);
    247267        g_free(scd);
    248268}
    249269
    250 int ssl_getfd( void *conn )
    251 {
    252         return( ((struct scd*)conn)->fd );
    253 }
     270int ssl_getfd(void *conn)
     271{
     272        return ((struct scd*)conn)->fd;
     273}
     274
     275GaimInputCondition ssl_getdirection( void *conn )
     276{
     277        return GAIM_INPUT_WRITE; /* FIXME: or GAIM_INPUT_READ */
     278}
Note: See TracChangeset for help on using the changeset viewer.