mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-16 20:10:59 +01:00
- fix encryption bug #19, which was a regression - added encryption unit test - added debug logging here and there Co-authored-by: Thomas von Dein <tom@vondein.org>
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
#
|
|
# Copyright © 2025 Thomas von Dein
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
# encrypt something
|
|
exec env ANYDB_PASSWORD=12345 anydb -f test.db set -e secret eshishinusan
|
|
|
|
# retrieve it
|
|
exec env ANYDB_PASSWORD=12345 anydb -f test.db get secret
|
|
stdout eshishinusan
|
|
|
|
# but has it really been encrypted?
|
|
! exec env ANYDB_PASSWORD=8d8d8 anydb -f test.db get secret
|
|
! stdout eshishinusan
|
|
stderr 'message authentication failed'
|
|
|
|
# what about the listing
|
|
exec anydb -f test.db ls -l
|
|
stdout 'encrypted-content'
|
|
! stdout eshishinusan
|
|
|
|
# and the export?
|
|
exec anydb -f test.db export -o -
|
|
! stdout eshishinusan
|