Originally published on MistLab . Part 7 of Building an SSH Terminal .
Part 7 of "Building an SSH Terminal". Code excerpts are from MistTerm v1.2.26, an open-source (AGPL) SSH terminal client by MistLab; they are trimmed, and source comments are translated from Chinese.
TL;DR
HTTPS authenticates the download server, not the update itself. A secure updater accepts an update only if it is signed by a key the client already ships. MistTerm signs a JSON manifest with minisign (Ed25519), verifies the signature before parsing anything, binds each binary to the manifest by SHA-256, and remembers the highest verified version to reject replayed old manifests.
An SSH client holds the keys to its users' servers. That makes its update channel a high-value target. Anyone who can make the client install a binary of their choice owns every machine the user connects to. HTTPS alone does not cover this. It authenticates the server you download from, not the content .…