core: fix WebRTC encryption, test (#3005)

This commit is contained in:
Evgeny Poberezkin
2023-09-02 23:34:00 +01:00
committed by GitHub
parent 461142b875
commit af02a92442
2 changed files with 50 additions and 2 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ cTransformMedia f cKey cFrame cFrameLen = do
frame <- getByteString cFrame cFrameLen
runExceptT (f key frame >>= liftIO . putFrame) >>= newCAString . fromLeft ""
where
putFrame s = when (B.length s < fromIntegral cFrameLen) $ putByteString cFrame s
putFrame s = when (B.length s <= fromIntegral cFrameLen) $ putByteString cFrame s
{-# INLINE cTransformMedia #-}
chatEncryptMedia :: ByteString -> ByteString -> ExceptT String IO ByteString