fix(player): fileKey is 16-sym hex
This commit is contained in:
parent
6955cd3e93
commit
986f0d5354
1 changed files with 4 additions and 1 deletions
|
|
@ -14,7 +14,10 @@ function truncPadding(padded: Uint8Array): Uint8Array {
|
|||
}
|
||||
|
||||
export function decryptSessionBytes(cypher: Uint8Array, keyString: string): Promise<Uint8Array> {
|
||||
const [hexKey, hexIV] = keyString.split(",")
|
||||
if (keyString.length !== 16) {
|
||||
return Promise.reject("Wrong key string format")
|
||||
}
|
||||
const [hexKey, hexIV] = keyString.match(/.{8}/g)
|
||||
if (!is16BitHex(hexIV) || !is16BitHex(hexKey)) {
|
||||
return Promise.reject("Wrong key/iv pair")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue