[libdvdcss-devel] Bug concerning RPC-1-patched drives
danhaim at danhaim.com
danhaim at danhaim.com
Sun Jan 22 13:31:14 CET 2012
Hi,
I think I found a bug in libdvdcss where drives flashed with
RPC-1-patched firmware are concerned. Many times these drives will not
report themselves as RPC-1 but would rather not recognize the relevant
ioctls at all (like actual old RPC-1 drives' behavior). This causes
ioctl_ReportRPC to fail and _dvdcss_test, in turn, to report a -2 return
code, which prevents the disc from being authenticated.
This leads to two problems -
1) libdvdcss skips the key method and goes straight to brute force
cracking - which takes a significant amount of time and in this case is
unnecessary,
2) My own (RPC-1-patched) DVD drive had an even worse case - It would
not allow encrypted VOB files to be read at all until the disc is
authenticated, which causes the brute force approach to fail and in turn
not allow playback of encrypted DVDs at all.
I believe that the default behavior should be changed such that if
ioctl_ReportRPC fails, we assume the drive is RPC-1 and attempt to
authenticate the disc using the key method anyway. If it succeeds,
great, if not, we fall-back like usual.
The relevant code is in function _dvdcss_test in css.c :
i_ret = ioctl_ReportRPC( dvdcss->i_fd, &i_type, &i_mask, &i_rpc);
if( i_ret < 0 )
{
- print_error( dvdcss, "css error: could not get RPC status" );
- return -2;
+ print_debug( dvdcss, "css error: could not get RPC status,
assuming RPC-1 drive" );
+ i_rpc = 0;
+ i_type = 0;
+ i_mask = 0;
}
I tested this and was able to play encrypted DVDs with the modified
libdvdcss library (was completely unable before).
More information about the libdvdcss-devel
mailing list