remote.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>
  7. GnuDIP Remote User Maintenance Protocol
  8. </title>
  9. <base target="_blank">
  10. </head>
  11. <body bgcolor=white>
  12. <table><tr valign=middle><td>
  13. <img align=middle src="gnudip/html/gnudip.jpg" alt="GnuDIP Logo" border=0 height=60 width=113>
  14. </td><td>
  15. <h1>GnuDIP Remote User Maintenance Protocol</h1>
  16. </table>
  17. <hr>
  18. <p>
  19. Here we describe the remote user maintenance protocol provided by the
  20. <a href="gnudip/sbin/gdiprmaint.pl"><code>gdiprmaint.pl</code></a>
  21. (X)INETD daemon, and which is used by the
  22. <a href="gnudip/sbin/gdiprmclt.pl"><code>gdiprmclt.pl</code></a>
  23. client script.
  24. <p><hr>
  25. <p>
  26. ASCII is (of course) used for representing printable characters.
  27. <p>
  28. The client makes a TCP connection to the appropriate port on the server host.
  29. There is no standard port. Each GnuDIP site should choose its own.
  30. <p>
  31. As soon as the connection is established the server will send a <b>randomly
  32. generated 10 character "salt" string</b>. The manner in which this is used
  33. depends on whether the maintenance message is sent in unencrypted or
  34. encrypted form.
  35. <h3>Unencrypted Form</h3>
  36. <p>
  37. In this case the maintenance request and response messages are not
  38. encrypted, but the <b>remote maintenance access password</b> (a value
  39. known both to the server and the client) is still protected.
  40. The random salt is used in this process in a way that prevents the possibility
  41. of "spoofing" the server by replaying requests.
  42. <p>
  43. The random salt sent by the server is used in the following algorithm for
  44. hashing the password:
  45. <ul>
  46. <li>
  47. Digest the remote maintenance access password using
  48. <a href="http://www.ietf.org/rfc/rfc1321.txt">
  49. the MD5 digest message digest algorithm</a>.
  50. Convert the digest value (which is a <u>binary</u> value)
  51. to its hexadecimal character string representation
  52. (characters 0-9 and lower case a-f).
  53. <p><li>
  54. Append a period (".") and the salt value to create a longer character string.
  55. <p><li>
  56. Digest this longer character string and convert it to its hexadecimal
  57. character representation.
  58. </ul>
  59. <p>
  60. The message character string is then transmited to the GnuDIP server.
  61. It is sent as several lines using a <b><u>single new line character as the line
  62. ending</u></b>. The general form is:
  63. <blockquote><pre>
  64. 0
  65. hashed_password
  66. maintenance_request_line_1
  67. maintenance_request_line_2
  68. *
  69. *
  70. maintenance_request_line_n
  71. end
  72. </pre></blockquote>
  73. <p>
  74. The response from the server will in most cases be single line containing a
  75. response code:
  76. <blockquote><pre>
  77. response_code
  78. </pre></blockquote>
  79. <p>
  80. For a response code of zero to a <b><code>get</code></b> request, there will
  81. also be two or more data lines:
  82. <blockquote><pre>
  83. 0
  84. get_response_line_1
  85. get_response_line_2
  86. *
  87. *
  88. get_response_line_n
  89. end
  90. </pre></blockquote>
  91. <p>
  92. The format of maintenance requests and responses to a "get" is explained
  93. below, along with the possible response codes.
  94. <h3>Encrypted Form</h3>
  95. <p>
  96. In this case the maintenance request and response messages are both
  97. encrypted with
  98. <a href="http://www.counterpane.com/blowfish.html">
  99. Blowfish encryption</a> using a key known both to the server and
  100. the client. This random salt sent by the server is included in the encrpyted
  101. request message to prevent the possibility of "spoofing" the server by
  102. replaying requests.
  103. <p>
  104. <b>Note:</b>
  105. <blockquote>
  106. The Blowfish encryption option is not yet implemented.
  107. <p>
  108. It probably never will be either, since encryption over the public Internet
  109. is easily done using <a href="http://www.stunnel.org/">Stunnel</a>.
  110. </blockquote>
  111. <p>
  112. The encrypted request is then converted from binary form to its character
  113. hexadecimal representation, using the digits and the <u>lower case</u> letters
  114. "a", "b", "c", "d", "e" and "f".
  115. The message character string is then transmited to the GnuDIP server.
  116. It is sent as two lines using a single new line character as the line
  117. ending. The general form is:
  118. <blockquote><pre>
  119. 1
  120. encrypted_message_as_hex_on_one_line
  121. </pre></blockquote>
  122. <p>
  123. Before being encrypyted, the message that gets encrypted and placed in the
  124. second line above consists of several lines using <b><u>single new line character
  125. as the line ending</u></b>, with this form:
  126. <blockquote><pre>
  127. random_salt
  128. maintenance_request_line_1
  129. maintenance_request_line_2
  130. *
  131. *
  132. maintenance_request_line_n
  133. </pre></blockquote>
  134. <p>
  135. The response from the server will in most cases be single line containing a
  136. response code:
  137. <blockquote><pre>
  138. response_code
  139. </pre></blockquote>
  140. <p>
  141. For a response code of zero to a <b><code>get</code></b> request, there will
  142. also be an encrypted data line:
  143. <blockquote><pre>
  144. 0
  145. encrypted_get_response_as_hex_on_one_line
  146. </pre></blockquote>
  147. <p>
  148. Before being encrypyted, the get response that gets encrypted and placed in the
  149. second line above consists of several lines using <b><u>single new line character
  150. as the line ending</u></b>, with this form:
  151. <blockquote><pre>
  152. get_response_line_1
  153. get_response_line_2
  154. *
  155. *
  156. get_response_line_n
  157. </pre></blockquote>
  158. <p>
  159. The format of maintenance requests and responses to a "get" is explained
  160. below, along with the possible response codes.
  161. <h3>Maintenance Requests, Response Codes and Get Responses</h3>
  162. <p>
  163. These requests correspond precisely at a semantic level to the user
  164. maintenance commands described in
  165. <a href="maintenance_commands.html">
  166. <code>maintenance_commands.html</code></a>.
  167. <p>
  168. A request consists of several lines using a <b><u>single new line
  169. character as the line ending</u></b>. The general form is:
  170. <blockquote><pre>
  171. command
  172. parameter_1=value_1
  173. parameter_2=value_2
  174. *
  175. *
  176. parameter_n=value_n
  177. </pre></blockquote>
  178. <p>
  179. The number of parameter/value pairs will vary. The "command" is one of:
  180. <blockquote><ul>
  181. <li><code>get</code>
  182. <li><code>add</code>
  183. <li><code>mod</code>
  184. <li><code>del</code>
  185. </ul></blockquote>
  186. <p>
  187. The response from to successful <b><code>get</code></b> request consists of
  188. two or more data lines:
  189. <blockquote><pre>
  190. parameter_1=value_1
  191. parameter_2=value_2
  192. *
  193. *
  194. parameter_n=value_n
  195. </pre></blockquote>
  196. <p>
  197. We now describe the exchange for each command in more detail:
  198. <dl>
  199. <dt><b>get</b>
  200. <dd>
  201. <p>
  202. In this case the request will be of the form:
  203. <blockquote><pre>
  204. get
  205. user=user_name
  206. domain=domain_name
  207. </pre></blockquote>
  208. <p>
  209. If the specified user name is registered for the specified domain, the get will
  210. succeed and the response will be similiar to:
  211. <blockquote><pre>
  212. MXbackup = NO
  213. wildcard = NO
  214. password = 34e24c964fa7adfb317e2444a94c4357
  215. forwardurl =
  216. allowmx = NO
  217. MXvalue =
  218. autourlon =
  219. level = USER
  220. currentip = 127.0.0.1
  221. username = rob
  222. allowwild = NO
  223. updated = 2002-05-22 14:39:07
  224. domain = dyn.yourhost.com
  225. email = rob@elsewhere.com
  226. </pre></blockquote>
  227. <p>
  228. The response codes are:
  229. <ul>
  230. <li>0 - User existed - get response returned
  231. <li>1 - User did not exist
  232. <li>2 - Invalid request - look for GnuDIP log messages
  233. </ul>
  234. <p>
  235. <dt><b>add</b>
  236. <dd>
  237. <p>
  238. In this case the full message will be of the form:
  239. <blockquote><pre>
  240. add
  241. user=user_name
  242. domain=domain_name
  243. password=clear_text_password
  244. email=email_address
  245. </pre></blockquote>
  246. <p>
  247. The "password" or "email" parameters may be omitted.
  248. <p>
  249. The response codes are:
  250. <ul>
  251. <li>0 - User did not exist - user was added
  252. <li>1 - User already existed
  253. <li>2 - Invalid request - look for GnuDIP log messages
  254. </ul>
  255. <p>
  256. <dt><b>mod</b>
  257. <dd>
  258. <p>
  259. In this case the full message will be of the form:
  260. <blockquote><pre>
  261. mod
  262. user=user_name
  263. domain=domain_name
  264. password=clear_text_password
  265. hashedpw=MD5_hashed_password
  266. email=email_address
  267. allowwild={YES|NO}
  268. allowmx={YES|NO}
  269. removedns=YES
  270. </pre></blockquote>
  271. <p>
  272. Any of the "password", "hashedpw", "email", "allowwild", "allowmx" or
  273. "removedns" parameters may be omitted.
  274. <p>
  275. The response codes are:
  276. <ul>
  277. <li>0 - User existed - user was updated
  278. <li>1 - User did not exist
  279. <li>2 - Invalid request - look for GnuDIP log messages
  280. </ul>
  281. <p>
  282. <dt><b>del</b>
  283. <dd>
  284. <p>
  285. In this case the full message will be of the form:
  286. <blockquote><pre>
  287. del
  288. user=user_name
  289. domain=domain_name
  290. </pre></blockquote>
  291. <p>
  292. The response codes are:
  293. <ul>
  294. <li>0 - User existed - user was deleted
  295. <li>1 - User did not exist
  296. <li>2 - Invalid request - look for GnuDIP log messages
  297. </ul>
  298. </dl>
  299. <p><hr>
  300. </body>
  301. </html>