Access Denied deleting DESFire apps w/ Master Key settings of 0x0F

41 views
Skip to first unread message

Tyler F

unread,
May 19, 2015, 4:44:14 PM5/19/15
to nfc-too...@googlegroups.com
Hello,

I'm able to create applications on a DESFire EV1 card, but not delete them, despite the permissions ostensibly being correct. Any thoughts on what I could be doing wrong?

Regards,

Tyler

Romain Tartière

unread,
May 19, 2015, 5:03:06 PM5/19/15
to nfc-too...@googlegroups.com
Hello

On Tue, May 19, 2015 at 01:44:14PM -0700, Tyler F wrote:
> I'm able to create applications on a DESFire EV1 card, but not delete them,
> despite the permissions ostensibly being correct. Any thoughts on what I
> could be doing wrong?

Can you please provide a minimal example showing the problem ?

Thanks!

--
Romain Tartière <rom...@blogreen.org> http://romain.blogreen.org/
pgp: 8234 9A78 E7C0 B807 0B59 80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
(plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)

Tyler F

unread,
May 19, 2015, 5:14:34 PM5/19/15
to nfc-too...@googlegroups.com

On Tuesday, May 19, 2015 at 5:03:06 PM UTC-4, Romain Tartière wrote:
Hello

On Tue, May 19, 2015 at 01:44:14PM -0700, Tyler F wrote:
> I'm able to create applications on a DESFire EV1 card, but not delete them,
> despite the permissions ostensibly being correct. Any thoughts on what I
> could be doing wrong?

Can you please provide a minimal example showing the problem ?

Thanks!

--
The main part is just this:

int
app_delete(FreefareTag tag, MifareDESFireAID aid) {
    int res;

    res = mifare_desfire_select_application(tag, NULL);
    res = mifare_desfire_delete_application(tag, aid);
    if (res < 0) {
        warn ("Couldn't delete the application");
    } else {
        printf ("Success!\n");
    }
    return res;
}

The init/open/connect sequence is ripped right from another example, and the following works fine:
int
apps_list(FreefareTag tag)
{
    MifareDESFireAID *aids = NULL;
    size_t count;
    int res;

    res = mifare_desfire_get_application_ids(tag, &aids, &count);
    if (res < 0) {
        warn ("Can't retrieve tag AIDs");
        return res;
    }
    printf("Applications: %d\n", count);
    for(int i = 0; aids[i]; i++) {
        printf("[%d] %#08x\n", i, mifare_desfire_aid_get_aid(aids[i]));
    }

    mifare_desfire_free_application_ids(aids);
    return 0;
}

Tyler F

unread,
May 26, 2015, 10:22:58 AM5/26/15
to nfc-too...@googlegroups.com
Maybe it's just a weird card?

- Tyler 
Reply all
Reply to author
Forward
0 new messages