Changeset 3710

Show
Ignore:
Timestamp:
08/11/07 12:40:01 (1 year ago)
Author:
timothy
Message:

Fix the majority of the compile warnings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Chat Core.xcodeproj/project.pbxproj

    r3662 r3710  
    44        classes = { 
    55        }; 
    6         objectVersion = 43
     6        objectVersion = 44
    77        objects = { 
    88 
     
    824824                                        i386, 
    825825                                ); 
    826                                 SDKROOTS = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 
     826                                SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 
    827827                                SYMROOT = build; 
    828828                        }; 
  • trunk/Chat Core/ICBPacket.m

    r3582 r3710  
    173173                const NSString *f = [_fields objectAtIndex:i]; 
    174174 
    175                 length = strlcat(data, [f cString], maxDataLength); 
     175                length = strlcat(data, [f UTF8String], maxDataLength); 
    176176                if (i < [_fields count] - 1) 
    177177                        length = strlcat(data, "\x01", maxDataLength); 
  • trunk/Chat Core/InterThreadMessaging.m

    r3709 r3710  
    180180+ (void) threadDied:(NSNotification *)notification 
    181181{ 
    182     NSThread *thread; 
    183     NSRunLoop *runLoop; 
    184  
    185     thread = [notification object]; 
    186     removeMessagePortForThread(thread); 
     182    removeMessagePortForThread([notification object]); 
    187183} 
    188184 
  • trunk/Colloquy.xcodeproj/project.pbxproj

    r3662 r3710  
    44        classes = { 
    55        }; 
    6         objectVersion = 43
     6        objectVersion = 44
    77        objects = { 
    88 
     
    30763076                                        i386, 
    30773077                                ); 
    3078                                 SDKROOTS = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 
     3078                                SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 
    30793079                                SYMROOT = build; 
    30803080                        }; 
  • trunk/Frameworks/AGRegex/pcre-6.7/pcre_compile.c

    r3642 r3710  
    806806  thisname = ptr; 
    807807  while (*ptr != '>') ptr++; 
    808   if (namelen == ptr - thisname && strncmp(name, thisname, namelen) == 0) 
     808  if (namelen == ptr - thisname && strncmp((const char *)name, (const char *)thisname, namelen) == 0) 
    809809    return count; 
    810810  } 
  • trunk/Frameworks/Acid/Acid.xcodeproj/project.pbxproj

    r3645 r3710  
    44        classes = { 
    55        }; 
    6         objectVersion = 42
     6        objectVersion = 44
    77        objects = { 
    88 
     
    5959/* Begin PBXFileReference section */ 
    6060                0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 
     61                1CF24BB60C6E2648006BD6A5 /* keycache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keycache.h; sourceTree = "<group>"; }; 
     62                1CF24BFC0C6E26F2006BD6A5 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = "<group>"; }; 
    6163                8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 
    6264                8DC2EF5B0486A6940098B216 /* Acid.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Acid.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 
     
    306308                        children = ( 
    307309                                DD8ADFA50BD1741A009AB74D /* base64.c */, 
     310                                1CF24BFC0C6E26F2006BD6A5 /* base64.h */, 
    308311                                DD8ADFA60BD1741A009AB74D /* buffer.c */, 
    309312                                DD8ADFA70BD1741A009AB74D /* buffer.h */, 
     
    311314                                DD8ADFA90BD1741A009AB74D /* esession.h */, 
    312315                                DD8ADFAA0BD1741A009AB74D /* keycache.c */, 
     316                                1CF24BB60C6E2648006BD6A5 /* keycache.h */, 
    313317                        ); 
    314318                        path = esession; 
     
    404408                        projectDirPath = ""; 
    405409                        projectRoot = ""; 
    406                         shouldCheckCompatibility = 1; 
    407410                        targets = ( 
    408411                                8DC2EF4F0486A6940098B216 /* Acid */, 
     
    514517                                        i386, 
    515518                                ); 
    516                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk
     519                                SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"
    517520                        }; 
    518521                        name = "Release (Universal)"; 
  • trunk/Frameworks/Acid/expat/xmlparse.c

    r3640 r3710  
    13181318    XML_T("unexpected parser state - please send a bug report") 
    13191319  }; 
    1320   if (code > 0 && code < sizeof(message)/sizeof(message[0])) 
     1320  if (code > 0 && (unsigned int)code < sizeof(message)/sizeof(message[0])) 
    13211321    return message[code]; 
    13221322  return 0; 
     
    27352735      if (attlistDeclHandler) 
    27362736      { 
    2737         char *prefix;                        
     2737        const char *prefix;                        
    27382738        if (declAttributeType) { 
    27392739          prefix = "|";                    
  • trunk/Frameworks/Acid/expat/xmltok.c

    r3640 r3710  
    170170 E ## isInvalid3, \ 
    171171 E ## isInvalid4 
     172 
     173#define NULL_NORMAL_VTABLE() \ 
     174 NULL, \ 
     175 NULL, \ 
     176 NULL, \ 
     177 NULL, \ 
     178 NULL, \ 
     179 NULL, \ 
     180 NULL, \ 
     181 NULL, \ 
     182 NULL 
    172183 
    173184static int checkCharRefNumber(int); 
     
    411422#include "latin1tab.h" 
    412423  }, 
    413   STANDARD_VTABLE(sb_) 
     424  STANDARD_VTABLE(sb_) NULL_NORMAL_VTABLE() 
    414425}; 
    415426 
     
    424435#include "latin1tab.h" 
    425436  }, 
    426   STANDARD_VTABLE(sb_) 
     437  STANDARD_VTABLE(sb_) NULL_NORMAL_VTABLE() 
    427438}; 
    428439 
     
    444455/* BT_NONXML == 0 */ 
    445456  }, 
    446   STANDARD_VTABLE(sb_) 
     457  STANDARD_VTABLE(sb_) NULL_NORMAL_VTABLE() 
    447458}; 
    448459 
     
    457468/* BT_NONXML == 0 */ 
    458469  }, 
    459   STANDARD_VTABLE(sb_) 
     470  STANDARD_VTABLE(sb_) NULL_NORMAL_VTABLE() 
    460471}; 
    461472 
     
    667678#include "latin1tab.h" 
    668679  }, 
    669   STANDARD_VTABLE(little2_) 
     680  STANDARD_VTABLE(little2_) NULL_NORMAL_VTABLE() 
    670681}; 
    671682 
     
    686697#include "latin1tab.h" 
    687698  }, 
    688   STANDARD_VTABLE(little2_) 
     699  STANDARD_VTABLE(little2_) NULL_NORMAL_VTABLE() 
    689700}; 
    690701 
     
    699710#include "latin1tab.h" 
    700711  }, 
    701   STANDARD_VTABLE(little2_) 
     712  STANDARD_VTABLE(little2_) NULL_NORMAL_VTABLE() 
    702713}; 
    703714 
     
    712723#include "latin1tab.h" 
    713724  }, 
    714   STANDARD_VTABLE(little2_) 
     725  STANDARD_VTABLE(little2_) NULL_NORMAL_VTABLE() 
    715726}; 
    716727 
     
    806817#include "latin1tab.h" 
    807818  }, 
    808   STANDARD_VTABLE(big2_) 
     819  STANDARD_VTABLE(big2_) NULL_NORMAL_VTABLE() 
    809820}; 
    810821 
     
    825836#include "latin1tab.h" 
    826837  }, 
    827   STANDARD_VTABLE(big2_) 
     838  STANDARD_VTABLE(big2_) NULL_NORMAL_VTABLE() 
    828839}; 
    829840 
     
    838849#include "latin1tab.h" 
    839850  }, 
    840   STANDARD_VTABLE(big2_) 
     851  STANDARD_VTABLE(big2_) NULL_NORMAL_VTABLE() 
    841852}; 
    842853 
     
    851862#include "latin1tab.h" 
    852863  }, 
    853   STANDARD_VTABLE(big2_) 
     864  STANDARD_VTABLE(big2_) NULL_NORMAL_VTABLE() 
    854865}; 
    855866 
  • trunk/Frameworks/Acid/jabber/JabberID.m

    r3641 r3710  
    267267-(id) initWithEscapedString:(NSString*)jidstring 
    268268{ 
    269     return [self initWithString:[XMLCData unescape:[jidstring cString] ofLength:[jidstring length]]]; 
     269    NSData *jidstringData = [jidstring dataUsingEncoding:NSUTF8StringEncoding]; 
     270    return [self initWithString:[XMLCData unescape:[jidstringData bytes] ofLength:[jidstringData length]]]; 
    270271} 
    271272 
  • trunk/Frameworks/Acid/jabber/JabberRoster.m

    r3640 r3710  
    378378{ 
    379379    // XXX: There should probably be some code for handling errors here. 
    380     //NSLog(@"Roster update result: %@", n); 
    381380} 
    382381 
  • trunk/Frameworks/Acid/jabber/JabberStdAuthManager.m

    r3640 r3710  
    8383    unsigned char digest[20]; 
    8484 
     85    NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding]; 
     86 
    8587    SHA1Init(&ctx); 
    86     SHA1Update(&ctx, (const unsigned char *)[password cString], [password cStringLength]); 
     88    SHA1Update(&ctx, [passwordData bytes], [passwordData length]); 
    8789    SHA1Final(digest, &ctx); 
    8890 
  • trunk/Frameworks/Acid/jabber/JabberSubscriptionRequest.m

    r3641 r3710  
    5656    QRY_MESSAGE = [[XPathQuery alloc] initWithPath:@"/presence/status"]; 
    5757    PRESSUBTYPE = [[NSDictionary alloc] initWithObjectsAndKeys: 
    58         JSUBSCRIBE, @"subscribe", 
    59         JSUBSCRIBED, "@subscribed", 
    60         JUNSUBSCRIBE, "@unsubscribed", 
    61         JUNSUBSCRIBED, "@unsubscribed", nil]; 
     58                   [NSNumber numberWithLong:JSUBSCRIBE], @"subscribe", 
     59                   [NSNumber numberWithLong:JSUBSCRIBED], "@subscribed", 
     60                   [NSNumber numberWithLong:JUNSUBSCRIBE], "@unsubscribed", 
     61                   [NSNumber numberWithLong:JUNSUBSCRIBED], "@unsubscribed", nil]; 
    6262} 
    6363 
     
    8585    [_message release]; 
    8686    _message = [[QRY_MESSAGE queryForString:self] retain]; 
    87     _type    = (JabberSubscriptionType)[PRESSUBTYPE objectForKey:[self getAttribute:@"type"]]; 
    88     NSLog(@"Re-synced presence subscription request(%d): %@", _type, self); 
     87    _type    = [[PRESSUBTYPE objectForKey:[self getAttribute:@"type"]] longValue]; 
    8988} 
    9089 
     
    113112{ 
    114113    JabberSubscriptionRequest* r; 
    115     NSLog(@"DEBUG Granted subscription request from %@", _from); 
    116114 
    117115    r = [[JabberSubscriptionRequest alloc] initWithRecipient:_from]; 
  • trunk/Frameworks/Acid/utility/esession/base64.c

    r3640 r3710  
    6565#include <stdlib.h> 
    6666#include <string.h> 
    67  
    68 /* Pre-decls */ 
    69 int ap_base64decode_binary(unsigned char *bufplain, const char *bufcoded); 
    70 int ap_base64encode_binary(char *encoded, const unsigned char *string, int len); 
     67#include "base64.h" 
    7168 
    7269/* aaaack but it's fast and const should make it shared text page. */ 
     
    107104} 
    108105 
     106static int ap_base64decode_binary(unsigned char *bufplain, 
     107                                   const char *bufcoded) 
     108{ 
     109    int nbytesdecoded; 
     110    register const unsigned char *bufin; 
     111    register unsigned char *bufout; 
     112    register int nprbytes; 
     113 
     114    bufin = (const unsigned char *) bufcoded; 
     115    while (pr2six[*(bufin++)] <= 63); 
     116    nprbytes = (bufin - (const unsigned char *) bufcoded) - 1; 
     117    nbytesdecoded = ((nprbytes + 3) / 4) * 3; 
     118 
     119    bufout = (unsigned char *) bufplain; 
     120    bufin = (const unsigned char *) bufcoded; 
     121 
     122    while (nprbytes > 4) { 
     123        *(bufout++) = 
     124            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); 
     125        *(bufout++) = 
     126            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); 
     127        *(bufout++) = 
     128            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); 
     129        bufin += 4; 
     130        nprbytes -= 4; 
     131    } 
     132 
     133    /* Note: (nprbytes == 1) would be an error, so just ingore that case */ 
     134    if (nprbytes > 1) { 
     135        *(bufout++) = 
     136            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); 
     137    } 
     138    if (nprbytes > 2) { 
     139        *(bufout++) = 
     140            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); 
     141    } 
     142    if (nprbytes > 3) { 
     143        *(bufout++) = 
     144            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); 
     145    } 
     146 
     147    nbytesdecoded -= (4 - nprbytes) & 3; 
     148    return nbytesdecoded; 
     149} 
     150 
    109151int ap_base64decode(char *bufplain, const char *bufcoded) 
    110152{ 
     
    116158} 
    117159 
    118 int ap_base64decode_binary(unsigned char *bufplain, 
    119                                    const char *bufcoded) 
    120 { 
    121     int nbytesdecoded; 
    122     register const unsigned char *bufin; 
    123     register unsigned char *bufout; 
    124     register int nprbytes; 
    125  
    126     bufin = (const unsigned char *) bufcoded; 
    127     while (pr2six[*(bufin++)] <= 63); 
    128     nprbytes = (bufin - (const unsigned char *) bufcoded) - 1; 
    129     nbytesdecoded = ((nprbytes + 3) / 4) * 3; 
    130  
    131     bufout = (unsigned char *) bufplain; 
    132     bufin = (const unsigned char *) bufcoded; 
    133  
    134     while (nprbytes > 4) { 
    135         *(bufout++) = 
    136             (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); 
    137         *(bufout++) = 
    138             (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); 
    139         *(bufout++) = 
    140             (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); 
    141         bufin += 4; 
    142         nprbytes -= 4; 
    143     } 
    144  
    145     /* Note: (nprbytes == 1) would be an error, so just ingore that case */ 
    146     if (nprbytes > 1) { 
    147         *(bufout++) = 
    148             (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); 
    149     } 
    150     if (nprbytes > 2) { 
    151         *(bufout++) = 
    152             (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); 
    153     } 
    154     if (nprbytes > 3) { 
    155         *(bufout++) = 
    156             (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); 
    157     } 
    158  
    159     nbytesdecoded -= (4 - nprbytes) & 3; 
    160     return nbytesdecoded; 
    161 } 
    162  
    163160static const char basis_64[] = 
    164161    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 
    165162 
    166 int ap_base64encode_len(int len) 
     163static int ap_base64encode_len(int len) 
    167164{ 
    168165    return ((len + 2) / 3 * 4) + 1; 
    169166} 
    170167 
    171 int ap_base64encode(char *encoded, const char *string, int len) 
    172 
    173     return ap_base64encode_binary(encoded, (const unsigned char *) string, len); 
    174 
    175  
    176 int ap_base64encode_binary(char *encoded, 
     168static int ap_base64encode_binary(char *encoded, 
    177169                                       const unsigned char *string, int len) 
    178170{ 
     
    207199} 
    208200 
     201static int ap_base64encode(char *encoded, const char *string, int len) 
     202{ 
     203    return ap_base64encode_binary(encoded, (const unsigned char *) string, len); 
     204} 
     205 
    209206/* convenience functions for j2 */ 
    210207char *b64_encode(char *buf, int len) { 
  • trunk/Frameworks/Acid/utility/esession/buffer.c

    r3640 r3710  
    4949 
    5050#include "buffer.h" 
     51#include "base64.h" 
    5152#include <string.h> 
    5253#include <stdlib.h> 
    5354#include <assert.h> 
    54  
    55 /* Pre-decls */ 
    56 char *b64_encode(char *buf, int len); 
    57 int ap_base64decode(char *bufplain, const char *bufcoded); 
    58 int ap_base64decode_len(const char *bufcoded); 
    5955 
    6056/* Initializes the buffer structure. */ 
     
    212208buffer_dump(Buffer *buffer) 
    213209{ 
    214     int i; 
     210    unsigned int i; 
    215211    u_char *ucp = buffer->buf; 
    216212 
     
    410406buffer_base64_encode(Buffer *buffer) 
    411407{ 
    412     return b64_encode(buffer->buf + buffer->offset, 
     408    return (unsigned char *)b64_encode(((char *)buffer->buf) + buffer->offset, 
    413409                      buffer->end - buffer->offset); 
    414410} 
     
    420416buffer_init_from_base64(Buffer *buffer, const u_char* b64str) 
    421417{ 
    422     buffer->alloc = ap_base64decode_len(buffer->buf); 
     418    buffer->alloc = ap_base64decode_len((const char *)buffer->buf); 
    423419    buffer->buf = (u_char*)malloc(buffer->alloc); 
    424420    buffer->offset = 0; 
    425     buffer->end = ap_base64decode(buffer->buf, b64str); 
    426 } 
     421    buffer->end = ap_base64decode((char *)buffer->buf, (const char *)b64str); 
     422} 
  • trunk/Frameworks/Acid/utility/esession/esession.c

    r3641 r3710  
    2424 
    2525#include "esession.h" 
     26#include "keycache.h" 
     27#include "base64.h" 
    2628#include <openssl/ssl.h> 
    2729#include <assert.h> 
    2830#include "buffer.h" 
    2931#include <string.h> 
    30  
    31 /* Pre-decls */ 
    32 char* b64_encode(char* buf, int len); 
    33 void b64_decode(const char* data, char* result, int* result_len); 
    3432 
    3533/*  
     
    4846void*                       _getpass_cb_arg; 
    4947 
    50 /* Public key cache -- see keycache.c */ 
    51 void init_key_caches(); 
    52 const char* cache_public_key(const char* id, ESessionKeyType keytype,  
    53                              const char* fingerprint); 
    54 const char* find_public_fingerprint(const char* id,  
    55                                     ESessionKeyType keytype); 
    56 const char* cache_personal_key(ESessionKeyType keytype, EVP_PKEY* pkey, 
    57                                char* fingerprint, char* public_key); 
    58  
    5948/* MODP groups, as defined in RFC 3526 */ 
    6049static const char* MODP_5 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF"; 
     
    8675    unsigned char keybuf[EVP_MAX_MD_SIZE]; 
    8776    unsigned int keybuf_len; 
    88     EVP_CIPHER* cipher_type; 
     77    const EVP_CIPHER* cipher_type; 
    8978 
    9079    /* Ensure the size of the biggest max digest is bigger 
     
    147136    EVP_MD_CTX ctx; 
    148137    char keydigest[EVP_MAX_MD_SIZE]; 
    149     int keydigest_len; 
     138    unsigned int keydigest_len; 
    150139    char* result; 
    151     int i; 
     140    unsigned int i; 
    152141 
    153142    /* Generate MD5 hash */ 
    154143    EVP_DigestInit(&ctx, EVP_md5()); 
    155144    EVP_DigestUpdate(&ctx, buffer_ptr(rawkeybuf), buffer_len(rawkeybuf)); 
    156     EVP_DigestFinal(&ctx, keydigest, &keydigest_len); 
     145    EVP_DigestFinal(&ctx, (unsigned char *)keydigest, &keydigest_len); 
    157146 
    158147    /* Turn it into something meaningful... */ 
     
    176165     
    177166    /* First of all, base64 decode this keystring */ 
    178     buffer_init_from_base64(&rawkeybuf, keystr); 
     167    buffer_init_from_base64(&rawkeybuf, (unsigned char *)keystr); 
    179168 
    180169    /* Turn the MD5 hash into printed form */ 
     
    259248 */ 
    260249 
    261 int es_get_last_error(
     250int es_get_last_error(void
    262251{ 
    263252    return _last_error; 
     
    331320 
    332321    /* Generate a base64 encoded public key */ 
    333     public_key = buffer_base64_encode(&b); 
     322    public_key = (char *)buffer_base64_encode(&b); 
    334323 
    335324    /* Ok, we have enough info to cache this key: 
     
    352341 
    353342    /* First of all, base64 decode the keystring */ 
    354     buffer_init_from_base64(&rawkeybuf, public_key); 
     343    buffer_init_from_base64(&rawkeybuf, (unsigned char *)public_key); 
    355344 
    356345    /* Turn the MD5 hash into printed form */ 
     
    418407        buffer_put_bignum2(&b, rkey->e); 
    419408        buffer_put_bignum2(&b, rkey->n); 
    420         result->public_key = buffer_base64_encode(&b); 
     409        result->public_key = (char *)buffer_base64_encode(&b); 
    421410        buffer_free(&b); 
    422411 
     
    437426        buffer_put_bignum2(&b, dkey->g); 
    438427        buffer_put_bignum2(&b, dkey->pub_key); 
    439         result->public_key = buffer_base64_encode(&b); 
     428        result->public_key = (char *)buffer_base64_encode(&b); 
    440429        buffer_free(&b); 
    441430         
     
    447436    membio = BIO_new(BIO_s_mem()); 
    448437    PEM_write_bio_PrivateKey(membio, evpkey, EVP_des_ede3_cbc(), 
    449                              (char*)privatepass, strlen(privatepass), 
     438                             (unsigned char *)privatepass, strlen(privatepass), 
    450439                             NULL, NULL); 
    451440 
     
    548537    EVP_MD_CTX signctx; 
    549538    char* sig; 
    550     int   sig_len; 
     539    unsigned int   sig_len; 
    551540    
    552541 
     
    585574    /* Step 2.7: Calculate K by completing the DH handshake */     
    586575    K.length = DH_size(es->_dh); 
    587     K.data = (unsigned char*)malloc(K.length); 
    588     rc = DH_compute_key(K.data, e, es->_dh); 
     576    K.data = malloc(K.length); 
     577    rc = DH_compute_key((unsigned char *)K.data, e, es->_dh); 
    589578    if (rc == -1) 
    590579    { 
     
    596585 
    597586    /* Step 2.8: Compute a SHA1 hash of (Bob's public key, e, f, K) */ 
    598     _compute_sid(es->_public_key, e, f, K, &sid); 
     587    _compute_sid((const char *)es->_public_key, e, f, K, &sid); 
    599588 
    600589 
     
    603592    result->type = 1; 
    604593    result->f = BN_bn2hex(f); 
    605     result->public_key = strdup(es->_public_key); 
     594    result->public_key = strdup((const char *)es->_public_key); 
    606595 
    607596 
     
    611600    EVP_SignInit(&signctx, EVP_sha1()); 
    612601    EVP_SignUpdate(&signctx, buffer_ptr(&sid), buffer_len(&sid)); 
    613     EVP_SignFinal(&signctx, sig, &sig_len, es->_pkey); 
     602    EVP_SignFinal(&signctx, (unsigned char *)sig, &sig_len, es->_pkey); 
    614603    result->sig = b64_encode(sig, sig_len); 
    615604    free(sig); 
     
    675664    /* Step 2.11: Calculate K by completing the DH handshake */ 
    676665    K.length = DH_size(es->_dh); 
    677     K.data = (unsigned char*)malloc(K.length); 
    678     rc = DH_compute_key(K.data, f, es->_dh); 
     666    K.data = malloc(K.length); 
     667    rc = DH_compute_key((unsigned char *)K.data, f, es->_dh); 
    679668    if (rc == -1) 
    680669    { 
     
    706695    EVP_VerifyInit(&verifyctx, EVP_sha1()); 
    707696    EVP_VerifyUpdate(&verifyctx, buffer_ptr(&sid), buffer_len(&sid)); 
    708     rc = EVP_VerifyFinal(&verifyctx, sig, sig_len, bobkey); 
     697    rc = EVP_VerifyFinal(&verifyctx, (unsigned char *)sig, sig_len, bobkey); 
    709698    if (rc != 1) 
    710699    { 
  • trunk/Frameworks/Acid/utility/esession/esession.h

    r3641 r3710  
    160160 */ 
    161161 
    162 int es_get_last_error(); 
     162int es_get_last_error(void); 
    163163 
    164164const char* es_add_personal_key(const char* private_key); 
  • trunk/Frameworks/Acid/utility/esession/keycache.c

    r3641 r3710  
    2828#include "buffer.h" 
    2929#include "esession.h" 
     30#include "keycache.h" 
    3031 
    3132typedef struct 
     
    5960        buffer_put_cstring(&b, "dsakey"); 
    6061    b.buf[b.end] = '\0'; 
    61     result = lh_strhash(b.buf); 
     62    result = lh_strhash((char *)b.buf); 
    6263    buffer_free(&b); 
    6364    return result; 
    6465} 
    6566 
    66 static unsigned long PUBKEY_hash(const PUBKEY* k) 
     67static unsigned long PUBKEY_hash(const void* k) 
    6768{ 
    68     return _hashkey(k->keytype, k->id); 
     69    return _hashkey(((PUBKEY*)k)->keytype, ((PUBKEY*)k)->id); 
    6970} 
    7071 
    71 static int PUBKEY_cmp(const PUBKEY* lhs, const PUBKEY* rhs) 
     72static int PUBKEY_cmp(const void* lhs, const void* rhs) 
    7273{ 
    7374    int rc; 
    74     rc = !(lhs->keytype == rhs->keytype); 
    75     rc = rc || strcmp(lhs->id, rhs->id); 
     75    rc = !(((PUBKEY*)lhs)->keytype == ((PUBKEY*)rhs)->keytype); 
     76    rc = rc || strcmp(((PUBKEY*)lhs)->id, ((PUBKEY*)rhs)->id); 
    7677    return rc; 
    7778} 
    7879 
    79 static unsigned long PRIVKEY_hash(const PRIVKEY* k) 
     80static unsigned long PRIVKEY_hash(const void* k) 
    8081{ 
    81     return _hashkey(k->keytype, k->fingerprint); 
     82    return _hashkey(((PRIVKEY*)k)->keytype, ((PRIVKEY*)k)->fingerprint); 
    8283} 
    8384 
    84 static int PRIVKEY_cmp(const PRIVKEY* lhs, const PRIVKEY* rhs) 
     85static int PRIVKEY_cmp(const void* lhs, const void* rhs) 
    8586{ 
    8687    int rc; 
    87     rc = !(lhs->keytype == rhs->keytype); 
    88     rc = rc || strcmp(lhs->fingerprint, rhs->fingerprint); 
     88    rc = !(((PRIVKEY*)lhs)->keytype == ((PRIVKEY*)rhs)->keytype); 
     89    rc = rc || strcmp(((PRIVKEY*)lhs)->fingerprint, ((PRIVKEY*)rhs)->fingerprint); 
    8990    return rc; 
    9091} 
    9192 
    92 void init_key_caches(
     93void init_key_caches(void
    9394{ 
    9495    _public_key_cache = lh_new(PUBKEY_hash, PUBKEY_cmp); 
     
    147148    return newkey->fingerprint; 
    148149} 
    149  
    150  
    151  
    152  
    153  
    154  
    155