]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Eliminate unnecessary type casts of int constants
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
Sat, 4 Jul 2026 09:54:56 +0000 (11:54 +0200)
committerEugene Syromiatnikov <esyr@openssl.org>
Wed, 8 Jul 2026 10:09:47 +0000 (12:09 +0200)
Found by running the checkpatch.pl Linux script to enforce coding style.

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jul  8 10:11:16 2026
(Merged from https://github.com/openssl/openssl/pull/31860)

test/bftest.c
test/destest.c
test/ideatest.c

index 08f974ec9bc9a80a6d80b199a666e589f81e775d..3b6d2ee4b6d32a7b0ae8036526966fd168dcffd3 100644 (file)
@@ -387,7 +387,7 @@ static int test_bf_cfb64(void)
     memset(cbc_out, 0, 40);
     memcpy(iv, cbc_iv, 8);
     n = 0;
-    BF_cfb64_encrypt((unsigned char *)cbc_data, cbc_out, (long)13,
+    BF_cfb64_encrypt((unsigned char *)cbc_data, cbc_out, 13,
         &key, iv, &n, BF_ENCRYPT);
     BF_cfb64_encrypt((unsigned char *)&(cbc_data[13]), &(cbc_out[13]),
         len - 13, &key, iv, &n, BF_ENCRYPT);
@@ -419,7 +419,7 @@ static int test_bf_ofb64(void)
     memset(cbc_out, 0, 40);
     memcpy(iv, cbc_iv, 8);
     n = 0;
-    BF_ofb64_encrypt((unsigned char *)cbc_data, cbc_out, (long)13, &key, iv,
+    BF_ofb64_encrypt((unsigned char *)cbc_data, cbc_out, 13, &key, iv,
         &n);
     BF_ofb64_encrypt((unsigned char *)&(cbc_data[13]), &(cbc_out[13]),
         len - 13, &key, iv, &n);
index 26462e3b6535273491660c8ae2a9ff456081da11..a5fa3b51a5683f1bf89c3c346f723af7c9c90435 100644 (file)
@@ -604,7 +604,7 @@ static int test_des_ede_cfb64(void)
         return 0;
     memcpy(cfb_tmp, cfb_iv, sizeof(cfb_iv));
     n = 0;
-    DES_ede3_cfb64_encrypt(cfb_buf1, cfb_buf2, (long)17, &ks, &ks, &ks,
+    DES_ede3_cfb64_encrypt(cfb_buf1, cfb_buf2, 17, &ks, &ks, &ks,
         &cfb_tmp, &n, DES_DECRYPT);
     DES_ede3_cfb64_encrypt(&cfb_buf1[17], &cfb_buf2[17], sizeof(plain) - 17,
         &ks, &ks, &ks, &cfb_tmp, &n, DES_DECRYPT);
index b426429198af406274b63970c55b163d923027c9..4ad7f670545762ac76447c2a0b4f237adb08077d 100644 (file)
@@ -98,7 +98,7 @@ static int test_idea_cfb64(void)
     IDEA_set_decrypt_key(&eks, &dks);
     memcpy(cfb_tmp, cfb_iv, sizeof(cfb_tmp));
     n = 0;
-    IDEA_cfb64_encrypt(plain, cfb_buf1, (long)12, &eks,
+    IDEA_cfb64_encrypt(plain, cfb_buf1, 12, &eks,
         cfb_tmp, &n, IDEA_ENCRYPT);
     IDEA_cfb64_encrypt(&plain[12], &cfb_buf1[12],
         (long)CFB_TEST_SIZE - 12, &eks,
@@ -107,7 +107,7 @@ static int test_idea_cfb64(void)
         return 0;
     memcpy(cfb_tmp, cfb_iv, sizeof(cfb_tmp));
     n = 0;
-    IDEA_cfb64_encrypt(cfb_buf1, cfb_buf2, (long)13, &eks,
+    IDEA_cfb64_encrypt(cfb_buf1, cfb_buf2, 13, &eks,
         cfb_tmp, &n, IDEA_DECRYPT);
     IDEA_cfb64_encrypt(&cfb_buf1[13], &cfb_buf2[13],
         (long)CFB_TEST_SIZE - 13, &eks,