add -EPERM return in case of missing authentication
[librfid] / src / rfid_proto_mifare_classic.c
index 10de288..99386a1 100644 (file)
@@ -64,6 +64,9 @@ mfcl_read(struct rfid_protocol_handle *ph, unsigned int page,
        if (ret < 0)
                return ret;
 
+       if (real_rx_len == 1 && *rx_buf == 0x04)
+               return -EPERM;
+
        if (real_rx_len < *rx_len)
                *rx_len = real_rx_len;