Skip to content

Commit 929891b

Browse files
committed
Merge branch 'main' of https://github.com/mmguero-dev/Malcolm into v26.08.0_merge_cisagov
2 parents 173c07f + 97d2cfd commit 929891b

3 files changed

Lines changed: 35 additions & 10 deletions

File tree

‎hedgehog-raspi/sensor_install.sh‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MALCOLM_SRC='/opt/Malcolm'
3434
WORK_DIR="$(mktemp -d -p "$HOME" -t hedgehog-XXXXXX)"
3535

3636
# Build time dependencies for htpdate
37-
BUILD_DEPS='build-essential libssl-dev checkinstall'
37+
BUILD_DEPS='build-essential libssl-dev checkinstall bsdextrautils'
3838

3939
################################
4040
######### Functions ############
@@ -58,15 +58,25 @@ build_htpdate() {
5858

5959
make https
6060

61-
checkinstall -y -D --nodoc --strip=yes --stripso=yes --install=no --fstrans=no \
62-
--pkgname=htpdate --pkgversion=$htpdate_vers --pkgarch="$ARCH" --pkgsource="$htpdate_url" \
63-
--pkgrelease="$htpdate_release" --pakdir "$DEBS_DIR"
64-
65-
# htpdate is installed outside of dpkg with checkinstall
66-
make uninstall
61+
checkinstall \
62+
-y -D \
63+
--nodoc \
64+
--strip=yes \
65+
--stripso=yes \
66+
--install=no \
67+
--fstrans=yes \
68+
--exclude=/usr/bin/install,/bin/install \
69+
--pkgname=htpdate \
70+
--pkgversion=$htpdate_vers \
71+
--pkgarch="$ARCH" \
72+
--pkgsource="$htpdate_url" \
73+
--pkgrelease="$htpdate_release" \
74+
--pakdir "$DEBS_DIR"
6775

6876
cd "${WORK_DIR}"
6977

78+
dpkg-deb -c "${DEBS_DIR}/htpdate_${htpdate_vers}-${htpdate_release}_${ARCH}.deb"
79+
7080
dpkg -i "${DEBS_DIR}/htpdate_${htpdate_vers}-${htpdate_release}_${ARCH}.deb"
7181
}
7282

‎scripts/control.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ def authSetup():
29872987
labels=['Malcolm Server IP', 'Single-use Code Phrase'],
29882988
defaultBehavior=defaultBehavior,
29892989
)
2990-
if (len(values) == 2) and (len(values[0]) >= 3) and (len(values[1]) >= 16):
2990+
if (len(values) == 2) and (len(values[0]) >= 3) and (len(values[1]) >= 11):
29912991
tx_ip = values[0]
29922992
rx_token = values[1]
29932993
break

‎scripts/tx-rx-secure.sh‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,17 @@ function _cleanup {
246246
fi
247247
}
248248

249+
###############################################################################
250+
# normalize croc's terminal output and suppress update notices
251+
function _filter_croc_output {
252+
LC_ALL=C sed -u -E \
253+
-e $'s/.*\r//' \
254+
-e '/^A newer croc version is available:/d' \
255+
-e '\|^Run: curl https://getcroc\.com \| bash$|d' \
256+
-e '/^Or open:$/d' \
257+
-e '\|^[[:space:]]*https://getcroc\.com/\?code=|d'
258+
}
259+
249260
###############################################################################
250261

251262
trap "_cleanup" EXIT
@@ -284,7 +295,9 @@ if [[ -n "${PORTS}" ]] && [[ "${MODE}" == "tx" ]] && (( $# > 0 )); then
284295
[[ -n "${SEND_RELAY_IP}" ]] && RELAY_ARGS=(--relay "${SEND_RELAY_IP}:${FIRST_PORT}")
285296

286297
# run croc
287-
"${CROC_BIN}" --yes --ignore-stdin --overwrite ${DEBUG_FLAG} "${CURVE_ARGS[@]}" "${RELAY_ARGS[@]}" send "${HASH_ARGS[@]}" "$@"
298+
"${CROC_BIN}" --yes --ignore-stdin --overwrite --disable-clipboard ${DEBUG_FLAG} \
299+
"${CURVE_ARGS[@]}" "${RELAY_ARGS[@]}" send \
300+
"${HASH_ARGS[@]}" "$@" 2>&1 | _filter_croc_output
288301

289302
elif [[ -n "${PORTS}" ]] && ( [[ "${MODE}" == "rx" ]] && [[ -n "${TOKEN}" ]] && ( [[ -z "${LOCAL_RELAY}" ]] || [[ -n "${SERVER}" ]] ) ); then
290303
# we have ports defined, have requested receive mode, have been given a token, and either have a relay IP or are not using a local relay
@@ -293,7 +306,9 @@ elif [[ -n "${PORTS}" ]] && ( [[ "${MODE}" == "rx" ]] && [[ -n "${TOKEN}" ]] &&
293306

294307
# run croc
295308
export CROC_SECRET="${TOKEN}"
296-
"${CROC_BIN}" --yes --ignore-stdin --overwrite ${DEBUG_FLAG} "${CURVE_ARGS[@]}" "${RELAY_ARGS[@]}" "${OUTPUT_ARGS[@]}"
309+
"${CROC_BIN}" --yes --ignore-stdin --overwrite --disable-clipboard ${DEBUG_FLAG} \
310+
"${CURVE_ARGS[@]}" "${RELAY_ARGS[@]}" \
311+
"${OUTPUT_ARGS[@]}" 2>&1 | _filter_croc_output
297312

298313
else
299314
_help >&2

0 commit comments

Comments
 (0)