mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 04:20:59 +01:00
Fixes and additions: (#20)
- 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>
This commit is contained in:
37
t/crypt.txtar
Normal file
37
t/crypt.txtar
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# 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
|
||||
Reference in New Issue
Block a user