Commit 3cfe894b by Andrey Udovenko

Additional IV fix. Trim sign bit from BigInteger.toByteArray() output, if it…

Additional IV fix. Trim sign bit from BigInteger.toByteArray() output, if it creates a 17th byte for it. #145
parent 15d3df6a
...@@ -395,8 +395,9 @@ public class HlsChunkSource { ...@@ -395,8 +395,9 @@ public class HlsChunkSource {
byte[] ivData = new BigInteger(iv, 16).toByteArray(); byte[] ivData = new BigInteger(iv, 16).toByteArray();
byte[] ivDataWithPadding = new byte[16]; byte[] ivDataWithPadding = new byte[16];
System.arraycopy(ivData, 0, ivDataWithPadding, ivDataWithPadding.length - ivData.length, int offset = ivData.length > 16 ? ivData.length - 16 : 0;
ivData.length); System.arraycopy(ivData, offset, ivDataWithPadding, ivDataWithPadding.length - ivData.length
+ offset, ivData.length - offset);
encryptedDataSource = new Aes128DataSource(secretKey, ivDataWithPadding, upstreamDataSource); encryptedDataSource = new Aes128DataSource(secretKey, ivDataWithPadding, upstreamDataSource);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment