philippe44/libraop

Unnecessary encryption step

LinusU opened this issue · 4 comments

I've been scratching my head for a while trying to figure out what's going on here:

https://github.com/philippe44/RAOP-Player/blob/d972b6d90a3eed039b46948804e1b4d81fc6fe5d/src/rtsp_client.c#L472-L480

It seems to me like data that we encrypt on line 475 is being immediately overwritten by line 477 and 478?

It's quite possible that I'm missing something, so I would love some enlightenment ☺️

This is the way CTR encryption works as ou want the counter to increment

I see, what do you think about being able to pass in NULL as the data pointer, and then just having it call ctr_clock_keystream on the key the appropriate amount of times? Maybe this doesn't make sense though and it's good as it is ☺️

Well ... it's a bit out of lazyness but this ATV crypto was really a serious pain and I have a lot to do these days, so I'm not a big fan of changing something that is not an ugly hack and works fine. I'm okay to do the change if you have tested and validated it, otherwise I'll keep it like it is. I've mentionned the "issue" in the doc I wrote about this encryption

Sounds like it is good as it is 👍