[PATCH] libdvdcss: fix uninitialized disk key
Hi! This was originally the patch to libdvdcss-dev from 2007-09-25, but it looks like that maillist is almost dead, so I decided to propose it here (seeing that mplayer has a local libdvdcss copy). Below is the descripiton of the patch (applies with -2 lines fuzz): ============================================== Under certain conditions, the array "dvdcss->css.p_disc_key" may remain uninitialized till the line (libdvdcss.c:492) sprintf( &psz_key[1+i*2], "%.2x", dvdcss->css.p_disc_key[i] ); which will cause the "CSS keys cache folder" name for the DVD to be generated using raw memory contents. This will lead to a bug when libdvdcss often will not see the folder with previously cached keys and on the next DVD open attempt will retry the brute-force keys retrieval. The attached patch fixes this for two different cases: libdvdcss.c: for the case when DVD is encrypted but no ioctl is available (which is usual for encrypted DVDs copied via dd /dev/cdrom /path/to/file ) css.c: for the case when key decryption fails, the fallback is done, but disk key is not zeroed ============================================== Regards, Kirill
2008/3/21 Kirill Belokurov <kirill.belokurov@gmail.com>:
Hi!
This was originally the patch to libdvdcss-dev from 2007-09-25, but it looks like that maillist is almost dead, so I decided to propose it here (seeing that mplayer has a local libdvdcss copy). Below is the descripiton of the patch (applies with -2 lines fuzz):
============================================== Under certain conditions, the array "dvdcss->css.p_disc_key" may remain uninitialized till the line (libdvdcss.c:492)
sprintf( &psz_key[1+i*2], "%.2x", dvdcss->css.p_disc_key[i] );
which will cause the "CSS keys cache folder" name for the DVD to be generated using raw memory contents. This will lead to a bug when libdvdcss often will not see the folder with previously cached keys and on the next DVD open attempt will retry the brute-force keys retrieval.
The attached patch fixes this for two different cases:
libdvdcss.c: for the case when DVD is encrypted but no ioctl is available (which is usual for encrypted DVDs copied via dd /dev/cdrom /path/to/file )
css.c: for the case when key decryption fails, the fallback is done, but disk key is not zeroed ==============================================
While we are talking about libdvdnav, this patch has never been reviewed. Just my 2cent's ping ;) -- Guillaume LECERF GeeXboX developer - www.geexbox.org
participants (2)
-
Guillaume LECERF -
Kirill Belokurov