| 263 | |
| 264 | // |
| 265 | bool WizZiwReader::decryptFileToData(const QString& strEncryptedFileName, QByteArray& destData) |
| 266 | { |
| 267 | if (!decryptRSAdPart(m_d)) |
| 268 | return false; |
| 269 | // |
| 270 | WIZZIWHEADER header; |
| 271 | if (!loadZiwHeader(strEncryptedFileName, header)) { |
| 272 | TOLOG("Unable loading header"); |
| 273 | return false; |
| 274 | } |
| 275 | // |
| 276 | QByteArray ziwPassword; |
| 277 | QByteArray encryptedZiwPassword((const char *)header.szEncryptedKey, WIZZIWFILE_KEY_LENGTH); |
| 278 | if (!decryptZiwPassword(encryptedZiwPassword, ziwPassword)) { |
| 279 | return false; |
| 280 | } |
| 281 | // |
| 282 | QByteArray encryptedData; |
| 283 | if (!loadZiwData(strEncryptedFileName, encryptedData)) { |
| 284 | return false; |
| 285 | } |
| 286 | // |
| 287 | if (!WizAESDecryptToString((const unsigned char *)(ziwPassword.constData()), encryptedData, destData)) { |
| 288 | return false; |
| 289 | } |
| 290 | |
| 291 | return true; |
| 292 | } |
| 293 | |
| 294 | bool WizZiwReader::decryptFileToFile(const QString& strEncryptedFileName, const QString& destFileName) |
| 295 | { |
nothing calls this directly
no test coverage detected