From e2fe92ee3df1c3be16bf3ffe45bd4f883d9e7e36 Mon Sep 17 00:00:00 2001 From: nvx Date: Fri, 13 May 2022 17:37:11 +1000 Subject: [PATCH] Fix gallagher desfire kdf for default application card master key --- common/generator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/generator.c b/common/generator.c index 4856327e2..4b23d30ce 100644 --- a/common/generator.c +++ b/common/generator.c @@ -482,8 +482,8 @@ int mfdes_kdf_input_gallagher(uint8_t *uid, uint8_t uidLen, uint8_t keyNo, uint3 } int len = 0; - // If the keyNo == 1, then omit the UID. - if (keyNo != 1) { + // If the keyNo == 1 or the aid is 000000, then omit the UID. + if (keyNo != 1 && aid != 0x000000) { if (*kdfInputLen < (4 + uidLen)) { return PM3_EINVARG; }