@@ -247,7 +247,7 @@ static QByteArray decryptAndDecompressMetadata(const QJsonDocument &innerDoc,
247247 // separate "nonce" field.
248248 const QList<QByteArray> ciphertextParts = ciphertextField.split (' |' );
249249 const QByteArray ciphertextBase64 = ciphertextParts.value (0 );
250- const QByteArray ciphertextWithTag = QByteArray::fromBase64 (ciphertextBase64);
250+ const auto ciphertextWithTag = QByteArray::fromBase64 (ciphertextBase64);
251251
252252 printVerbose (QStringLiteral (" Ciphertext+tag size: %1 bytes" ).arg (ciphertextWithTag.size ()));
253253 printVerbose (QStringLiteral (" Nonce size: %1 bytes" ).arg (nonce.size ()));
@@ -277,7 +277,7 @@ static QByteArray decryptAndDecompressMetadata(const QJsonDocument &innerDoc,
277277static QByteArray decryptRsaOaepSha256 (const QByteArray &encryptedKeyBase64,
278278 const QByteArray &privateKeyPem)
279279{
280- const QByteArray encryptedKey = QByteArray::fromBase64 (encryptedKeyBase64);
280+ const auto encryptedKey = QByteArray::fromBase64 (encryptedKeyBase64);
281281
282282 BIO *keyBio = BIO_new_mem_buf (privateKeyPem.constData (), privateKeyPem.size ());
283283 if (!keyBio) {
@@ -352,7 +352,7 @@ static QByteArray decryptRsaOaepSha256(const QByteArray &encryptedKeyBase64,
352352 */
353353static QJsonDocument extractInnerMetadata (const QByteArray &rawFileContents)
354354{
355- const QJsonDocument outerDoc = QJsonDocument::fromJson (rawFileContents);
355+ const auto outerDoc = QJsonDocument::fromJson (rawFileContents);
356356 if (outerDoc.isNull ()) {
357357 return {};
358358 }
@@ -368,7 +368,7 @@ static QJsonDocument extractInnerMetadata(const QByteArray &rawFileContents)
368368
369369 if (!metaDataStr.isEmpty ()) {
370370 printVerbose (QStringLiteral (" OCS envelope detected – extracting inner metadata string" ));
371- const QJsonDocument innerDoc = QJsonDocument::fromJson (metaDataStr.toUtf8 ());
371+ const auto innerDoc = QJsonDocument::fromJson (metaDataStr.toUtf8 ());
372372 if (innerDoc.isNull ()) {
373373 printVerbose (QStringLiteral (" Failed to parse inner metadata string as JSON" ));
374374 }
@@ -727,7 +727,7 @@ static bool verifyCmsSignature(const QByteArray &signatureBase64,
727727 const QJsonDocument &innerDoc,
728728 const QByteArray &certificatePem)
729729{
730- const QByteArray signature = QByteArray::fromBase64 (signatureBase64);
730+ const auto signature = QByteArray::fromBase64 (signatureBase64);
731731
732732 BIO *sigBio = BIO_new_mem_buf (signature.constData (), signature.size ());
733733 CMS_ContentInfo *cms = d2i_CMS_bio (sigBio, nullptr );
@@ -1016,7 +1016,7 @@ int main(int argc, char *argv[])
10161016 // Step 7 – Validate decrypted JSON structure
10171017 // -----------------------------------------------------------------------
10181018
1019- const QJsonDocument decryptedDoc = QJsonDocument::fromJson (decryptedBytes);
1019+ const auto decryptedDoc = QJsonDocument::fromJson (decryptedBytes);
10201020 if (decryptedDoc.isNull ()) {
10211021 printFail (QStringLiteral (" Decrypted JSON: failed to parse decrypted bytes as JSON" ));
10221022 allPassed = false ;
0 commit comments