Attempting to decrypt a large binary file created with openssl fails regardless of the amount of OS memory available.
Tried using the openssl -stream option but yet it fails
Here is the memory info :-
> free -m
> total used free shared buff/cache available Mem: 15809 656 14331 11
> 820 14941 Swap: 4096 0 4096
openssl version OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 20
On-line CPU(s) list: 0-19
Vendor ID: GenuineIntel
Model name: 12th Gen Intel(R) Core(TM) i7-12800H
CPU family: 6
Model: 154
Thread(s) per core: 2
Core(s) per socket: 10
Encrypt
openssl cms -encrypt -stream -in ubuntu.iso -binary -out Ubuntu.iso.enc -outform DER -recip Cert.cer -aes256
Now decrypt:
openssl cms -decrypt -stream -in ubuntu.iso.enc -inform DER -recip Cert.cer -inkey key.pem -out decrypted_output.bin
openssl cms -decrypt -stream :BUF_MEM_grow_clean:malloc failure:../crypto/buffer/buffer.c:128: 4027B3C4B2730000:error:068C0100:asn1 encoding routines:asn1_d2i_read_bio:malloc failure:../crypto/asn1/a_d2i_fp.c:209: