mirror of
https://github.com/abue-ammar/tinycast.git
synced 2026-10-02 08:14:38 +08:00
Bitwarden derives its session hash with `crypto.pbkdf2` after `bw unlock`, and the shim had no such function, so the TypeError surfaced as a credentials failure and the vault re-prompted on every launch. Its vault cache and Easy Dictionary's Caiyun config also need `createCipheriv` and `createDecipheriv`. The shim now provides `pbkdf2`, `pbkdf2Sync`, `createCipheriv` and `createDecipheriv` for AES-128, -192 and -256 in CBC or ECB, with `setAutoPadding`, backed by CommonCrypto. A cipher buffers its updates and runs one host call in `final`. Decryption strips PKCS#7 padding itself, because CommonCrypto accepts padding OpenSSL rejects and a wrong key would otherwise return garbage instead of `ERR_OSSL_BAD_DECRYPT`. Closes #643