Skip to content

Commit c2e39c5

Browse files
committed
Fix Change Key parameter usage on CreateApplicationEV1 and CreateApplicationEV2 commands
1 parent f47e24c commit c2e39c5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

CredentialProvisioning.Encoding.LLA/Chip/DESFire/CreateApplicationEV1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ public class CreateApplicationEV1(Leosac.CredentialProvisioning.Encoding.Chip.DE
77
public override void Run(DESFireEV1Commands cmd, EncodingContext encodingCtx, LLACardContext cardCtxdeviceCtx)
88
{
99
if (Properties.FidSupport == Encoding.Chip.DESFire.FidSupport.Enabled)
10-
cmd.createApplication(Properties.AID, (DESFireKeySettings)Properties.KeySettings, Properties.MaxNbKeys, (DESFireKeyType)Properties.KeyType, (FidSupport)Properties.FidSupport, Properties.IsoFID.GetValueOrDefault(0), Properties.IsoDFName?.ToByteVector() ?? []);
10+
cmd.createApplication(Properties.AID, (DESFireKeySettings)((byte)Properties.KeySettings | (Properties.ChangeKey << 4)), Properties.MaxNbKeys, (DESFireKeyType)Properties.KeyType, (FidSupport)Properties.FidSupport, Properties.IsoFID.GetValueOrDefault(0), Properties.IsoDFName?.ToByteVector() ?? []);
1111
else
12-
cmd.createApplication(Properties.AID, (DESFireKeySettings)Properties.KeySettings, Properties.MaxNbKeys, (DESFireKeyType)Properties.KeyType, (FidSupport)Properties.FidSupport);
12+
cmd.createApplication(Properties.AID, (DESFireKeySettings)((byte)Properties.KeySettings | (Properties.ChangeKey << 4)), Properties.MaxNbKeys, (DESFireKeyType)Properties.KeyType, (FidSupport)Properties.FidSupport);
1313
}
1414
}
1515
}

CredentialProvisioning.Encoding.LLA/Chip/DESFire/CreateApplicationEV2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class CreateApplicationEV2(Leosac.CredentialProvisioning.Encoding.Chip.DE
66
{
77
public override void Run(DESFireEV2Commands cmd, EncodingContext encodingCtx, LLACardContext cardCtxdeviceCtx)
88
{
9-
cmd.createApplication(Properties.AID, (DESFireKeySettings)Properties.KeySettings, Properties.MaxNbKeys, (DESFireKeyType)Properties.KeyType, (FidSupport)Properties.FidSupport, Properties.IsoFID.GetValueOrDefault(0), Properties.IsoDFName?.ToByteVector() ?? [], Properties.NumberKeySets, Properties.MaxKeySize, Properties.ActualKeySetVersion, Properties.RollKeyNo, Properties.SpecificCapabilityData, Properties.SpecificVCKeys);
9+
cmd.createApplication(Properties.AID, (DESFireKeySettings)((byte)Properties.KeySettings | (Properties.ChangeKey << 4)), Properties.MaxNbKeys, (DESFireKeyType)Properties.KeyType, (FidSupport)Properties.FidSupport, Properties.IsoFID.GetValueOrDefault(0), Properties.IsoDFName?.ToByteVector() ?? [], Properties.NumberKeySets, Properties.MaxKeySize, Properties.ActualKeySetVersion, Properties.RollKeyNo, Properties.SpecificCapabilityData, Properties.SpecificVCKeys);
1010
}
1111
}
1212
}

0 commit comments

Comments
 (0)