* @brief Returns the persisted last-good raw id, but only when it was saved for this same OS. */
| 284 | * @brief Returns the persisted last-good raw id, but only when it was saved for this same OS. |
| 285 | */ |
| 286 | QString Licensing::MachineID::loadLastGoodRawId(const QString& os) |
| 287 | { |
| 288 | m_settings.beginGroup("licensing"); |
| 289 | const auto storedRaw = m_settings.value("lastGoodRawId", "").toString(); |
| 290 | const auto storedOs = m_settings.value("lastGoodOs", "").toString(); |
| 291 | m_settings.endGroup(); |
| 292 | |
| 293 | if (storedRaw.isEmpty() || storedOs != os) |
| 294 | return QString(); |
| 295 | |
| 296 | return lastGoodCrypt().decryptToString(storedRaw); |
| 297 | } |
| 298 | |
| 299 | /** |
| 300 | * @brief Persists the current raw id so a later degraded read can reuse it instead of re-keying. |
nothing calls this directly
no test coverage detected