From 6356b9d6aceee685a66d6f7f3f26c35cdbabf43c Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Sat, 23 May 2026 05:46:02 -0600 Subject: [PATCH] cleanup --- .gitignore | 17 +++++++++++++++++ create-attributable-archive.sh | 29 ++++++++++++++++------------- keystore/README.md | 2 -- out/test_validate_passphrase.sh | 2 +- out/verify-everything.sh | 2 +- test_validation_passphrase.txt | 2 +- verify-everything.txt | 2 +- 7 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 .gitignore delete mode 100644 keystore/README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfa5df8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +archives/* +!archives/README.md +keystores/* +!keystores/README.md +out/* +!out/README.md +out/contents/* +!out/contents/README.md + +*.sha256 +*.sha512* +*private_* +*.pub* +*.7z* +*.sig* +*/checksums.sha512 +*/attribution-checksums.sha512 \ No newline at end of file diff --git a/create-attributable-archive.sh b/create-attributable-archive.sh index dba5c16..77ebf9f 100755 --- a/create-attributable-archive.sh +++ b/create-attributable-archive.sh @@ -69,26 +69,29 @@ if [[ "$attribution_passphrase" != "$attribution_passphrase_check" ]]; then exit 1 else echo -e "attribution_passphrase: \033[0;32mOK!\033[0m" + echo "$attribution_passphrase" > "attribution_passphrase_${unix_seconds}.txt fi unset attribution_passphrase_check +unset attribution_passphrase { printf '%s' "$attribution_passphrase" cat "$out_dir/contents.7z" -} | sha512sum | awk '{print $1}' > "$out_dir/attribution.sha512" +} | sha512sum | awk '{print $1}' > "$out_dir/attribution-checksum.sha512" -printf "sanity checking: changing working directory to $out_dir" -cd "$out_dir" -checkcode $? -printf "sanity checking: verification" -bash verify-everything.sh -checkcode $? -printf "sanity checking: validate attribution passphrase" -bash test_validation_passphrase.sh -checkcode $? -printf "sanity checking: returning" -cd .. -checkcode $? +# printf "sanity checking: changing working directory to $out_dir" +# cd "$out_dir" +# checkcode $? +# printf "sanity checking: verification" +# bash verify-everything.sh +# checkcode $? +# printf "sanity checking: validate attribution passphrase" +# bash test_validation_passphrase.sh +# checkcode $? +# printf "sanity checking: returning" +# cd .. +# checkcode $? printf "7z archiving outer dir" 7z a "./out.7z" "$out_dir" checkcode $? + diff --git a/keystore/README.md b/keystore/README.md deleted file mode 100644 index 6290e33..0000000 --- a/keystore/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Keystore -Stores encrypted ssh keys and attribution passphrases here in 7z format \ No newline at end of file diff --git a/out/test_validate_passphrase.sh b/out/test_validate_passphrase.sh index 4172017..82db412 100755 --- a/out/test_validate_passphrase.sh +++ b/out/test_validate_passphrase.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -attrib_hash=$(cat "./attribution.sha512") +attrib_hash=$(cat "./attribution-checksum.sha512") echo "enter passphrase to test" read passphrase diff --git a/out/verify-everything.sh b/out/verify-everything.sh index 162cf80..0baa8f4 100755 --- a/out/verify-everything.sh +++ b/out/verify-everything.sh @@ -26,4 +26,4 @@ checkcode $? printf "Checking signature against provided public key... " ssh-keygen -Y verify -f "./anonymous_signer" -I "anonymous" -n "file-integrity" -s contents.7z.sig < contents.7z > /dev/null > /dev/null > /dev/null 2>&1 -checkcode $? +checkcode $? \ No newline at end of file diff --git a/test_validation_passphrase.txt b/test_validation_passphrase.txt index 4172017..82db412 100644 --- a/test_validation_passphrase.txt +++ b/test_validation_passphrase.txt @@ -1,6 +1,6 @@ #!/bin/bash set -e -attrib_hash=$(cat "./attribution.sha512") +attrib_hash=$(cat "./attribution-checksum.sha512") echo "enter passphrase to test" read passphrase diff --git a/verify-everything.txt b/verify-everything.txt index 162cf80..0baa8f4 100644 --- a/verify-everything.txt +++ b/verify-everything.txt @@ -26,4 +26,4 @@ checkcode $? printf "Checking signature against provided public key... " ssh-keygen -Y verify -f "./anonymous_signer" -I "anonymous" -n "file-integrity" -s contents.7z.sig < contents.7z > /dev/null > /dev/null > /dev/null 2>&1 -checkcode $? +checkcode $? \ No newline at end of file