juhovh/shairport — comment on commit b57a269d536b7799fa8d056a5a6407dab3f79e3f
File:  line 0
By juhovh:

Thanks for the comments. The memcpy was a brainfart from my part, I think I got confused by the different order of parameters in AES_cbc_encrypt and memcpy. You're absolutely right there, apparently ALAC decoder doesn't seem to care about wrong bytes in the end since I didn't notice audible difference.

However, I don't quite understand what's the problem with AES_cbc_encrypt. If len is for example 18 I believe len & ~0xf should return 16, therefore decrypting less? Could make it len/16*16 for clarity as well.

Anyway, these pull requests are not that important. I'm writing the airtunes handler from scratch just for fun and thought to document possible weird things I come across. That use of AES_cbc_encrypt was just weird, because the whole point of CBC encryption is to handle multiple blocks at once.