From 3a63c0edab842af3e84ef1cad2b4eb701eece3e1 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sat, 11 Nov 2017 22:23:12 +0100 Subject: Resolve warnings in VC-WIN32 build, which allows to add /WX. It's argued that /WX allows to keep better focus on new code, which motivates its comeback... Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/4721) --- test/bad_dtls_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/bad_dtls_test.c') diff --git a/test/bad_dtls_test.c b/test/bad_dtls_test.c index 102de24464..5bd4e22d0a 100644 --- a/test/bad_dtls_test.c +++ b/test/bad_dtls_test.c @@ -306,8 +306,8 @@ static int send_record(BIO *rbio, unsigned char type, uint64_t seqnr, HMAC_Update(ctx, seq, 6); HMAC_Update(ctx, &type, 1); HMAC_Update(ctx, ver, 2); /* Version */ - lenbytes[0] = len >> 8; - lenbytes[1] = len & 0xff; + lenbytes[0] = (unsigned char)(len >> 8); + lenbytes[1] = (unsigned char)(len); HMAC_Update(ctx, lenbytes, 2); /* Length */ HMAC_Update(ctx, enc, len); /* Finally the data itself */ HMAC_Final(ctx, enc + len, NULL); @@ -331,8 +331,8 @@ static int send_record(BIO *rbio, unsigned char type, uint64_t seqnr, BIO_write(rbio, ver, 2); BIO_write(rbio, epoch, 2); BIO_write(rbio, seq, 6); - lenbytes[0] = (len + sizeof(iv)) >> 8; - lenbytes[1] = (len + sizeof(iv)) & 0xff; + lenbytes[0] = (unsigned char)((len + sizeof(iv)) >> 8); + lenbytes[1] = (unsigned char)(len + sizeof(iv)); BIO_write(rbio, lenbytes, 2); BIO_write(rbio, iv, sizeof(iv)); -- cgit v1.2.1