tests: add hkdf_sanity tests with broken example filesystem
These are deliberately corrupt.
This commit is contained in:
parent
cb47f65212
commit
f1dbd19fe9
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"Creator": "gocryptfs v1.2.1-32-g14038a1-dirty",
|
||||
"EncryptedKey": "b3888jnQC5GYem+YGtUkOTS13/YCOfA6J0/bkftfEoNA9fZTN2xMGw4c+LK+emg4L6P2wGvm44RUqCfFfgowxw==",
|
||||
"ScryptObject": {
|
||||
"Salt": "7YnR8bF7TzYNP5mIwmpQ1qj4e/QZkbH92Hx7YQctIZQ=",
|
||||
"N": 1024,
|
||||
"R": 8,
|
||||
"P": 1,
|
||||
"KeyLen": 32
|
||||
},
|
||||
"Version": 2,
|
||||
"FeatureFlags": [
|
||||
"GCMIV128",
|
||||
"HKDF",
|
||||
"PlaintextNames"
|
||||
]
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"Creator": "gocryptfs v1.2.1-32-g14038a1-dirty",
|
||||
"EncryptedKey": "0ymk/BtKEN1KmRLMquLinLIzXDaf+GLuP2f9R4VbLOglim9nXd5WxkCFl0DQg0J2FtCEke9MQBaCfL5OTJdR4g==",
|
||||
"ScryptObject": {
|
||||
"Salt": "tCrF2o5GoOyQt0LAlCWk47hyJsF5K6ID9uPzjTSBbh8=",
|
||||
"N": 1024,
|
||||
"R": 8,
|
||||
"P": 1,
|
||||
"KeyLen": 32
|
||||
},
|
||||
"Version": 2,
|
||||
"FeatureFlags": [
|
||||
"GCMIV128",
|
||||
"HKDF",
|
||||
"DirIV",
|
||||
"EMENames",
|
||||
"LongNames",
|
||||
"Raw64"
|
||||
]
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
ï%C´×xõ(E<>£!½dц
|
|
@ -0,0 +1,34 @@
|
|||
// We test two filesystems that have the "HKDF" feature flag in their config file
|
||||
// set, but the actual file contents and names are encrypted with HKDF disabled.
|
||||
// This test verifies that the "HKDF" feature flag in the config file takes effect.
|
||||
package hkdf_sanity
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/rfjakob/gocryptfs/tests/test_helpers"
|
||||
)
|
||||
|
||||
func TestBrokenContent(t *testing.T) {
|
||||
cDir := "broken_content"
|
||||
pDir := test_helpers.TmpDir + "/" + cDir
|
||||
test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test", "-wpanic=false")
|
||||
_, err := ioutil.ReadFile(pDir + "/status.txt")
|
||||
if err == nil {
|
||||
t.Error("this should fail")
|
||||
}
|
||||
test_helpers.UnmountPanic(pDir)
|
||||
}
|
||||
|
||||
func TestBrokenNames(t *testing.T) {
|
||||
cDir := "broken_names"
|
||||
pDir := test_helpers.TmpDir + "/" + cDir
|
||||
test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test", "-wpanic=false")
|
||||
_, err := os.Stat(pDir + "/status.txt")
|
||||
if err == nil {
|
||||
t.Error("this should fail")
|
||||
}
|
||||
test_helpers.UnmountPanic(pDir)
|
||||
}
|
Loading…
Reference in New Issue