Update rng-tools to latest upstream

This commit is contained in:
Neil Horman 2017-07-31 11:02:38 -04:00 committed by Neil Horman
parent a69f1cadaf
commit e46e2a500f
5 changed files with 54 additions and 9 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
rng-tools-3.tar.gz
/rng-tools-4.tar.gz
/rng-tools-5.tar.gz
/rng-tools-6.tar.gz

View File

@ -3,30 +3,35 @@
Summary: Random number generator related utilities
Name: rng-tools
Version: 5
Release: 9%{?dist}
Version: 6
Release: 1%{?dist}
Group: System Environment/Base
License: GPLv2+
URL: http://sourceforge.net/projects/gkernel/
Source0: http://downloads.sourceforge.net/project/gkernel/rng-tools/4/rng-tools-%{version}.tar.gz
URL: https://github.com/nhorman/rng-tools
Source0: https://github.com/nhorman/rng-tools/archive/rng-tools-%{version}.tar.gz
Source1: rngd.service
Patch0: rngd-extern-darn-init.patch
Patch1: rngd-formatting.patch
# https://sourceforge.net/p/gkernel/patches/111/
Patch0: rngd-exit-code.patch
Patch1: 0001-If-device-is-not-found-exit-immediately.patch
BuildRequires: gettext
BuildRequires: systemd-units
BuildRequires: libgcrypt-devel
BuildRequires: autoconf automake libsysfs-devel
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires: libgcrypt libsysfs
%description
Hardware random number generation tools.
%prep
%autosetup
%prep
%autosetup -n rng-tools-rng-tools-6
%build
./autogen.sh
%configure
%make_build
@ -56,6 +61,9 @@ install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1}
%attr(0644,root,root) %{_unitdir}/rngd.service
%changelog
* Fri Jul 28 2017 Neil Horman <nhorman@redhat.com> - 6-1
- Update to latest upstream
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View File

@ -0,0 +1,18 @@
diff --git a/rngd_entsource.h b/rngd_entsource.h
index 3ba6820..f2407c1 100644
--- a/rngd_entsource.h
+++ b/rngd_entsource.h
@@ -36,7 +36,13 @@ extern fips_ctx_t tpm_fipsctx; /* Context for the tpm FIPS tests */
* sourcedev is the path to the entropy source
*/
extern int init_entropy_source(struct rng *);
+#ifdef HAVE_RDRAND
extern int init_drng_entropy_source(struct rng *);
+#endif
+#ifdef HAVE_DARN
+extern int init_darn_entropy_source(struct rng *);
+#endif
+
extern int init_tpm_entropy_source(struct rng *);
/* Read data from the entropy source */

18
rngd-formatting.patch Normal file
View File

@ -0,0 +1,18 @@
diff --git a/rngd.c b/rngd.c
index 9873c46..418feeb 100644
--- a/rngd.c
+++ b/rngd.c
@@ -191,11 +191,11 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
case 'x':
idx = strtol(arg, NULL, 10);
if ((idx == LONG_MAX) || (idx > ENT_MAX)) {
- printf("exclude index is out of range: %d\n", idx);
+ printf("exclude index is out of range: %lu\n", idx);
return -ERANGE;
}
entropy_sources[idx].disabled = true;
- printf("Disabling %d: %s\n", idx, entropy_sources[idx].rng_name);
+ printf("Disabling %lu: %s\n", idx, entropy_sources[idx].rng_name);
break;
case 'l':
arguments->list = true;

View File

@ -1 +1 @@
6726cdc6fae1f5122463f24ae980dd68 rng-tools-5.tar.gz
SHA512 (rng-tools-6.tar.gz) = 2aea947c4dba5e8c4df33396957f7224b62200be0e3d10aac08c84155fa473a67df5f49e07a07b2cbea4dfd772d90c1b194e8fce3d8eea762463a7f4a16d6ce4