summaryrefslogtreecommitdiffstats
path: root/test/bad_dtls_test.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2017-11-11 22:23:12 +0100
committerAndy Polyakov <appro@openssl.org>2017-11-13 10:58:57 +0100
commit3a63c0edab842af3e84ef1cad2b4eb701eece3e1 (patch)
treec45bf7fb2f69874b2779b33e5597a59bbc92e648 /test/bad_dtls_test.c
parentssl/ssl_asn1.c: resolve warnings in VC-WIN32 build, which allows to add /WX. (diff)
downloadopenssl-3a63c0edab842af3e84ef1cad2b4eb701eece3e1.tar.xz
openssl-3a63c0edab842af3e84ef1cad2b4eb701eece3e1.zip
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 <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4721)
Diffstat (limited to 'test/bad_dtls_test.c')
-rw-r--r--test/bad_dtls_test.c8
1 files changed, 4 insertions, 4 deletions
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));