BIG CHANGES:
* Command no longer need to be run from the base directory of the repo. * blackbox_edit now asks "are you sure?" and is greatly simplified. _blackbox_common.sh: * add_filename_to_cryptlist now accepts paths relative to cwd. * fail_if_not_on_cryptlist now accepts paths relative to cwd. * new function: vcs_relative_path reports a path to the file relative to the REPOBASE. * new function: is_on_cryptlist plus... * Some minor performance enhancesments and cleanups. * confidence_test.sh now tests some commands while not in REPOBASE.
This commit is contained in:
@@ -7,11 +7,11 @@ export PATH=/home/tlimoncelli/gitwork/blackbox/bin:/usr/lib64/qt-3.3/bin:/usr/lo
|
||||
set -e
|
||||
|
||||
function PHASE() {
|
||||
echo '===================='
|
||||
echo '===================='
|
||||
echo '=========' """$@"""
|
||||
echo '===================='
|
||||
echo '===================='
|
||||
echo '********************'
|
||||
echo '********************'
|
||||
echo '*********' """$@"""
|
||||
echo '********************'
|
||||
echo '********************'
|
||||
}
|
||||
|
||||
function assert_file_missing() {
|
||||
@@ -24,6 +24,10 @@ function assert_file_missing() {
|
||||
function assert_file_exists() {
|
||||
if [[ ! -e "$1" ]]; then
|
||||
echo "ASSERT FAILED: ${1} should exist."
|
||||
echo "PWD="$(/bin/pwd -P)
|
||||
#echo "LS START"
|
||||
#ls -la
|
||||
#echo "LS END"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@@ -246,6 +250,22 @@ assert_file_missing mistake.txt
|
||||
assert_file_exists mistake.txt.gpg
|
||||
# NOTE: It is still in the history. That should be corrected someday.
|
||||
|
||||
PHASE 'Bob enrolls my/path/to/relsecrets.txt.'
|
||||
mkdir my my/path my/path/to
|
||||
echo 'New secret' > my/path/to/relsecrets.txt
|
||||
cd my/path/to
|
||||
blackbox_register_new_file relsecrets.txt
|
||||
assert_file_missing relsecrets.txt
|
||||
assert_file_exists relsecrets.txt.gpg
|
||||
|
||||
PHASE 'Bob decrypts relsecrets.txt.'
|
||||
cd ..
|
||||
blackbox_edit_start to/relsecrets.txt
|
||||
assert_file_exists to/relsecrets.txt
|
||||
assert_file_exists to/relsecrets.txt.gpg
|
||||
assert_file_md5hash to/relsecrets.txt "c47f9c3c8ce03d895b883ac22384cb67"
|
||||
cd ../..
|
||||
|
||||
# TODO(tlim): Add test to make sure that now alice can NOT decrypt.
|
||||
|
||||
#
|
||||
|
||||
@@ -2,6 +2,7 @@ read /etc/profile.d/usrblackbox.sh tools/profile.d-usrblackbox.sh
|
||||
exec /usr/blackbox/bin/_blackbox_common.sh bin/_blackbox_common.sh
|
||||
exec /usr/blackbox/bin/_stack_lib.sh bin/_stack_lib.sh
|
||||
exec /usr/blackbox/bin/blackbox_addadmin bin/blackbox_addadmin
|
||||
exec /usr/blackbox/bin/blackbox_edit bin/blackbox_edit
|
||||
exec /usr/blackbox/bin/blackbox_edit_end bin/blackbox_edit_end
|
||||
exec /usr/blackbox/bin/blackbox_edit_start bin/blackbox_edit_start
|
||||
exec /usr/blackbox/bin/blackbox_initialize bin/blackbox_initialize
|
||||
|
||||
Reference in New Issue
Block a user