You are not logged in.
Pages: 1
Delphi 11.1, mORMot 2.0.3394, Image TestSaveLoad.png has 1.913.744 bytes
I get an exception EReadError in TAesPkcs7Reader when I try to decrypt data encrypted with TAesPkcs7Writer. You can easily reproduce it with the following:
AesPkcs7File('f:\TestSaveLoad.png', 'f:\_TestSaveLoad.dat', True, 'Thomas');
AesPkcs7File('f:\_TestSaveLoad.dat', 'f:\_TestSaveLoad.png', False, 'Thomas');
With best regards
Thomas
Offline
There was no problem on FPC.
But Delphi has a diverse - and unexpected - TStream.CopyFrom() implementation: it uses Size and ReadBuffer() whereas the output is not of the same size than the input due to PKCS7 padding...
I have therefore added StreamCopyUntilEnd() which has no such restriction, and is faster:
https://github.com/synopse/mORMot2/commit/c019755b
Offline
Pages: 1