libaacs | branch: master | npzacs <npz...@gmail.com> | Sun Jul 22 16:33:29 2018 
+0300| [e2addd80757a28aa75dec9bdf1dc7f17a5a5db3f] | committer: npzacs

mmc: issue a warning when using AACS2 capable drive

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

 src/libaacs/mmc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/libaacs/mmc.c b/src/libaacs/mmc.c
index 7898380..0845857 100644
--- a/src/libaacs/mmc.c
+++ b/src/libaacs/mmc.c
@@ -48,6 +48,7 @@ struct mmc {
     uint8_t drive_cert[92];
 
     uint8_t read_drive_cert;
+    uint8_t aacs_version;
 };
 
 /*
@@ -226,8 +227,9 @@ static int _mmc_check_aacs(MMC *mmc)
         uint16_t feature = MKINT_BE16(buf+8);
         if (feature == 0x010d) {
             mmc->read_drive_cert = !!(buf[4+8] & 0x10);
+            mmc->aacs_version = buf[7+8];
             BD_DEBUG(DBG_MMC, "AACS feature descriptor:\n");
-            BD_DEBUG(DBG_MMC, "  AACS version: %d\n", buf[7+8]);
+            BD_DEBUG(DBG_MMC, "  AACS version: %d\n", mmc->aacs_version);
             BD_DEBUG(DBG_MMC, "  AACS active: %d\n", buf[2+8] & 1);
             BD_DEBUG(DBG_MMC, "  Binding Nonce generation support: %d\n", 
buf[4+8] & 1);
             BD_DEBUG(DBG_MMC, "  Binding Nonce block count: %d\n", buf[5+8]);
@@ -388,6 +390,14 @@ MMC *mmc_open(const char *path)
 #endif
     }
 
+    if (mmc->aacs_version > 1) {
+        BD_DEBUG(DBG_MMC | DBG_CRIT, "WARNING: unsupported AACS2 drive 
detected.\n");
+#if 0
+        mmc_close (mmc);
+        return NULL;
+#endif
+    }
+
     if (mmc->read_drive_cert) {
         mmc_read_drive_cert(mmc, mmc->drive_cert);
     }

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

Reply via email to