aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-30 00:15:33 +0700
committerShulhan <ms@kilabit.info>2023-09-30 00:15:33 +0700
commit28e475508543b2d4968bfe3432f32b3a276e38c7 (patch)
tree652701da7b67aa9467c18e99c279d3645a02d9e7 /testdata
parent28652864b4ba81fcb44e3e7497d4eca1672182de (diff)
downloadawwan-28e475508543b2d4968bfe3432f32b3a276e38c7.tar.xz
all: add option to bypass input passphrase from terminal
In the environment where passphrase cannot be inputted manually, for example, automatic integration or deployment, we need some mechanism where awwan can be executed to copy or decrypt the encrypted file. The option is by reading plain passphrase from file named "awwan.pass" inside the ".ssh" directory. If its exists and not empty, awwan will not prompt for passphrase from terminal, instead use the content of that file as passhprase.
Diffstat (limited to 'testdata')
l---------testdata/encrypt-with-passfile/.ssh/awwan.key1
-rw-r--r--testdata/encrypt-with-passfile/.ssh/awwan.pass1
-rw-r--r--testdata/encrypt-with-passfile/plain.txt2
-rw-r--r--testdata/encrypt-with-passfile/test.data6
4 files changed, 10 insertions, 0 deletions
diff --git a/testdata/encrypt-with-passfile/.ssh/awwan.key b/testdata/encrypt-with-passfile/.ssh/awwan.key
new file mode 120000
index 0000000..59f8d8e
--- /dev/null
+++ b/testdata/encrypt-with-passfile/.ssh/awwan.key
@@ -0,0 +1 @@
+../../encrypt-with-passphrase/.ssh/awwan.key \ No newline at end of file
diff --git a/testdata/encrypt-with-passfile/.ssh/awwan.pass b/testdata/encrypt-with-passfile/.ssh/awwan.pass
new file mode 100644
index 0000000..55b8390
--- /dev/null
+++ b/testdata/encrypt-with-passfile/.ssh/awwan.pass
@@ -0,0 +1 @@
+s3cret \ No newline at end of file
diff --git a/testdata/encrypt-with-passfile/plain.txt b/testdata/encrypt-with-passfile/plain.txt
new file mode 100644
index 0000000..a769b9d
--- /dev/null
+++ b/testdata/encrypt-with-passfile/plain.txt
@@ -0,0 +1,2 @@
+[secret]
+pass = thisisasecret
diff --git a/testdata/encrypt-with-passfile/test.data b/testdata/encrypt-with-passfile/test.data
new file mode 100644
index 0000000..a7bdd69
--- /dev/null
+++ b/testdata/encrypt-with-passfile/test.data
@@ -0,0 +1,6 @@
+Test encrypt and decrypt with passhrase stored in ".ssh/awwan.pass".
+
+<<< plain.txt
+[secret]
+pass = thisisasecret
+