fix: support Linux v11 cipher prefix for Chromium decryption (#571)

This commit is contained in:
Roger
2026-04-13 22:12:40 +08:00
committed by GitHub
parent 370c5882c4
commit eb58ebbbf4
8 changed files with 105 additions and 7 deletions
+2
View File
@@ -13,6 +13,7 @@ func TestDetectVersion(t *testing.T) {
want CipherVersion
}{
{"v10 prefix", []byte("v10" + "encrypted_data"), CipherV10},
{"v11 prefix", []byte("v11" + "encrypted_data"), CipherV11},
{"v20 prefix", []byte("v20" + "encrypted_data"), CipherV20},
{"no prefix (DPAPI)", []byte{0x01, 0x00, 0x00, 0x00}, CipherDPAPI},
{"short input", []byte{0x01, 0x02}, CipherDPAPI},
@@ -34,6 +35,7 @@ func Test_stripPrefix(t *testing.T) {
want []byte
}{
{"strips v10", []byte("v10PAYLOAD"), []byte("PAYLOAD")},
{"strips v11", []byte("v11PAYLOAD"), []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}},