1*4882a593SmuzhiyunFrom 3e8a9e9a1c7eae515eb628778c3c8a04338b3bb3 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: "Yann E. MORIN" <yann.morin.1998@free.fr>
3*4882a593SmuzhiyunDate: Tue, 27 Dec 2016 11:21:09 +0100
4*4882a593SmuzhiyunSubject: [PATCH] sounds: do not download and check sha1s
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunTo validate the sound archives, the corresponding sha1s are also
7*4882a593Smuzhiyundownloaded from the same location, and that download is done at install
8*4882a593Smuzhiyuntime.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunHowever, that poses at least two problems:
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun  - in Buildroot, we already have validated the downloads with the sha1s
13*4882a593Smuzhiyun    anyway, and trying to download anything at install time is not
14*4882a593Smuzhiyun    always possible (e.g. for off-line builds);
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun  - since the download scheme is not secured (plain http), a
17*4882a593Smuzhiyun    man-in-the-middle for the sounds will also be able to MITM the
18*4882a593Smuzhiyun    download of the sha1s, so there is absolutely no additional safety
19*4882a593Smuzhiyun    in doing so.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunSo we just do without the sha1 download and checks.
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunSigned-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
24*4882a593Smuzhiyun---
25*4882a593Smuzhiyun sounds/Makefile | 10 ----------
26*4882a593Smuzhiyun 1 file changed, 10 deletions(-)
27*4882a593Smuzhiyun
28*4882a593Smuzhiyundiff --git a/sounds/Makefile b/sounds/Makefile
29*4882a593Smuzhiyunindex 84d0f45..7a80d56 100644
30*4882a593Smuzhiyun--- a/sounds/Makefile
31*4882a593Smuzhiyun+++ b/sounds/Makefile
32*4882a593Smuzhiyun@@ -100,17 +100,7 @@ ifneq ($(SOUNDS_CACHE_DIR),)
33*4882a593Smuzhiyun 	  if test ! -f "$$(SOUNDS_CACHE_DIR)/$$@"; then \
34*4882a593Smuzhiyun 	    (cd "$$(SOUNDS_CACHE_DIR)"; $$(DOWNLOAD) $$(SOUNDS_URL)/$$@); \
35*4882a593Smuzhiyun 	  fi; \
36*4882a593Smuzhiyun-	  if test ! -f "$$(SOUNDS_CACHE_DIR)/$$@.sha1"; then \
37*4882a593Smuzhiyun-	    (cd "$$(SOUNDS_CACHE_DIR)"; $$(DOWNLOAD) $$(SOUNDS_URL)/$$@.sha1); \
38*4882a593Smuzhiyun-	  fi; \
39*4882a593Smuzhiyun 	  $$(LN) -sf "$$(SOUNDS_CACHE_DIR)/$$@" .; \
40*4882a593Smuzhiyun-	  $$(LN) -sf "$$(SOUNDS_CACHE_DIR)/$$@.sha1" .; \
41*4882a593Smuzhiyun-	  $$(SHA1SUM) -c --status $$@.sha1 || \
42*4882a593Smuzhiyun-	    ( \
43*4882a593Smuzhiyun-	      rm -f "$$(SOUNDS_CACHE_DIR)/$$@" "$$(SOUNDS_CACHE_DIR)/$$@.sha1" $$@ $$@.sha1; \
44*4882a593Smuzhiyun-	      echo "Bad checksum: $$@" 1>&2; \
45*4882a593Smuzhiyun-	      exit 1; \
46*4882a593Smuzhiyun-	    ) || exit 1; \
47*4882a593Smuzhiyun 	fi
48*4882a593Smuzhiyun else
49*4882a593Smuzhiyun 	$(CMD_PREFIX) \
50*4882a593Smuzhiyun--
51*4882a593Smuzhiyun2.7.4
52*4882a593Smuzhiyun
53