]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
pkcs7: Add supported for unprotected PKCS#7 encrypted-data
authorTobias Brunner <tobias@strongswan.org>
Wed, 18 Oct 2023 15:18:49 +0000 (17:18 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Nov 2023 11:26:07 +0000 (12:26 +0100)
src/libstrongswan/plugins/pkcs7/pkcs7_encrypted_data.c

index 472e72e2a7f74dde54fdc186f8a0b08eff9342bb..cdcb0eb7194882859fa9d37940f854ac94c04048 100644 (file)
@@ -54,6 +54,11 @@ static bool decrypt(pkcs5_t *pkcs5, chunk_t data, chunk_t *decrypted)
        shared_key_t *shared;
        bool success = FALSE;
 
+       if (pkcs5->decrypt(pkcs5, chunk_empty, data, decrypted))
+       {
+               return TRUE;
+       }
+
        enumerator = lib->credmgr->create_shared_enumerator(lib->credmgr,
                                                                                SHARED_PRIVATE_KEY_PASS, NULL, NULL);
        while (enumerator->enumerate(enumerator, &shared, NULL, NULL))