ChoPGP icon indicating copy to clipboard operation
ChoPGP copied to clipboard

Decrypt method with privateKeyFilePath parameter not disposing private key stream.

Open bkothe opened this issue 5 years ago • 2 comments

When passing the private key file path to the Decrypt method, it does not release the key file after decryption.

https://github.com/Cinchoo/ChoPGP/blob/007c020d9c7a2dcdee44057b320da9755b52cd7a/ChoPGP/ChoPGPEncryptDecrypt.cs#L518

It looks as though there is probably the same issue in other methods as well where the private key file path is passed in. I didn't try it but I think in the case of async methods, the file will be released however the non-async methods don't seem to be releasing the private key file.

bkothe avatar Oct 27 '20 23:10 bkothe

I've looked into it. Applied fix.

New package v1.0.0.3 is pushed nuget. Try it. Thanks for reporting.

Cinchoo avatar Oct 30 '20 15:10 Cinchoo

@Cinchoo Thanks for the quick turnaround. I will give it a whirl a bit later but the change looks good to me. Thanks again!

bkothe avatar Oct 30 '20 19:10 bkothe