aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/bad_dtls_test.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-12-07 17:37:15 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-12-07 17:37:15 +0000
commit4f94f84d8491a2455678402b5c7c92e692a272bc (patch)
treea4aa27b5b96b57155a4e7c22defb8f25e93cb846 /ssl/bad_dtls_test.c
parentb6a9311a3edd056eaacbcbae2fcb723df5d99057 (diff)
downloadsrc-4f94f84d8491a2455678402b5c7c92e692a272bc.tar.gz
src-4f94f84d8491a2455678402b5c7c92e692a272bc.zip
Import OpenSSL 1.0.2n.vendor/openssl/1.0.2n
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=326660 svn path=/vendor-crypto/openssl/1.0.2n/; revision=326661; tag=vendor/openssl/1.0.2n
Diffstat (limited to 'ssl/bad_dtls_test.c')
-rw-r--r--ssl/bad_dtls_test.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ssl/bad_dtls_test.c b/ssl/bad_dtls_test.c
index 70d8578b5883..34af37d9a9f4 100644
--- a/ssl/bad_dtls_test.c
+++ b/ssl/bad_dtls_test.c
@@ -590,13 +590,13 @@ static int send_record(BIO *rbio, unsigned char type, unsigned long seqnr,
unsigned char *enc;
#ifdef SIXTY_FOUR_BIT_LONG
- seq[0] = (seqnr >> 40) & 0xff;
- seq[1] = (seqnr >> 32) & 0xff;
+ seq[0] = (unsigned char)(seqnr >> 40);
+ seq[1] = (unsigned char)(seqnr >> 32);
#endif
- seq[2] = (seqnr >> 24) & 0xff;
- seq[3] = (seqnr >> 16) & 0xff;
- seq[4] = (seqnr >> 8) & 0xff;
- seq[5] = seqnr & 0xff;
+ seq[2] = (unsigned char)(seqnr >> 24);
+ seq[3] = (unsigned char)(seqnr >> 16);
+ seq[4] = (unsigned char)(seqnr >> 8);
+ seq[5] = (unsigned char)(seqnr);
pad = 15 - ((len + SHA_DIGEST_LENGTH) % 16);
enc = OPENSSL_malloc(len + SHA_DIGEST_LENGTH + 1 + pad);
@@ -612,8 +612,8 @@ static int send_record(BIO *rbio, unsigned char type, unsigned long 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);
@@ -637,8 +637,8 @@ static int send_record(BIO *rbio, unsigned char type, unsigned long 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));