Page 1 of 1

ESP HTTP decryption

Posted: Mon Dec 21, 2020 10:23 am
by slompf
Hi,

I'm trying to replace my own HTTP server in a Apple Homekit implementation with the one of esp idf. This is partly working, but now a problem arose: As the message sent by the client are encrypted I have overwritten the recv function with httpd_sess_set_recv_override to decrypt them. This works quite fine, if the message size is less than 128 bytes (PARSER_BLOCK_SIZE). If it is bigger, the parser requests only a part of the message, which I cant decrypt in the overridden receive function because the message is not complete.

In order to workaround the problem, I set PARSER_BLOCK_SIZE in esp_httpd_priv.h to a bigger value. It works, but is limited to a specific message size and needs changes in the esp idf source.

Is there another way to handle that problem? How does the SSL server deal with it (I could not figure out)?

Best regards,
Torsten

Re: ESP HTTP decryption

Posted: Mon Dec 21, 2020 12:55 pm
by ESP_Mahavir

Re: ESP HTTP decryption

Posted: Mon Dec 21, 2020 1:31 pm
by slompf
I'm now receiving the whole message, decrypting and caching it. Then I can provide it block by block to the server.