libaacs | branch: master | npzacs <npz...@gmail.com> | Fri Feb  5 12:24:37 2016 
+0200| [d92b24858db071772edfb94983c801f145ee9127] | committer: npzacs

aacs_get_disc_id(): check for empty id

> http://git.videolan.org/gitweb.cgi/libaacs.git/?a=commit;h=d92b24858db071772edfb94983c801f145ee9127
---

 src/libaacs/aacs.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/libaacs/aacs.c b/src/libaacs/aacs.c
index 35627ce..8ae4044 100644
--- a/src/libaacs/aacs.c
+++ b/src/libaacs/aacs.c
@@ -92,8 +92,9 @@ struct aacs {
     uint8_t   device_binding_id[16];
 };
 
-static const uint8_t empty_key[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00,
-                                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00 };
+static const uint8_t empty_key[20] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00,
+                                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00,
+                                       0x00, 0x00, 0x00, 0x00 };
 static const uint8_t aacs_iv[16]   = { 0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 
0x1f, 0xb3,
                                        0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 
0x0f, 0x78 };
 
@@ -1288,7 +1289,11 @@ int aacs_get_mkb_version(AACS *aacs)
 
 const uint8_t *aacs_get_disc_id(AACS *aacs)
 {
-    return aacs->disc_id;
+    if (memcmp(aacs->disc_id, empty_key, sizeof(aacs->disc_id))) {
+        return aacs->disc_id;
+    }
+
+    return NULL;
 }
 
 const uint8_t *aacs_get_content_cert_id(AACS *aacs)

_______________________________________________
libaacs-devel mailing list
libaacs-devel@videolan.org
https://mailman.videolan.org/listinfo/libaacs-devel

Reply via email to