Jean-Baptiste Kempf pushed to branch master at VideoLAN / libaacs


Commits:
0471e05d by Poren Chiang at 2025-07-09T04:49:44+08:00
macOS: Fix incorrect CDB length param

This commit fixes MMC authentication failure by providing the
correct Command Descriptor Block (CDB) length to the IOKit API.

Previously, the code just asked for 16-byte CDB, but this behavior
does not cohere with the SCSI MMC specification and will fail on
certain drives. Replacing 16- to 12- just like Windows fixes the
problem.

Signed-off-by: Poren Chiang <[email protected]>

- - - - -


1 changed file:

- src/file/mmc_device_darwin.c


Changes:

=====================================
src/file/mmc_device_darwin.c
=====================================
@@ -128,7 +128,8 @@ int device_send_cmd(MMCDEV *mmc, const uint8_t *cmd, 
uint8_t *buf, size_t tx, si
         SCSICommandDescriptorBlock cdb = {0};
         memcpy(cdb, cmd, sizeof(cdb));
 
-        rc = (*task)->SetCommandDescriptorBlock(task, cdb, 
kSCSICDBSize_16Byte);
+        // CDB is 12 bytes long according to SCSI MMC-5 Standard
+        rc = (*task)->SetCommandDescriptorBlock(task, cdb, 
kSCSICDBSize_12Byte);
         if (kIOReturnSuccess != rc) {
             BD_DEBUG(DBG_MMC, "Error setting SCSI command\n");
             break;



View it on GitLab: 
https://code.videolan.org/videolan/libaacs/-/commit/0471e05dc17ab23af1a74fde7b753de15e469b49

-- 
View it on GitLab: 
https://code.videolan.org/videolan/libaacs/-/commit/0471e05dc17ab23af1a74fde7b753de15e469b49
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
libaacs-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libaacs-devel

Reply via email to