KeyNotFoundException: DVD_DiscKey_Decrypted: crash when dumping DVD-ROM without copy protection #659

Closed
opened 2026-01-29 15:25:22 +00:00 by claunia · 0 comments
Owner

Originally created by @terinjokes on GitHub (Jan 31, 2021).

Prerequisites

  • Are you running the latest version?
  • Can you reproduce the problem in the debug version?

Check and fill as appropriate:

  • I was running Aaru under Windows [version here]...
  • I was running Aaru under Linux 5.10.3
  • I was running Aaru under macOS [version here]...
  • ...in 32-bit
  • ...in 64-bit
  • ...using an Intel / AMD processor
  • ...using an ARM or Apple Silicon processor
  • Device manufacturer: HP
  • Model: GH40L
  • Bus:
    • Parallel ATA
    • Serial ATA
    • SCSI (any)
    • ATAPI (mark above if parallel or serial)
    • USB
      • USB cable manufacturer: Unitek
      • USB cable model: 93-Y-1039-US
    • FireWire
    • PCMCIA
    • SecureDigital
      • Using a USB card reader
        • USB card reader manufacturer:
        • USB card reader model:
    • MultiMediaCard
      • Using a USB card reader
        • USB card reader manufacturer:
        • USB card reader model:
  • I was dumping media (disk, tape, etc)...
  • I was analyzing media (disk, tape, etc)...
  • I was scanning media (disk, tape, etc)...

Description

After dumping a DVD-ROM without copy protection, aaru crashes with an exception attempting to decrypt the disc. I would expect aaru to skip this step if not necessary.

The disc successfully dumped when providing the --title-key=false option.

Exact command line used:

aaru media dump -O compress=false /dev/sr0 dvd.aaru

Output of command execution with debug output enabled

aaru 5.2.99.3380-alpha+539037d5 built by telegraph in Debug, modified
Copyright © 2011-2021 Natalia Portillo

Output image format: Aaru Format.
Device not in database, please create a device report and attach it to a Github issue.

PFI:
Disc is a 120mm DVD-ROM version 1
Disc claims conformation to ECMA-267
Disc maximum transfer rate is 10,08 Mbit/sec.
Disc has 2 layers
Layers are in opposite track path
Pitch size is 0,147 μm/bit
Track size is 0,74 μm
Data area starts at PSN 30000h
Data area ends at PSN FCFFEFh
Layer 0 ends at PSN 222FEFh

