MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / loadLastGoodRawId

Method loadLastGoodRawId

app/src/Licensing/MachineID.cpp:286–297  ·  view source on GitHub ↗

* @brief Returns the persisted last-good raw id, but only when it was saved for this same OS. */

Source from the content-addressed store, hash-verified

284 * @brief Returns the persisted last-good raw id, but only when it was saved for this same OS.
285 */
286QString 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.

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
decryptToStringMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected