Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp decryption broken with openssl3 #9

Open
reinartz opened this issue Feb 6, 2023 · 0 comments
Open

esp decryption broken with openssl3 #9

reinartz opened this issue Feb 6, 2023 · 0 comments

Comments

@reinartz
Copy link

reinartz commented Feb 6, 2023

At least with openssl3 the esp decryption code (esp.c) appears to not expect padding and so fails to decrypt the last segment. I learned that can be fixed by setting up the context to expect padding, e.g by calling

EVP_CIPHER_CTX_set_padding(ctx, 0);

after context initialization.
Also needed to remove this line:
/* http://www.mail-archive.com/[email protected]/msg23435.html */
packet_size +=EVP_CIPHER_CTX_block_size(ctx);
I couldn't track down the source of this, and it broke the correct packet_size.
One more thing: for some reason the procedure only updates out_pkthdr->len, but not out_pkthdr->caplen.
attaching the changes I did. Works for me.
esp.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant