Only allow change PHY without PIN. PIN is required for other extra options.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-04-22 23:47:08 +02:00
parent de89d61359
commit 218660e694
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -28,6 +28,12 @@
#include "mbedtls/chachapoly.h"
int cmd_extras() {
#ifndef ENABLE_EMULATION
// Only allow change PHY without PIN
if (!isUserAuthenticated && P1(apdu) != 0x1B) {
return SW_SECURITY_STATUS_NOT_SATISFIED();
}
#endif
if (P1(apdu) == 0xA) { //datetime operations
if (P2(apdu) != 0x0) {
return SW_INCORRECT_P1P2();