Add patches to fix issues with type conversion in the DES code

This commit is contained in:
Björn Esser 2021-06-16 18:19:22 +02:00
parent 871fd0c1fc
commit e9ef0a79d3
No known key found for this signature in database
GPG Key ID: F52E98007594C21D
4 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,22 @@
From ab819b18673ddce6d9ded84e412cff6b26e394fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sun, 13 Jun 2021 12:24:23 +0200
Subject: [PATCH] test/des-obsolete.c: Fix Werror=conversion.
---
test/des-obsolete.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/des-obsolete.c b/test/des-obsolete.c
index 2955c873..2259e815 100644
--- a/test/des-obsolete.c
+++ b/test/des-obsolete.c
@@ -29,7 +29,7 @@ expand (unsigned char ex[64], const unsigned char pk[8])
{
t = pk[i];
for (j = 0; j < 8; j++)
- ex[i*8 + j] = (t & (0x01u << (7 - j))) != 0;
+ ex[i*8 + j] = (unsigned char)((t & (0x01u << (7 - j))) != 0);
}
}

View File

@ -0,0 +1,22 @@
From 087ff50c441b8c819f1ede0f7b322daa227b2137 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sun, 13 Jun 2021 12:36:42 +0200
Subject: [PATCH] test/des-obsolete_r.c: Fix Werror=conversion.
---
test/des-obsolete_r.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/des-obsolete_r.c b/test/des-obsolete_r.c
index 6113d3f..cbdfb43 100644
--- a/test/des-obsolete_r.c
+++ b/test/des-obsolete_r.c
@@ -29,7 +29,7 @@ expand (unsigned char ex[64], const unsigned char pk[8])
{
t = pk[i];
for (j = 0; j < 8; j++)
- ex[i*8 + j] = (t & (0x01u << (7 - j))) != 0;
+ ex[i*8 + j] = (unsigned char)((t & (0x01u << (7 - j))) != 0);
}
}

View File

@ -0,0 +1,22 @@
From 9f39b280c705de2806650c23f0b2bbb5f1319e54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sun, 13 Jun 2021 12:05:47 +0200
Subject: [PATCH] lib/crypt-des-obsolete.c: Fix Werror=conversion.
---
lib/crypt-des-obsolete.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/crypt-des-obsolete.c b/lib/crypt-des-obsolete.c
index 36434d0..a10bb5a 100644
--- a/lib/crypt-des-obsolete.c
+++ b/lib/crypt-des-obsolete.c
@@ -85,7 +85,7 @@ unpack_bits (char bytev[64], const unsigned char bitv[8])
{
c = bitv[i];
for (int j = 0; j < 8; j++)
- bytev[i*8 + j] = (c & (0x01 << (7 - j))) != 0;
+ bytev[i*8 + j] = (char)((c & (0x01 << (7 - j))) != 0);
}
}

View File

@ -153,7 +153,7 @@ fi \
Name: libxcrypt
Version: 4.4.22
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Extended crypt library for descrypt, md5crypt, bcrypt, and others
# For explicit license breakdown, see the
@ -164,6 +164,9 @@ Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Patch 0000 - 2999: Backported patches from upstream.
Patch0000: %{url}/commit/dc75db8c5f17733d4212201f2554e5d5e093c1b3.patch#/%{name}-4.4.22-fix_gensalt_yescrypt_o_size_calculation.patch
Patch0001: %{url}/commit/9f39b280c705de2806650c23f0b2bbb5f1319e54.patch#/%{name}-4.4.22-fix_Werror_conversion_des_obsolete_c.patch
Patch0002: %{url}/commit/ab819b18673ddce6d9ded84e412cff6b26e394fa.patch#/%{name}-4.4.22-fix_Werror_conversion__test_des_obsolete_c.patch
Patch0003: %{url}/commit/087ff50c441b8c819f1ede0f7b322daa227b2137.patch#/%{name}-4.4.22-fix_Werror_conversion__test_des_obsolete_r_c.patch
# Patch 3000 - 5999: Backported patches from pull requests.
@ -526,6 +529,9 @@ done
%changelog
* Wed Jun 16 2021 Björn Esser <besser82@fedoraproject.org> - 4.4.22-3
- Add patches to fix issues with type conversion in the DES code
* Sat Jun 05 2021 Björn Esser <besser82@fedoraproject.org> - 4.4.22-2
- Add a patch to fix o_size calculation for gensalt_yescrypt_rn