| 411 | } |
| 412 | |
| 413 | bool WizAESDecryptToString(const unsigned char* cipher, \ |
| 414 | const QByteArray& inStr, QByteArray& outStr) |
| 415 | { |
| 416 | QBuffer ibuf, obuf; |
| 417 | ibuf.setData(inStr); |
| 418 | |
| 419 | if (!ibuf.open(QIODevice::ReadOnly) || !obuf.open(QIODevice::ReadWrite)) { |
| 420 | TOLOG("Can't open buffer"); |
| 421 | return false; |
| 422 | } |
| 423 | |
| 424 | QDataStream is(&ibuf), os(&obuf); |
| 425 | |
| 426 | if (!simpleAESDecrypt(cipher, &is, &os)) { |
| 427 | TOLOG("AES decrypt failed"); |
| 428 | return false; |
| 429 | } |
| 430 | |
| 431 | outStr.clear(); |
| 432 | outStr.append(obuf.buffer()); |
| 433 | return true; |
| 434 | } |
| 435 | |
| 436 | bool WizAESDecryptBase64StringToString(const QString& password, \ |
| 437 | const QString& inBase64Str, QString& outStr) |
no test coverage detected