Discussion:
CSS key cache collisions
James Slorach
2003-03-23 19:49:59 UTC
Permalink
I am using the current CVS version of xine with libdvdcss-1.2.6

The CSS key caching mechanism stores keys in directories named after the
title of the DVD. Unfortunately, this title is not unique - many DVDs use
generic titles such as 'DVDVOLUME' or 'DVD_VIDEO'. This obviously risks
collisions in the cache.

I have noticed at least 7 different collisions, where two or more DVDs
have the same title and attempt to use the same file to cache a key. In
one case, 8 different DVDs use the same file.

This means that the first DVD will be ok, but subsequent DVDs which
collide will attempt to use an incorrect key unless the cached key is
deleted first.

Perhaps the DVD serial number should be used as well as the title? I don't
know if its uniqueness is guaranteed, but the combination of title and
serial number should reduce the chance of collision considerably.


James
--
This is the libdvdcss-devel mailing-list, see http://developers.videolan.org/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <***@videolan.org>
Michael Roitzsch
2003-03-24 17:43:44 UTC
Permalink
Hi James, Hi libdvdcss team,

I have looked through my DVD archive and have also found discs with the
same disc title, although I could not trigger any clash here.
Especially TV series with multiple DVDs per season can suffer from
this. (I am talking about the Star Trek TNG box sets.)

Attached is a patch which includes the serial number into the directory
name. I don't know if this is guaranteed to be safe, but it works
nicely here. The patch also fixes an issue when the key cache is used
together with raw devices: The raw reading has to be enabled after
extracting the disc title and serial, because otherwise the reads will
fail due to the target buffers not being properly aligned in memory.

If James can confirm that this fixes the clashes, I would be glad if
this could make it into cvs. Thanks.

Michael
--
"The use of COBOL cripples the mind; its teaching should therefore be
regarded as a criminal offense."
-E.W. Dijkstra
James Slorach
2003-03-25 00:20:02 UTC
Permalink
Post by Michael Roitzsch
Hi James, Hi libdvdcss team,
I have looked through my DVD archive and have also found discs with the
same disc title, although I could not trigger any clash here.
Especially TV series with multiple DVDs per season can suffer from
this. (I am talking about the Star Trek TNG box sets.)
Attached is a patch which includes the serial number into the directory
name. I don't know if this is guaranteed to be safe, but it works
nicely here. The patch also fixes an issue when the key cache is used
together with raw devices: The raw reading has to be enabled after
extracting the disc title and serial, because otherwise the reads will
fail due to the target buffers not being properly aligned in memory.
If James can confirm that this fixes the clashes, I would be glad if
this could make it into cvs. Thanks.
I have applied the patch to libdvdcss-1.2.6

Actually, it uses the date instead of the serial number. For example:

libdvdcss debug: using CSS key cache dir:
/home/jrs47/.dvdcss//DVD_VIDEO#2000041918251900/
libdvdnav: DVD Title: DVD_VIDEO
libdvdnav: DVD Serial Number: 28939329
libdvdnav: DVD Title (Alternative):

The clashes no longer occur.


I haven't tested the raw device stuff.

James
--
This is the libdvdcss-devel mailing-list, see http://developers.videolan.org/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <***@videolan.org>
Gildas Bazin
2003-03-27 19:00:36 UTC
Permalink
Post by Michael Roitzsch
Attached is a patch which includes the serial number into the directory
name. I don't know if this is guaranteed to be safe, but it works
nicely here. The patch also fixes an issue when the key cache is used
together with raw devices: The raw reading has to be enabled after
extracting the disc title and serial, because otherwise the reads will
fail due to the target buffers not being properly aligned in memory.
If James can confirm that this fixes the clashes, I would be glad if
this could make it into cvs. Thanks.
Thanks for the patch, it has been applied to the cvs.

--
Gildas
--
This is the libdvdcss-devel mailing-list, see http://developers.videolan.org/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <***@videolan.org>
H}kan Hjort
2003-03-28 14:05:55 UTC
Permalink
Post by Gildas Bazin
Post by Michael Roitzsch
Attached is a patch which includes the serial number into the directory
name. I don't know if this is guaranteed to be safe, but it works
nicely here. The patch also fixes an issue when the key cache is used
together with raw devices: The raw reading has to be enabled after
extracting the disc title and serial, because otherwise the reads will
fail due to the target buffers not being properly aligned in memory.
If James can confirm that this fixes the clashes, I would be glad if
this could make it into cvs. Thanks.
Thanks for the patch, it has been applied to the cvs.
Please, could we have some kind of interface for the keys/cache stuff.
I know that this might be agains the general idea with libdvdcss but
I don't think that you can really expect it to work without the user
knowing at least a bit about keys and various regions of the content.

I implemented a, in my opinion, robust DiscID function in libdvdread that
work not only on devices/images but also on mounted disc or file by file
copies. There where a pactch a little while back that tured of caching
for the 'non image' case because it caused collisions. This is also the
normalcase of when the cache is most usefull as there is _no_ possibility
to get the keys from the drive.
It's just unfortunat that there is a misconception among developers/users
that cause lots of people to use drives without ever setting the region.

So I'd want functions to get a key and to tell it to use a supplied
key. It would also be good it one could get a special return code
(or mode of operation) where libdvdcss would wait to 'retrive' the key
until it either sees an encrypted block or it gets a read error.
This is so that one can avoid trying to get (and then crack) the keys
for any unencrypted titles (often video_ts.vob and / or vts_XX_0.vob,
i.e the menu parts).
--
HÃ¥kan Hjort
--
This is the libdvdcss-devel mailing-list, see http://developers.videolan.org/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <***@videolan.org>
Loading...