fix signature verification bypass due to insufficient hashsum checking
fix signature verification bypass due to insufficient hashsum checking

The hashsum call is done inside a subshell, hence the error logging
which is responsible for terminating the application on failure must be
chained to the subshell instead of the inner command. Chaining it to the
call inside the subshell would only terminate the subshell ungracefully,
but would not have any effect on the caller.

This effectively is equal to a full signature verification bypass, since
an attacker is able to swap the terraform zip file at will as long as
the hashsum file and the signature are kept unchanged. Before this patch
the installation routine would happily verify the signature of the
hashsum file, the hashsum check in the subshell would fail but the
system wide installation would still take place.

Fixes: 750a8490 (Upgrade to logging, keybase, use of local temp dir)
Since: v0.4.3

Signed-off-by: Levente Polyak <bfe9c09a46c4caeed56053d26bf5c0fb0a5a4e36@leventepolyak.net>

kamatama41/tfenv