Conditional access is known to be not null.

This commit is contained in:
2021-08-17 17:35:43 +01:00
parent a835c02727
commit 73b212d3bb

View File

@@ -379,8 +379,8 @@ namespace Aaru.Decryption.DVD
/// <returns>A DiscKey struct with the decoded key.</returns> /// <returns>A DiscKey struct with the decoded key.</returns>
public static CSS_CPRM.DiscKey? DecodeDiscKey(byte[] response, byte[] busKey) public static CSS_CPRM.DiscKey? DecodeDiscKey(byte[] response, byte[] busKey)
{ {
if(response?.Length != 2052 || if(response.Length != 2052 ||
busKey?.Length != 5) busKey.Length != 5)
return null; return null;
byte[] key = response.Skip(4).Take(2048).ToArray(); byte[] key = response.Skip(4).Take(2048).ToArray();
@@ -406,8 +406,8 @@ namespace Aaru.Decryption.DVD
/// <returns>A TitleKey struct with the decoded key.</returns> /// <returns>A TitleKey struct with the decoded key.</returns>
public static CSS_CPRM.TitleKey? DecodeTitleKey(byte[] response, byte[] busKey) public static CSS_CPRM.TitleKey? DecodeTitleKey(byte[] response, byte[] busKey)
{ {
if(response?.Length != 12 || if(response.Length != 12 ||
busKey?.Length != 5) busKey.Length != 5)
return null; return null;
byte[] key = response.Skip(5).Take(5).ToArray(); byte[] key = response.Skip(5).Take(5).ToArray();