mlichvar pushed to ntp (f20). "fix generation of MD5 keys with ntp-keygen on big-endian systems (#1210324)"
notifications at fedoraproject.org
notifications at fedoraproject.org
Tue Apr 14 08:05:25 UTC 2015
>From 1c78a829e704447285aa2fd1df313e10fb4c1115 Mon Sep 17 00:00:00 2001
From: Miroslav Lichvar <mlichvar at redhat.com>
Date: Tue, 14 Apr 2015 09:55:39 +0200
Subject: fix generation of MD5 keys with ntp-keygen on big-endian systems
(#1210324)
diff --git a/ntp-4.2.6p5-bigkeygen.patch b/ntp-4.2.6p5-bigkeygen.patch
new file mode 100644
index 0000000..7cd238d
--- /dev/null
+++ b/ntp-4.2.6p5-bigkeygen.patch
@@ -0,0 +1,31 @@
+diff -up ntp-4.2.6p5/util/ntp-keygen.c.bigkeygen ntp-4.2.6p5/util/ntp-keygen.c
+--- ntp-4.2.6p5/util/ntp-keygen.c.bigkeygen 2015-04-14 09:47:54.205534510 +0200
++++ ntp-4.2.6p5/util/ntp-keygen.c 2015-04-14 09:50:04.068927862 +0200
+@@ -742,24 +742,23 @@ gen_md5(
+ ntp_srandom((u_long)epoch);
+ for (i = 1; i <= MD5KEYS; i++) {
+ for (j = 0; j < MD5SIZE; j++) {
+- int temp;
++ u_char temp;
+
+ while (1) {
+ int rc;
+
+- rc = ntp_crypto_random_buf(&temp, 1);
++ rc = ntp_crypto_random_buf(&temp, sizeof(temp));
+ if (-1 == rc) {
+ fprintf(stderr, "ntp_crypto_random_buf() failed.\n");
+ exit (-1);
+ }
+- temp &= 0xff;
+ if (temp == '#')
+ continue;
+
+ if (temp > 0x20 && temp < 0x7f)
+ break;
+ }
+- md5key[j] = (u_char)temp;
++ md5key[j] = temp;
+ }
+ md5key[j] = '\0';
+ fprintf(str, "%2d MD5 %s # MD5 key\n", i,
diff --git a/ntp.spec b/ntp.spec
index 8c42082..d31e2ff 100644
--- a/ntp.spec
+++ b/ntp.spec
@@ -105,6 +105,8 @@ Patch29: ntp-4.2.6p5-cve-2014-9298.patch
Patch36: ntp-4.2.6p5-cve-2015-1798.patch
# ntpbz #2781
Patch37: ntp-4.2.6p5-cve-2015-1799.patch
+# ntpbz #2797
+Patch38: ntp-4.2.6p5-bigkeygen.patch
# handle unknown clock types
Patch50: ntpstat-0.2-clksrc.patch
@@ -221,6 +223,7 @@ This package contains NTP documentation in HTML format.
%patch29 -p1 -b .cve-2014-9298
%patch36 -p1 -b .cve-2015-1798
%patch37 -p1 -b .cve-2015-1799
+%patch38 -p1 -b .bigkeygen
# ntpstat patches
%patch50 -p1 -b .clksrc
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/ntp.git/commit/?h=f20&id=1c78a829e704447285aa2fd1df313e10fb4c1115
More information about the scm-commits
mailing list