Changeset 70 for trunk/cscrypt/md5.c


Ignore:
Timestamp:
05/12/09 05:25:27 (12 years ago)
Author:
rorothetroll
Message:

csctapi/io_serial.c : fix the serial port read/write wait routine to use select instead of poll

This make them compatible with Mac OS X and now oscamd works on OS X. The same code off course
still works on linux and other unix platforms. I let that code ran for 24h before commiting this code.
If you have any issue let me know and I'llr evert to poll for non compatible machines.

all the others : fix all the warning due to sign difference (mostly uchar versus char). This make the code compile

with -Werror on the more strict version of gcc (which is the case on OS X). I also noticed that in a lot of places
the code use a buffer defined as an uchar * ... and use strings functions (strnXXXX) where some memcpy/memcmp .. function
would have been preferable as we're suposedly manipulation a binary buffer. Anyway I fixed all of them and it now compile
without any warning or error on linux and OS X (and also probably on all the other unices but we will have to try before
adding -Werror on the other platform).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cscrypt/md5.c

    r8 r70  
    568568    /* The password first, since that is what is most unknown */
    569569    pw_len = strlen(pw);
    570     __md5_Update(&ctx,pw,pw_len);
     570    __md5_Update(&ctx,(const unsigned char *)pw,pw_len);
    571571
    572572    /* Then our magic string */
    573     __md5_Update(&ctx,__md5__magic,__md5__magic_len);
     573    __md5_Update(&ctx,(const unsigned char *)__md5__magic,__md5__magic_len);
    574574
    575575    /* Then the raw salt */
    576     __md5_Update(&ctx,sp,sl);
     576    __md5_Update(&ctx,(const unsigned char *)sp,sl);
    577577
    578578    /* Then just as many characters of the MD5(pw,salt,pw) */
    579579    __md5_Init(&ctx1);
    580     __md5_Update(&ctx1,pw,pw_len);
    581     __md5_Update(&ctx1,sp,sl);
    582     __md5_Update(&ctx1,pw,pw_len);
     580    __md5_Update(&ctx1,(const unsigned char *)pw,pw_len);
     581    __md5_Update(&ctx1,(const unsigned char *)sp,sl);
     582    __md5_Update(&ctx1,(const unsigned char *)pw,pw_len);
    583583    __md5_Final(final,&ctx1);
    584584    for(pl = pw_len; pl > 0; pl -= 16)
    585         __md5_Update(&ctx,final,pl>16 ? 16 : pl);
     585        __md5_Update(&ctx,(const unsigned char *)final,pl>16 ? 16 : pl);
    586586
    587587    /* Don't leave anything around in vm they could use. */
     
    608608        __md5_Init(&ctx1);
    609609        if(i & 1)
    610             __md5_Update(&ctx1,pw,pw_len);
     610            __md5_Update(&ctx1,(const unsigned char *)pw,pw_len);
    611611        else
    612             __md5_Update(&ctx1,final,16);
     612            __md5_Update(&ctx1,(const unsigned char *)final,16);
    613613
    614614        if(i % 3)
    615             __md5_Update(&ctx1,sp,sl);
     615            __md5_Update(&ctx1,(const unsigned char *)sp,sl);
    616616
    617617        if(i % 7)
    618             __md5_Update(&ctx1,pw,pw_len);
     618            __md5_Update(&ctx1,(const unsigned char *)pw,pw_len);
    619619
    620620        if(i & 1)
    621             __md5_Update(&ctx1,final,16);
     621            __md5_Update(&ctx1,(const unsigned char *)final,16);
    622622        else
    623             __md5_Update(&ctx1,pw,pw_len);
     623            __md5_Update(&ctx1,(const unsigned char *)pw,pw_len);
    624624        __md5_Final(final,&ctx1);
    625625    }
Note: See TracChangeset for help on using the changeset viewer.