Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdConnectionIntercept TCP Header Encrypting
#1
I am working on a C++ project that was using Indy 9 and now uses Indy 10 to talk to device controllers that use a proprietary encryption method. 

In Indy 9 a TMemoryStream object was used that included the TCP Packet header and we could read and set the TCP headers bytes directly.   Indy 10 uses a TIdBytes instead of TMemoryStream and I cannot figure out any way to manipulate the TCP Packet header bytes to get the same results.

Is there a component I should be looking at?  Documentation or a post somewhere that might help me?
Reply
#2
(06-24-2019, 11:01 PM)whitekn3 Wrote: In Indy 9 a TMemoryStream object was used that included the TCP Packet header and we could read and set the TCP headers bytes directly.

Indy has never provided access to packet headers at the IP or TCP layers. Are you instead referring to the headers of the application-layer packets that you are exchanging back and forth?

(06-24-2019, 11:01 PM)whitekn3 Wrote: Indy 10 uses a TIdBytes instead of TMemoryStream and I cannot figure out any way to manipulate the TCP Packet header bytes to get the same results.

Please show your original Indy 9 code, then I can help you translate it to Indy 10.

Reply
#3
I wasn't following some rather complicated (old) code correctly. It looked like a TCP header because it was a "psuedo tcp protocol" where information was patterned after a tcp header, used TCP names like SYN, ACK, FIN, and used a variable named "header", then encrypted it and sent it as data. The problem was actually the use of ToBytes where RawToBytes was needed, as well as a another bug introduced when TMemoryStream was changed to TIdBytes and a push_back was not implemented properly.

Sorry for the confusion, but I appreciate you taking the time to respond.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)