summaryrefslogtreecommitdiffstats
path: root/ssl/s3_enc.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-10-29 20:24:15 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-10-29 20:24:15 +0000
commit27545970134d703ed96027aac9b67eced124eec3 (patch)
tree2f878acf303cc26e3b6db6a0ec25c10c91e3d32d /ssl/s3_enc.c
parent2ce90b9b7481381dff584726d84345a0260ca4d1 (diff)
A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.
I have tried to convert 'len' type variable declarations to unsigned as a means to address these warnings when appropriate, but when in doubt I have used casts in the comparisons instead. The better solution (that would get us all lynched by API users) would be to go through and convert all the function prototypes and structure definitions to use unsigned variables except when signed is necessary. The proliferation of (signed) "int" for strictly non-negative uses is unfortunate.
Diffstat (limited to 'ssl/s3_enc.c')
-rw-r--r--ssl/s3_enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index 559924d368..56e274fe2a 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -139,7 +139,7 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
EVP_MD_CTX s1;
unsigned char buf[16],smd[SHA_DIGEST_LENGTH];
unsigned char c='A';
- int i,j,k;
+ unsigned int i,j,k;
#ifdef CHARSET_EBCDIC
c = os_toascii[c]; /*'A' in ASCII */
@@ -147,7 +147,7 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
k=0;
EVP_MD_CTX_init(&m5);
EVP_MD_CTX_init(&s1);
- for (i=0; i<num; i+=MD5_DIGEST_LENGTH)
+ for (i=0; (int)i<num; i+=MD5_DIGEST_LENGTH)
{
k++;
if (k > sizeof buf)
@@ -172,7 +172,7 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num)
EVP_DigestUpdate(&m5,s->session->master_key,
s->session->master_key_length);
EVP_DigestUpdate(&m5,smd,SHA_DIGEST_LENGTH);
- if ((i+MD5_DIGEST_LENGTH) > num)
+ if ((int)(i+MD5_DIGEST_LENGTH) > num)
{
EVP_DigestFinal_ex(&m5,smd,NULL);
memcpy(km,smd,(num-i));