| 4586 | } |
| 4587 | |
| 4588 | bool 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 | |
| 4626 | bool WizDatabase::QueryCertPassword() |
no test coverage detected