TEXT   78

protocol new

Guest on 19th July 2022 02:32:06 AM

  1. Proposed Client-Server interaction
  2. ==================================
  3.  
  4. Requirements and Limitations
  5. ----------------------------
  6. - The front end must be able to efficiently read exactly enough bytes to
  7.   get the entire header and leave all of the following data unread.  No
  8.   seeks are possible.
  9. - None of the command arguments may contain NULs, but they may contain
  10.   any other data.
  11. - Some commands need to send and receive arbitrary length binary data.
  12. - It should not be possible to create a memory overuse through over
  13.   large data in the protocol.
  14. - The command header data (command name, etc) will be small (typically
  15.   less than 1K).  In fact, it will almost always be smaller than 256
  16.   bytes, but that is not guaranteed.
  17.  
  18. Command Header
  19. --------------
  20. Size    Type    Description
  21. 1       int     Protocol number (always 3)
  22. 2       int     Command header length
  23.                 (number of bytes between this length and the end of arguments)
  24. varies  zstring Command name
  25. varies  zstring Domain name
  26. varies  zstring Virtual user name
  27. varies  zstring Pass phrase
  28. 1       int     Argument count
  29. varies  zstring Command arguments
  30.  
  31. The command name, domain name, and pass phrase are passed to an
  32. authenticating shim which executes the command only if authentication
  33. succeeds.  The command arguments are passed on the command line to the
  34. command module after authentication, and the command data following the
  35. arguments is passed on standard input.  This data will be used, for
  36. example, for the autoresponse message.
  37.  
  38. Response
  39. --------
  40. Size    Type    Description
  41. 1       int     Response code: one of the following
  42.                 0: OK -- operation succeeded
  43.                 1: Bad -- error in format or syntax
  44.                 2: Autherr -- authentication failed
  45.                 3: Error -- operation failed
  46. varies  zstring Response message
  47. varies  N/A     Response data (optional)
  48.  
  49. Data types
  50. ----------
  51. A "zstring" is a NUL terminated string
  52.  
  53. The command header is limited to 64K in length, primarily to limit the
  54. possibility of attacks causing excessive memory allocation.
  55.  
  56. All integers are unsigned, sent MSB first.

Raw Paste


Login or Register to edit or fork this paste. It's free.