Drive reports no copy protection on disc.
Using SCSI READ (10) command.
Media has 4087760 blocks of 2048 bytes/each. (for a total of 7.797 GiB)
Device reports 4087760 blocks (8371732480 bytes).
Device can read 64 blocks at a time.
Device reports 2048 bytes per logical block.
Device reports 2048 bytes per physical block.
SCSI device type: MultiMediaDevice.
SCSI medium type: 0.
SCSI density type: 0.
SCSI floppy mode page present: False.
Media identified as DVDROM
Reading 64 sectors at a time.
Building track map...
Track 1 starts at LBA 0 and ends at LBA 4087759
Setting speed to MAX..
Title keys dumping is enabled. This will be very slow.
Reading sector 4087744 of 4087760 (6.815 MiB/sec.)
Dump finished in 695.7487314 seconds.
Average dump speed 15762.400 KiB/sec.
Average write speed 45737.838 KiB/sec.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: The given key 'DVD_DiscKey_Decrypted' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Aaru.Core.Devices.Dumping.Dump.Sbc(Dictionary`2 mediaTags, MediaType dskType, Boolean opticalDisc, Dump dvdDecrypt) in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/Sbc/Dump.cs:line 744
   at Aaru.Core.Devices.Dumping.Dump.Mmc() in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/MMC.cs:line 859
   at Aaru.Core.Devices.Dumping.Dump.Scsi() in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/SCSI.cs:line 238
   at Aaru.Core.Devices.Dumping.Dump.Start() in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/Dump.cs:line 239
   at Aaru.Commands.Media.DumpMediaCommand.Invoke(Boolean debug, Boolean verbose, String cicmXml, String devicePath, Boolean resume, String encoding, Boolean firstPregap, Boolean fixOffset, Boolean force, Boolean metadata, Boolean trim, String outputPath, String options, Boolean persistent, UInt16 retryPasses, UInt32 skip, Byte speed, Boolean stopOnError, String format, String subchannel, Boolean private, Boolean fixSubchannelPosition, Boolean retrySubchannel, Boolean fixSubchannel, Boolean fixSubchannelCrc, Boolean generateSubchannels, Boolean skipCdiReadyHole, Boolean eject, UInt32 maxBlocks, Boolean useBufferedReads, Boolean storeEncrypted, Boolean titleKeys) in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru/Commands/Media/Dump.cs:line 680
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__9_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseExceptionHandler>b__0>d.MoveNext()

Media details

$ aaru media info /dev/sr0
aaru 5.2.99.3380-alpha+539037d5 built by telegraph in Debug, modified
Copyright © 2011-2021 Natalia Portillo

Error 1 querying ATA PACKET IDENTIFY
Media has 4087760 blocks of 2048 bytes/each. (for a total of 7.797 GiB)
PFI:
Disc is a 120mm DVD-ROM version 1
Disc claims conformation to ECMA-267
Disc maximum transfer rate is 10,08 Mbit/sec.
Disc has 2 layers
Layers are in opposite track path
Pitch size is 0,147 μm/bit
Track size is 0,74 μm
Data area starts at PSN 30000h
Data area ends at PSN FCFFEFh
Layer 0 ends at PSN 222FEFh

Lead-In CMI:
Disc has no encryption.

Media Serial Number:
Media identified as DVDROM
Originally created by @terinjokes on GitHub (Jan 31, 2021). ### Prerequisites * [X] Are you running the latest version? * [X] Can you reproduce the problem in the debug version? ### Check and fill as appropriate: * [ ] I was running Aaru under Windows [version here]... * [X] I was running Aaru under Linux 5.10.3 * [ ] I was running Aaru under macOS [version here]... * [ ] ...in 32-bit * [X] ...in 64-bit * [X] ...using an Intel / AMD processor * [ ] ...using an ARM or Apple Silicon processor * **Device manufacturer**: HP * **Model**: GH40L * **Bus**: * [ ] Parallel ATA * [ ] Serial ATA * [ ] SCSI (any) * [ ] ATAPI (mark above if parallel or serial) * [X] USB * **USB cable manufacturer**: Unitek * **USB cable model**: 93-Y-1039-US * [ ] FireWire * [ ] PCMCIA * [ ] SecureDigital * [ ] Using a USB card reader * **USB card reader manufacturer**: * **USB card reader model**: * [ ] MultiMediaCard * [ ] Using a USB card reader * **USB card reader manufacturer**: * **USB card reader model**: * [ ] I was dumping media (disk, tape, etc)... * [ ] I was analyzing media (disk, tape, etc)... * [ ] I was scanning media (disk, tape, etc)... ### Description After dumping a DVD-ROM without copy protection, aaru crashes with an exception attempting to decrypt the disc. I would expect aaru to skip this step if not necessary. The disc successfully dumped when providing the `--title-key=false` option. ### Exact command line used: ``` aaru media dump -O compress=false /dev/sr0 dvd.aaru ``` ### Output of command execution with debug output enabled <details> ``` aaru 5.2.99.3380-alpha+539037d5 built by telegraph in Debug, modified Copyright © 2011-2021 Natalia Portillo Output image format: Aaru Format. Device not in database, please create a device report and attach it to a Github issue. PFI: Disc is a 120mm DVD-ROM version 1 Disc claims conformation to ECMA-267 Disc maximum transfer rate is 10,08 Mbit/sec. Disc has 2 layers Layers are in opposite track path Pitch size is 0,147 μm/bit Track size is 0,74 μm Data area starts at PSN 30000h Data area ends at PSN FCFFEFh Layer 0 ends at PSN 222FEFh Drive reports no copy protection on disc. Using SCSI READ (10) command. Media has 4087760 blocks of 2048 bytes/each. (for a total of 7.797 GiB) Device reports 4087760 blocks (8371732480 bytes). Device can read 64 blocks at a time. Device reports 2048 bytes per logical block. Device reports 2048 bytes per physical block. SCSI device type: MultiMediaDevice. SCSI medium type: 0. SCSI density type: 0. SCSI floppy mode page present: False. Media identified as DVDROM Reading 64 sectors at a time. Building track map... Track 1 starts at LBA 0 and ends at LBA 4087759 Setting speed to MAX.. Title keys dumping is enabled. This will be very slow. Reading sector 4087744 of 4087760 (6.815 MiB/sec.) Dump finished in 695.7487314 seconds. Average dump speed 15762.400 KiB/sec. Average write speed 45737.838 KiB/sec. Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Collections.Generic.KeyNotFoundException: The given key 'DVD_DiscKey_Decrypted' was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Aaru.Core.Devices.Dumping.Dump.Sbc(Dictionary`2 mediaTags, MediaType dskType, Boolean opticalDisc, Dump dvdDecrypt) in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/Sbc/Dump.cs:line 744 at Aaru.Core.Devices.Dumping.Dump.Mmc() in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/MMC.cs:line 859 at Aaru.Core.Devices.Dumping.Dump.Scsi() in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/SCSI.cs:line 238 at Aaru.Core.Devices.Dumping.Dump.Start() in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru.Core/Devices/Dumping/Dump.cs:line 239 at Aaru.Commands.Media.DumpMediaCommand.Invoke(Boolean debug, Boolean verbose, String cicmXml, String devicePath, Boolean resume, String encoding, Boolean firstPregap, Boolean fixOffset, Boolean force, Boolean metadata, Boolean trim, String outputPath, String options, Boolean persistent, UInt16 retryPasses, UInt32 skip, Byte speed, Boolean stopOnError, String format, String subchannel, Boolean private, Boolean fixSubchannelPosition, Boolean retrySubchannel, Boolean fixSubchannel, Boolean fixSubchannelCrc, Boolean generateSubchannels, Boolean skipCdiReadyHole, Boolean eject, UInt32 maxBlocks, Boolean useBufferedReads, Boolean storeEncrypted, Boolean titleKeys) in /home/terin/Development/github.com/aaru-dps/Aaru/Aaru/Commands/Media/Dump.cs:line 680 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__19_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseHelp>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseTypoCorrections>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__20_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__18_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__10_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__9_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseExceptionHandler>b__0>d.MoveNext() ``` </details> ### Media details <details> ``` $ aaru media info /dev/sr0 aaru 5.2.99.3380-alpha+539037d5 built by telegraph in Debug, modified Copyright © 2011-2021 Natalia Portillo Error 1 querying ATA PACKET IDENTIFY Media has 4087760 blocks of 2048 bytes/each. (for a total of 7.797 GiB) PFI: Disc is a 120mm DVD-ROM version 1 Disc claims conformation to ECMA-267 Disc maximum transfer rate is 10,08 Mbit/sec. Disc has 2 layers Layers are in opposite track path Pitch size is 0,147 μm/bit Track size is 0,74 μm Data area starts at PSN 30000h Data area ends at PSN FCFFEFh Layer 0 ends at PSN 222FEFh Lead-In CMI: Disc has no encryption. Media Serial Number: Media identified as DVDROM ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/Aaru-aaru-dps#659