Hopefully resolve signed vs unsigned issue.

This commit is contained in:
Richard Levitte 2009-01-28 07:09:23 +00:00
parent 8bf5001612
commit c7ba21493a
2 changed files with 5 additions and 4 deletions

View File

@ -515,7 +515,8 @@ static int write_pending(SSL *s, const unsigned char *buf, unsigned int len)
static int n_do_ssl_write(SSL *s, const unsigned char *buf, unsigned int len) static int n_do_ssl_write(SSL *s, const unsigned char *buf, unsigned int len)
{ {
unsigned int j,k,olen,p,mac_size,bs; unsigned int j,k,olen,size,bs;
int mac_size;
register unsigned char *pp; register unsigned char *pp;
olen=len; olen=len;

View File

@ -272,7 +272,7 @@ static int ssl3_get_record(SSL *s)
unsigned char *p; unsigned char *p;
unsigned char md[EVP_MAX_MD_SIZE]; unsigned char md[EVP_MAX_MD_SIZE];
short version; short version;
unsigned int mac_size; int mac_size;
int clear=0; int clear=0;
size_t extra; size_t extra;
int decryption_failed_or_bad_record_mac = 0; int decryption_failed_or_bad_record_mac = 0;
@ -427,7 +427,7 @@ printf("\n");
#endif #endif
} }
/* check the MAC for rr->input (it's in mac_size bytes at the tail) */ /* check the MAC for rr->input (it's in mac_size bytes at the tail) */
if (rr->length >= mac_size) if (rr->length >= (unsigned int)mac_size)
{ {
rr->length -= mac_size; rr->length -= mac_size;
mac = &rr->data[rr->length]; mac = &rr->data[rr->length];
@ -445,7 +445,7 @@ printf("\n");
#endif #endif
} }
i=s->method->ssl3_enc->mac(s,md,0); i=s->method->ssl3_enc->mac(s,md,0);
if (i < 0 || mac == NULL || memcmp(md, mac, mac_size) != 0) if (i < 0 || mac == NULL || memcmp(md, mac, (size_t)mac_size) != 0)
{ {
decryption_failed_or_bad_record_mac = 1; decryption_failed_or_bad_record_mac = 1;
} }