Browse Source

more consistency in char signedness

wip/maildir-uid-dupes-test
Oswald Buddenhagen 12 years ago
parent
commit
e07de2a336
  1. 8
      src/socket.c

8
src/socket.c

@ -677,7 +677,7 @@ hexchar( unsigned int b )
void void
cram( const char *challenge, const char *user, const char *pass, char **_final, int *_finallen ) cram( const char *challenge, const char *user, const char *pass, char **_final, int *_finallen )
{ {
unsigned char *response, *final; char *response, *final;
unsigned hashlen; unsigned hashlen;
int i, clen, rlen, blen, flen, olen; int i, clen, rlen, blen, flen, olen;
unsigned char hash[16]; unsigned char hash[16];
@ -689,8 +689,8 @@ cram( const char *challenge, const char *user, const char *pass, char **_final,
clen = strlen( challenge ); clen = strlen( challenge );
/* response will always be smaller than challenge because we are decoding. */ /* response will always be smaller than challenge because we are decoding. */
response = nfcalloc( 1 + clen ); response = nfcalloc( 1 + clen );
rlen = EVP_DecodeBlock( response, (unsigned char *)challenge, clen ); rlen = EVP_DecodeBlock( (unsigned char *)response, (unsigned char *)challenge, clen );
HMAC_Update( &hmac, response, rlen ); HMAC_Update( &hmac, (unsigned char *)response, rlen );
free( response ); free( response );
hashlen = sizeof(hash); hashlen = sizeof(hash);
@ -711,7 +711,7 @@ cram( const char *challenge, const char *user, const char *pass, char **_final,
olen = EVP_EncodeBlock( (unsigned char *)final, (unsigned char *)buf, blen ); olen = EVP_EncodeBlock( (unsigned char *)final, (unsigned char *)buf, blen );
assert( olen == flen ); assert( olen == flen );
*_final = (char *)final; *_final = final;
*_finallen = flen; *_finallen = flen;
} }
#endif #endif

Loading…
Cancel
Save