summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-04 19:02:36 +0100
committerJakob Unterwurzacher2019-01-04 19:02:36 +0100
commit30a8fda0a1d69dc9019e35a3da5bb8434ca9dbc0 (patch)
tree170cf585ca882e2021937d5e45a9994e73799b24
parentcb524b60b41bd6d5f101f13d7adda71db4e0acde (diff)
xray: add tests and example aes-gcm fs
The single test compares the gocryptfs-xray output with the expected output.
-rw-r--r--gocryptfs-xray/xray_tests/aesgcm_fs.masterkey.txt5
-rw-r--r--gocryptfs-xray/xray_tests/aesgcm_fs.xray.txt3
-rw-r--r--gocryptfs-xray/xray_tests/aesgcm_fs/fRtDWUFQK9vDAtAJrTbbWgbin0 -> 5082 bytes
-rw-r--r--gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.conf20
-rw-r--r--gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.diriv1
-rw-r--r--gocryptfs-xray/xray_tests/xray_test.go26
6 files changed, 55 insertions, 0 deletions
diff --git a/gocryptfs-xray/xray_tests/aesgcm_fs.masterkey.txt b/gocryptfs-xray/xray_tests/aesgcm_fs.masterkey.txt
new file mode 100644
index 0000000..08b910a
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/aesgcm_fs.masterkey.txt
@@ -0,0 +1,5 @@
+Your master key is:
+
+ f342380e-238f708f-f4eb94d1-fcf79cca-
+ 7e1e9d9a-b9122286-5e4eaae8-a292ee43
+
diff --git a/gocryptfs-xray/xray_tests/aesgcm_fs.xray.txt b/gocryptfs-xray/xray_tests/aesgcm_fs.xray.txt
new file mode 100644
index 0000000..b44a0f7
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/aesgcm_fs.xray.txt
@@ -0,0 +1,3 @@
+Header: Version: 2, Id: aa854388132e168d55250e89070ca5bf
+Block 0: IV: d2d30e816ddebcf6af2e7333b837c8fd, Tag: 66cb786e17f02c9ffd1d722ac0b69f79, Offset: 18 Len: 4128
+Block 1: IV: 82e2c96c1d6f2fd1e985d44feff8bb31, Tag: f4c0743fd073ff779e94c4954b8c6c34, Offset: 4146 Len: 936
diff --git a/gocryptfs-xray/xray_tests/aesgcm_fs/fRtDWUFQK9vDAtAJrTbbWg b/gocryptfs-xray/xray_tests/aesgcm_fs/fRtDWUFQK9vDAtAJrTbbWg
new file mode 100644
index 0000000..9021496
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/aesgcm_fs/fRtDWUFQK9vDAtAJrTbbWg
Binary files differ
diff --git a/gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.conf b/gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.conf
new file mode 100644
index 0000000..9963e2d
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.conf
@@ -0,0 +1,20 @@
+{
+ "Creator": "gocryptfs v1.7-beta1-7-g6b94f5e",
+ "EncryptedKey": "mHLMC8208CamUCy6lpX8BtQ0h93dmhUycXAJRPYJI5d8vHvlS7hVgWOuAIf1wQEWQ2veEo9GBe3rmfmTnGzSvA==",
+ "ScryptObject": {
+ "Salt": "0yHaO65zMQgn9izBA3HlcLkX0KdI3PGBc4799TRVQYo=",
+ "N": 65536,
+ "R": 8,
+ "P": 1,
+ "KeyLen": 32
+ },
+ "Version": 2,
+ "FeatureFlags": [
+ "GCMIV128",
+ "HKDF",
+ "DirIV",
+ "EMENames",
+ "LongNames",
+ "Raw64"
+ ]
+}
diff --git a/gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.diriv b/gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.diriv
new file mode 100644
index 0000000..205ed2f
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/aesgcm_fs/gocryptfs.diriv
@@ -0,0 +1 @@
+Ów5Ó44¦R#òTÃ^• \ No newline at end of file
diff --git a/gocryptfs-xray/xray_tests/xray_test.go b/gocryptfs-xray/xray_tests/xray_test.go
new file mode 100644
index 0000000..a3374b0
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/xray_test.go
@@ -0,0 +1,26 @@
+package xray_tests
+
+import (
+ "bytes"
+ "fmt"
+ "io/ioutil"
+ "os/exec"
+ "testing"
+)
+
+func TestAesgcmXray(t *testing.T) {
+ expected, err := ioutil.ReadFile("aesgcm_fs.xray.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ cmd := exec.Command("../gocryptfs-xray", "aesgcm_fs/fRtDWUFQK9vDAtAJrTbbWg")
+ out, err := cmd.CombinedOutput()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if bytes.Compare(out, expected) != 0 {
+ t.Errorf("Unexpected output")
+ fmt.Printf("expected:\n%s", string(expected))
+ fmt.Printf("have:\n%s", string(out))
+ }
+}