add compile-time flag to turn off pin check

master
Andre Puschmann 7 years ago
parent cfd387e7b0
commit 0c94974da6

@ -29,6 +29,8 @@
#include <srsue/hdr/upper/pcsc_usim.h> #include <srsue/hdr/upper/pcsc_usim.h>
#include "srslte/common/bcd_helpers.h" #include "srslte/common/bcd_helpers.h"
#define CHECK_SIM_PIN 1
using namespace srslte; using namespace srslte;
namespace srsue{ namespace srsue{
@ -502,6 +504,7 @@ int pcsc_usim::scard::init(usim_args_t *args, srslte::log *log_)
} }
} }
#if CHECK_SIM_PIN
// Verify whether CHV1 (PIN1) is needed to access the card. // Verify whether CHV1 (PIN1) is needed to access the card.
ret = pin_needed(buf, blen); ret = pin_needed(buf, blen);
if (ret < 0) { if (ret < 0) {
@ -530,6 +533,9 @@ int pcsc_usim::scard::init(usim_args_t *args, srslte::log *log_)
goto clean_exit; goto clean_exit;
} }
} }
#else
pin1_needed = false;
#endif
ret = SCardEndTransaction(scard_handle, SCARD_LEAVE_CARD); ret = SCardEndTransaction(scard_handle, SCARD_LEAVE_CARD);
if (ret != SCARD_S_SUCCESS) { if (ret != SCARD_S_SUCCESS) {

Loading…
Cancel
Save