Closed denovosoftware closed 2 years ago
Thanks for providing this pull request. I try to find the time to review it in the near future!
I had a look at your commits now. While most things look clear enough to me theres one issue: there is no TestTDECGCM.TestDecodeStream method in Unit Tests/Tests/TestDECCipherModesGCM.pas, at least not in the current development or master branch.
There is no // FIXME comment at all in the whole project group at the moment. How to accept the first two commits but leaving out the other one? Or what would happen if I accept a pull request which wants to modify source which is not there?
Ah, sorry. I'm not too accustomed with pull requests yet and overlooked the commit adding the TestDecodeStream method.
I merged your pull request but: your two new unit tests TestDecodeStream and TestEncodeStream do crash now with access violations and invalid pointer operations etc. It looks like the calls with a 0 byte Size and empty Source and Dest params in DecodeGCM(Source, Dest: TBytes; Size: Integer) are the problem.
Since this version is online noew in development and master branch: could you please have a look and try to provide a fix as soon as time permits?
Hi, sorry about that. Pull request #49 should fix those AV issues.
Incorrect auth tag is generated by DecodeStream method due to buffer reuse. Also addresses issue with auth tags for empty data streams. Solution is to update logic similar to logic in DecodeBytes methods.