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
+12
View File
@@ -52,6 +52,18 @@ func TestDecryptValue_V10(t *testing.T) {
}
}
func TestDecryptValue_V11(t *testing.T) {
plaintext := []byte("test_secret_value")
testCBCIV := bytes.Repeat([]byte{0x20}, 16)
cbcEncrypted, err := crypto.AESCBCEncrypt(testAESKey, testCBCIV, plaintext)
require.NoError(t, err)
v11Ciphertext := append([]byte("v11"), cbcEncrypted...)
got, err := decryptValue(testAESKey, v11Ciphertext)
require.NoError(t, err)
assert.Equal(t, plaintext, got)
}
func TestDecryptValue_V20(t *testing.T) {
// v20 App-Bound Encryption is not yet implemented.
// TODO: add successful decryption cases when implemented.