sum updoots

This commit is contained in:
2026-05-23 07:28:33 -06:00
parent 190d93d12a
commit 8e3acf1f70
2 changed files with 40 additions and 40 deletions
+39 -38
View File
@@ -29,43 +29,43 @@ printf "setting up environment..."
bash reset.sh bash reset.sh
checkcode $? checkcode $?
printf "ssh-keygen: makin new key..." printf "ssh-keygen: makin new key: ${key_path}..."
ssh-keygen -t ed25519 -f "$key_path" -C "anonymous" ssh-keygen -t ed25519 -f "$key_path" -C "anonymous" -N ""
checkcode $? checkcode $?
printf "ssh-keygen: changing ownership on $key_path and $key_path.pub" printf "ssh-keygen: changing ownership on $key_path and $key_path.pub..."
chown $USER:$USER "$key_path" "$key_path.pub" chown $USER:$USER "$key_path" "$key_path.pub"
printf "ssh-keygen: fixing perms on $key_path and $key_path.pub" printf "ssh-keygen: fixing perms on $key_path and $key_path.pub..."
chmod 600 "$key_path" "$key_path.pub" chmod 600 "$key_path" "$key_path.pub"
printf "ssh-keygen: creating $out_dir/anonymous_signer..." printf "ssh-keygen: creating $out_dir/anonymous_signer..."
echo "anonymous namespaces=\"$signature_tag\" $(cat "${key_path}.pub")" > "$out_dir/anonymous_signer" echo "anonymous namespaces=\"$signature_tag\" $(cat "${key_path}.pub")" > "$out_dir/anonymous_signer"
checkcode $? checkcode $?
printf "random: adding 1/2 random blocks of data to inner archive" printf "random: adding 1/2 random blocks of data to inner archive..."
dd if=/dev/urandom of="$inner_dir/.$RANDOM" bs=1K count=10 > /dev/null 2>&1 dd if=/dev/urandom of="$inner_dir/.$RANDOM" bs=1K count=10 > /dev/null 2>&1
checkcode $? checkcode $?
printf "random: adding 2/3 random blocks of data to outer archive" printf "random: adding 2/3 random blocks of data to outer archive..."
dd if=/dev/urandom of="$out_dir/.$RANDOM" bs=1K count=10 > /dev/null 2>&1 dd if=/dev/urandom of="$out_dir/.$RANDOM" bs=1K count=10 > /dev/null 2>&1
checkcode $? checkcode $?
printf "7z: compressing inner volume" printf "7z: compressing inner volume..."
7z a "$out_dir/contents.7z" "$inner_dir" > /dev/null 2>&1 7z a "$out_dir/contents.7z" "$inner_dir" > /dev/null 2>&1
checkcode $? checkcode $?
printf "deleting $inner_dir" printf "deleting ${inner_dir}..."
rm -rf "$inner_dir" > /dev/null 2>&1 rm -rf "$inner_dir" > /dev/null 2>&1
checkcode $? checkcode $?
printf "ssh: signing out/contents.7z" printf "ssh: signing out/contents.7z..."
ssh-keygen -Y sign -f "$key_path" -n "$signature_tag" "$out_dir/contents.7z" > /dev/null 2>&1 ssh-keygen -Y sign -f "$key_path" -n "$signature_tag" "$out_dir/contents.7z" > /dev/null 2>&1
checkcode $? checkcode $?
printf "changing directory to $out_dir" printf "changing directory to ${out_dir}..."
cd "$out_dir" cd "$out_dir"
checkcode $? checkcode $?
printf "sha512: generating sha512 checksums of files in out" printf "sha512: generating sha512 checksums of files in out..."
sha512sum * > "checksums.sha512" sha512sum * > "checksums.sha512"
checkcode $? checkcode $?
printf "changing directory back" printf "changing directory back..."
cd .. cd ..
checkcode $? checkcode $?
@@ -74,44 +74,45 @@ read -r -s attribution_passphrase
echo echo
echo "Enter attribution passphrase again:" echo "Enter attribution passphrase again:"
read -r -s attribution_passphrase_check read -r -s attribution_passphrase_check
echo
if [[ "$attribution_passphrase" != "$attribution_passphrase_check" ]]; then if [[ "$attribution_passphrase" != "$attribution_passphrase_check" ]]; then
echo -e "\n\n\033[0;31mAttribution passphrases do not match! Exiting!\033[0m\n\n" > /dev/null > /dev/null 2>&1 echo -e "\n\n\033[0;31mAttribution passphrases do not match! Exiting!\033[0m\n\n" > /dev/null 2>&1
exit 1 exit 1
else else
echo -e "attribution_passphrase: \033[0;32mOK!\033[0m" echo -e "attribution_passphrase: \033[0;32mOK!\033[0m"
echo "$attribution_passphrase" > "attribution_passphrase_${unix_seconds}.txt" echo "$attribution_passphrase" > "attribution_passphrase_${unix_seconds}.txt"
fi fi
unset attribution_passphrase_check > /dev/null > /dev/null 2>&1 unset attribution_passphrase_check > /dev/null 2>&1
unset attribution_passphrase > /dev/null > /dev/null 2>&1
{ {
printf '%s' "$attribution_passphrase" printf '%s' "$attribution_passphrase"
cat "$out_dir/contents.7z" cat "$out_dir/contents.7z"
} | sha512sum | awk '{print $1}' > "$out_dir/attribution-checksum.sha512" } | sha512sum | awk '{print $1}' > "$out_dir/attribution-checksum.sha512"
unset attribution_passphrase > /dev/null 2>&1
# printf "sanity checking: changing working directory to $out_dir" printf "sanity checking: changing working directory to ${out_dir}..."
# cd "$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" > /dev/null > /dev/null 2>&1
checkcode $? checkcode $?
printf "moving out.7z to archives" 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" > /dev/null 2>&1
checkcode $?
printf "moving out.7z to archives..."
mv out.7z "archives/verifiable_archive_${unix_seconds}.7z" > /dev/null 2>&1 mv out.7z "archives/verifiable_archive_${unix_seconds}.7z" > /dev/null 2>&1
checkcode $? checkcode $?
echo "input keystore passphrase" echo "input keystore passphrase:"
read -r -s keystore_passphrase read -r -s keystore_passphrase
echo echo
echo "input keystore passphrase (again)" echo "input keystore passphrase (again):"
read -r -s keystore_passphrase_check read -r -s keystore_passphrase_check
echo echo
if [[ "$keystore_passphrase" != "$keystore_passphrase_check" ]]; then if [[ "$keystore_passphrase" != "$keystore_passphrase_check" ]]; then
@@ -120,16 +121,16 @@ if [[ "$keystore_passphrase" != "$keystore_passphrase_check" ]]; then
fi fi
unset keystore_passphrase_check > /dev/null 2>&1 unset keystore_passphrase_check > /dev/null 2>&1
printf "archivin keys" printf "archivin keys..."
7z a "keystore/keystore_${unix_seconds}.7z" -p$keystore_passphrase "private_*" "private_*.pub" "attribution_passphrase_${unix_seconds}.txt" > /dev/null 2>&1 7z a "keystore/keystore_${unix_seconds}.7z" -p"$keystore_passphrase" "private_*" "private_*.pub" "attribution_passphrase_${unix_seconds}.txt" > /dev/null 2>&1
checkcode $? checkcode $?
printf "testing key archive" printf "testing key archive..."
7z t "keystore/keystore_${unix_seconds}.7z" -p$keystore_passphrase > /dev/null 2>&1 7z t "keystore/keystore_${unix_seconds}.7z" -p"$keystore_passphrase" > /dev/null 2>&1
checkcode $? checkcode $?
printf "resetting environment..." printf "resetting environment..."
bash reset.sh bash reset.sh
checkcode $? checkcode $?
echo "done :3" echo -e "\n\n\033[0;32mdone :3\033[0m\n\n"
+1 -2
View File
@@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
checkcode () { checkcode () {
local retcode local retcode
if [ -z "$1" ]; then if [ -z "$1" ]; then
@@ -56,5 +55,5 @@ printf "making out/verify-everything.sh executable"
chmod +x out/verify-everything.sh chmod +x out/verify-everything.sh
checkcode $? checkcode $?
echo -e "\n\ndone :3\n\n" echo -e "\n\n\033[0;32mdone :3\033[0m\n\n"