From 6fd5dc1719c320722e55b147e7eb4d97cbe5c475 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 16 Apr 2019 22:14:39 -0400 Subject: install_find_pkgs(): Initialize cert and check sig --- (limited to 'src') diff --git a/src/install.sh b/src/install.sh index b2002cb..8b5291b 100644 --- a/src/install.sh +++ b/src/install.sh @@ -98,6 +98,9 @@ install_find_pkgs() local name= local base_url= local gzip= + local cert_url= + local cert_fd= + local dl_func= local pkgs= mkdir -p "${root}/etc/opkg" "${root}/var/lib/opkg/lists" @@ -116,6 +119,23 @@ install_find_pkgs() fi pkgs_fd=${FD} + if cert_url="$(profile_get_cert_url "${mirror}")"; then + mkdir -p "${root}/etc/opkg/keys/" + if ! fopen "${root}/etc/opkg/keys/temp.cert"; then + return 1 + fi + cert_fd=${FD} + printf '%s\n---' "${cert_url}" >&${cert_fd} + IFS="${LF}" + printf 'K: %s\n' $(profile_get_root_key) >&${cert_fd} + unset IFS + printf '---' >&${cert_fd} + fclose ${cert_fd} + dl_func=feed_download_cert + else + dl_func=feed_download + fi + while read -r type name base_url; do case "${type}" in 'src') gzip=false;; @@ -124,8 +144,11 @@ install_find_pkgs() esac printf '%s %s %s\n' "${type}" "${name}" \ "${base_url}" >&${opkg_conf_fd} - feed_download "${base_url}" \ - "${root}/var/lib/opkg/lists/${name}" ${gzip} + if ! ${dl_func} "${base_url}" \ + "${root}/var/lib/opkg/lists/${name}" \ + ${gzip}; then + return 1 + fi install_feed_url="${base_url}" feed_find_pkgs "${root}/var/lib/opkg/lists/${name}" \ "$(profile_dep_fields)" profile_include_pkg \ -- cgit v0.9.1