common/encrypt: move constant test key to common code
[xfstests-dev.git] / common / encrypt
index 2e9908adf1cbbf0e900068b6551e926d2c2e2ee4..98a407ce31f42728b13999b1b2b17879bb74d8fa 100644 (file)
@@ -187,6 +187,17 @@ _scratch_mkfs_stable_inodes_encrypted()
        esac
 }
 
+# For some tests it's helpful to always use the same key so that the test's
+# output is always the same.  For this purpose the following key can be used:
+TEST_RAW_KEY=
+for i in {1..64}; do
+       TEST_RAW_KEY+="\\x$(printf "%02x" $i)"
+done
+# Key descriptor: arbitrary value
+TEST_KEY_DESCRIPTOR="0000111122223333"
+# Key identifier: HKDF-SHA512(key=$TEST_RAW_KEY, salt="", info="fscrypt\0\x01")
+TEST_KEY_IDENTIFIER="69b2f6edeee720cce0577937eb8a6751"
+
 # Give the invoking shell a new session keyring.  This makes any keys we add to
 # the session keyring scoped to the lifetime of the test script.
 _new_session_keyring()