MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / verifyCertPassword

Method verifyCertPassword

src/database/WizDatabase.cpp:4588–4623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4586}
4587
4588bool WizDatabase::verifyCertPassword(QString password)
4589{
4590 QString n;
4591 QString e;
4592 QString hint;
4593 QString encrypted_d;
4594 getUserCert(n, e, encrypted_d, hint);
4595
4596 QString d;
4597
4598 if (WizAESDecryptBase64StringToString(password, encrypted_d, d)
4599 && d.length() > 0)
4600 {
4601 if (atoi(d.left(6).toUtf8()) != 0) {
4602 WizUserCertPassword::Instance().setPassword(m_info.bizGUID, password);
4603 return true;
4604 }
4605 }
4606
4607 if (!refreshCertFromServer())
4608 return false;
4609
4610 getUserCert(n, e, encrypted_d, hint);
4611
4612 if (WizAESDecryptBase64StringToString(password, encrypted_d, d)
4613 && d.length() > 0)
4614 {
4615 loadUserCert();
4616 if (atoi(d.left(6).toUtf8()) != 0) {
4617 WizUserCertPassword::Instance().setPassword(m_info.bizGUID, password);
4618 return true;
4619 }
4620 }
4621
4622 return false;
4623}
4624
4625
4626bool WizDatabase::QueryCertPassword()

Callers 2

onCipherCheckRequestMethod · 0.80
foreachFunction · 0.80

Calls 3

lengthMethod · 0.80
setPasswordMethod · 0.45

Tested by

no test coverage detected