mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-11 15:04:18 +00:00
* Exit if loading an invalid identity from disk Previously, if an invalid identity was loaded from disk, ZeroTier would generate a new identity & chug along and generate a brand new identity as if nothing happened. When running in containers, this introduces the possibility for key matter loss; especially when running in containers where the identity files are mounted in the container read only. In this case, ZT will continue chugging along with a brand new identity with no possibility of recovering the private key. ZeroTier should exit upon loading of invalid identity.public/identity.secret #2056 * add validation test for #2056
22 lines
625 B
Bash
Executable File
22 lines
625 B
Bash
Executable File
#!/bin/bash
|
|
|
|
################################################################################
|
|
# Set exit code depending on tool reports #
|
|
################################################################################
|
|
|
|
DEFINITELY_LOST=$(cat *test-results/*summary.json | jq .num_definite_bytes_lost)
|
|
|
|
cat *test-results/*summary.json
|
|
|
|
echo -e "\nBytes of memory definitely lost: $DEFINITELY_LOST"
|
|
|
|
if [[ "$DEFINITELY_LOST" -gt 0 ]]; then
|
|
exit 1
|
|
fi
|
|
|
|
EXIT_TEST_FAILED=$(cat *test-results/*summary.json | jq .exit_test_failed)
|
|
|
|
if [[ "$EXIT_TEST_FAILED" -gt 0 ]]; then
|
|
exit 1
|
|
fi
|