Conversation
2a0fe56 to
d5cb457
Compare
IB-8631 Signed-off-by: Raul Metsma <raul@metsma.ee>
| auto changed = info[0xDF2F]; | ||
| d->locked[QSmartCardData::PinType(type)] = changed && changed.data[0] == 0; | ||
| d->locked[QSmartCardData::PinType(type)] = (changed && changed.data[0] == 0); | ||
| // FIXME: remove from production |
Check notice
Code scanning / CodeQL
FIXME comment Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 12 hours ago
In general, the way to fix this issue is to remove the temporary/testing logic associated with the FIXME and rely solely on properly implemented behavior. Here, that means eliminating the environment-variable-based override of the locked state for Pin1Type.
Concretely, in client/QSmartCard.cpp inside THALESCard::updateCounters, we should delete the FIXME comment and the if block that checks PIN1_LOCKED and forcibly sets d->locked[...] = true. The rest of the function already sets locked based on the TLV field 0xDF2F, which is the intended production behavior. No new methods, imports, or definitions are needed; we are only removing code, not adding functionality.
| @@ -481,9 +481,6 @@ | ||
| d->retry[QSmartCardData::PinType(type)] = quint8(retry.data[0]); | ||
| auto changed = info[0xDF2F]; | ||
| d->locked[QSmartCardData::PinType(type)] = (changed && changed.data[0] == 0); | ||
| // FIXME: remove from production | ||
| if (type == QSmartCardData::Pin1Type && qEnvironmentVariableIsSet("PIN1_LOCKED")) | ||
| d->locked[QSmartCardData::PinType(type)] = true; | ||
| } | ||
| else | ||
| return false; |
IB-8631
Signed-off-by: Raul Metsma raul@metsma.ee