fix: per-tier master-key retrievers for mixed-cipher profiles (#579)

* fix: per-tier master-key retrievers for mixed-cipher profiles
This commit is contained in:
Roger
2026-04-20 17:33:38 +08:00
committed by GitHub
parent e50c623db0
commit 7b9a973c9c
29 changed files with 699 additions and 227 deletions
+2
View File
@@ -14,6 +14,7 @@ func TestDetectVersion(t *testing.T) {
}{
{"v10 prefix", []byte("v10" + "encrypted_data"), CipherV10},
{"v11 prefix", []byte("v11" + "encrypted_data"), CipherV11},
{"v12 prefix", []byte("v12" + "encrypted_data"), CipherV12},
{"v20 prefix", []byte("v20" + "encrypted_data"), CipherV20},
{"no prefix (DPAPI)", []byte{0x01, 0x00, 0x00, 0x00}, CipherDPAPI},
{"short input", []byte{0x01, 0x02}, CipherDPAPI},
@@ -36,6 +37,7 @@ func Test_stripPrefix(t *testing.T) {
}{
{"strips v10", []byte("v10PAYLOAD"), []byte("PAYLOAD")},
{"strips v11", []byte("v11PAYLOAD"), []byte("PAYLOAD")},
{"strips v12", []byte("v12PAYLOAD"), []byte("PAYLOAD")},
{"strips v20", []byte("v20PAYLOAD"), []byte("PAYLOAD")},
{"keeps DPAPI unchanged", []byte{0x01, 0x00, 0x00}, []byte{0x01, 0x00, 0x00}},
{"keeps short unchanged", []byte{0x01}, []byte{0x01}},