bind-9.11-fips-tests.patch 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
  1. From 3446425cf03f2b5a7cbf6af47bd167f72e4135aa Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
  3. Date: Thu, 2 Aug 2018 23:46:45 +0200
  4. Subject: [PATCH] FIPS tests changes
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Squashed commit of the following:
  9. commit 09e5eb48698d4fef2fc1031870de86c553b6bfaa
  10. Author: Petr Menšík <pemensik@redhat.com>
  11. Date: Wed Mar 7 20:35:13 2018 +0100
  12. Fix nsupdate test. Do not use md5 by default for rndc, skip gracefully md5 if not available.
  13. commit ab303db70082db76ecf36493d0b82ef3e8750cad
  14. Author: Petr Menšík <pemensik@redhat.com>
  15. Date: Wed Mar 7 18:11:10 2018 +0100
  16. Changed root key to be RSASHA256
  17. Change bad trusted key to be the same algorithm.
  18. commit 88ab07c0e14cc71247e1f9d11a1ea832b64c1ee8
  19. Author: Petr Menšík <pemensik@redhat.com>
  20. Date: Wed Mar 7 16:56:17 2018 +0100
  21. Change used key to not use hmac-md5
  22. Fix upforwd test, do not use hmac-md5
  23. commit aec891571626f053acfb4d0a247240cbc21a84e9
  24. Author: Petr Menšík <pemensik@redhat.com>
  25. Date: Wed Mar 7 15:54:11 2018 +0100
  26. Increase bitsize of DSA key to pass FIPS 140-2 mode.
  27. commit bca8e164fa0d9aff2f946b8b4eb0f1f7e0bf6696
  28. Author: Petr Menšík <pemensik@redhat.com>
  29. Date: Wed Mar 7 15:41:08 2018 +0100
  30. Fix tsig and rndc tests for disabled md5
  31. Use hmac-sha256 instead of hmac-md5.
  32. commit 0d314c1ab6151aa13574a21ad22f28d3b7f42a67
  33. Author: Petr Menšík <pemensik@redhat.com>
  34. Date: Wed Mar 7 13:21:00 2018 +0100
  35. Add md5 availability detection to featuretest
  36. commit f389a918803e2853e4b55fed62765dc4a492e34f
  37. Author: Petr Menšík <pemensik@redhat.com>
  38. Date: Wed Mar 7 10:44:23 2018 +0100
  39. Change tests to not use hmac-md5 algorithms if not required
  40. Use hmac-sha256 instead of default hmac-md5 for allow-query
  41. Use DEFAULT_HMAC configured variable
  42. ---
  43. bin/tests/system/acl/ns2/named1.conf.in | 4 +-
  44. bin/tests/system/acl/ns2/named2.conf.in | 4 +-
  45. bin/tests/system/acl/ns2/named3.conf.in | 6 +-
  46. bin/tests/system/acl/ns2/named4.conf.in | 4 +-
  47. bin/tests/system/acl/ns2/named5.conf.in | 4 +-
  48. bin/tests/system/acl/tests.sh | 32 ++++-----
  49. .../system/allow-query/ns2/named10.conf.in | 2 +-
  50. .../system/allow-query/ns2/named11.conf.in | 4 +-
  51. .../system/allow-query/ns2/named12.conf.in | 2 +-
  52. .../system/allow-query/ns2/named30.conf.in | 2 +-
  53. .../system/allow-query/ns2/named31.conf.in | 4 +-
  54. .../system/allow-query/ns2/named32.conf.in | 2 +-
  55. .../system/allow-query/ns2/named40.conf.in | 4 +-
  56. bin/tests/system/allow-query/tests.sh | 18 ++---
  57. bin/tests/system/checkconf/bad-tsig.conf | 2 +-
  58. bin/tests/system/checkconf/good.conf | 2 +-
  59. bin/tests/system/cookie/ns1/named.conf.in | 2 +-
  60. bin/tests/system/dnssec/ns4/named5.conf.in | 2 +-
  61. bin/tests/system/feature-test.c | 14 ++++
  62. bin/tests/system/notify/ns5/named.conf.in | 6 +-
  63. bin/tests/system/notify/tests.sh | 6 +-
  64. bin/tests/system/nsupdate/ns1/named.conf.in | 2 +-
  65. bin/tests/system/nsupdate/ns2/named.conf.in | 2 +-
  66. bin/tests/system/nsupdate/ns9/named.conf.in | 2 +-
  67. bin/tests/system/nsupdate/setup.sh | 6 +-
  68. bin/tests/system/nsupdate/tests.sh | 9 ++-
  69. bin/tests/system/rndc/ns2/named.conf.in | 2 +-
  70. bin/tests/system/rndc/ns3/named.conf.in | 2 +-
  71. bin/tests/system/rndc/setup.sh | 2 +-
  72. bin/tests/system/rndc/tests.sh | 22 +++---
  73. bin/tests/system/tsig/ns1/named.conf.in | 10 +--
  74. bin/tests/system/tsig/ns1/rndc5.conf.in | 10 +++
  75. bin/tests/system/tsig/setup.sh | 5 ++
  76. bin/tests/system/tsig/tests.sh | 67 ++++++++++++-------
  77. bin/tests/system/upforwd/ns1/named.conf.in | 2 +-
  78. bin/tests/system/upforwd/tests.sh | 2 +-
  79. 36 files changed, 161 insertions(+), 110 deletions(-)
  80. create mode 100644 bin/tests/system/tsig/ns1/rndc5.conf.in
  81. diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in
  82. index 8787c6a..682ba97 100644
  83. --- a/bin/tests/system/acl/ns2/named1.conf.in
  84. +++ b/bin/tests/system/acl/ns2/named1.conf.in
  85. @@ -35,12 +35,12 @@ options {
  86. };
  87. key one {
  88. - algorithm hmac-md5;
  89. + algorithm @DEFAULT_HMAC@;
  90. secret "1234abcd8765";
  91. };
  92. key two {
  93. - algorithm hmac-md5;
  94. + algorithm @DEFAULT_HMAC@;
  95. secret "1234abcd8765";
  96. };
  97. diff --git a/bin/tests/system/acl/ns2/named2.conf.in b/bin/tests/system/acl/ns2/named2.conf.in
  98. index a95b4c1..7b1cea6 100644
  99. --- a/bin/tests/system/acl/ns2/named2.conf.in
  100. +++ b/bin/tests/system/acl/ns2/named2.conf.in
  101. @@ -35,12 +35,12 @@ options {
  102. };
  103. key one {
  104. - algorithm hmac-md5;
  105. + algorithm @DEFAULT_HMAC@;
  106. secret "1234abcd8765";
  107. };
  108. key two {
  109. - algorithm hmac-md5;
  110. + algorithm @DEFAULT_HMAC@;
  111. secret "1234abcd8765";
  112. };
  113. diff --git a/bin/tests/system/acl/ns2/named3.conf.in b/bin/tests/system/acl/ns2/named3.conf.in
  114. index 14cc3fe..6b35ba5 100644
  115. --- a/bin/tests/system/acl/ns2/named3.conf.in
  116. +++ b/bin/tests/system/acl/ns2/named3.conf.in
  117. @@ -35,17 +35,17 @@ options {
  118. };
  119. key one {
  120. - algorithm hmac-md5;
  121. + algorithm @DEFAULT_HMAC@;
  122. secret "1234abcd8765";
  123. };
  124. key two {
  125. - algorithm hmac-md5;
  126. + algorithm @DEFAULT_HMAC@;
  127. secret "1234abcd8765";
  128. };
  129. key three {
  130. - algorithm hmac-md5;
  131. + algorithm @DEFAULT_HMAC@;
  132. secret "1234abcd8765";
  133. };
  134. diff --git a/bin/tests/system/acl/ns2/named4.conf.in b/bin/tests/system/acl/ns2/named4.conf.in
  135. index 77cf110..b23a1ca 100644
  136. --- a/bin/tests/system/acl/ns2/named4.conf.in
  137. +++ b/bin/tests/system/acl/ns2/named4.conf.in
  138. @@ -35,12 +35,12 @@ options {
  139. };
  140. key one {
  141. - algorithm hmac-md5;
  142. + algorithm @DEFAULT_HMAC@;
  143. secret "1234abcd8765";
  144. };
  145. key two {
  146. - algorithm hmac-md5;
  147. + algorithm @DEFAULT_HMAC@;
  148. secret "1234abcd8765";
  149. };
  150. diff --git a/bin/tests/system/acl/ns2/named5.conf.in b/bin/tests/system/acl/ns2/named5.conf.in
  151. index 5ccabf9..52791aa 100644
  152. --- a/bin/tests/system/acl/ns2/named5.conf.in
  153. +++ b/bin/tests/system/acl/ns2/named5.conf.in
  154. @@ -37,12 +37,12 @@ options {
  155. };
  156. key one {
  157. - algorithm hmac-md5;
  158. + algorithm @DEFAULT_HMAC@;
  159. secret "1234abcd8765";
  160. };
  161. key two {
  162. - algorithm hmac-md5;
  163. + algorithm @DEFAULT_HMAC@;
  164. secret "1234abcd8765";
  165. };
  166. diff --git a/bin/tests/system/acl/tests.sh b/bin/tests/system/acl/tests.sh
  167. index ad98fa1..7a7ff4a 100644
  168. --- a/bin/tests/system/acl/tests.sh
  169. +++ b/bin/tests/system/acl/tests.sh
  170. @@ -23,14 +23,14 @@ echo_i "testing basic ACL processing"
  171. # key "one" should fail
  172. t=`expr $t + 1`
  173. $DIG $DIGOPTS tsigzone. \
  174. - @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
  175. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  176. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  177. # any other key should be fine
  178. t=`expr $t + 1`
  179. $DIG $DIGOPTS tsigzone. \
  180. - @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
  181. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  182. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  183. copy_setports ns2/named2.conf.in ns2/named.conf
  184. @@ -40,18 +40,18 @@ sleep 5
  185. # prefix 10/8 should fail
  186. t=`expr $t + 1`
  187. $DIG $DIGOPTS tsigzone. \
  188. - @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
  189. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  190. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  191. # any other address should work, as long as it sends key "one"
  192. t=`expr $t + 1`
  193. $DIG $DIGOPTS tsigzone. \
  194. - @10.53.0.2 -b 127.0.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
  195. + @10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  196. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  197. t=`expr $t + 1`
  198. $DIG $DIGOPTS tsigzone. \
  199. - @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
  200. + @10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  201. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  202. echo_i "testing nested ACL processing"
  203. @@ -63,31 +63,31 @@ sleep 5
  204. # should succeed
  205. t=`expr $t + 1`
  206. $DIG $DIGOPTS tsigzone. \
  207. - @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 > dig.out.${t}
  208. + @10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  209. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  210. # should succeed
  211. t=`expr $t + 1`
  212. $DIG $DIGOPTS tsigzone. \
  213. - @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 > dig.out.${t}
  214. + @10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  215. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  216. # should succeed
  217. t=`expr $t + 1`
  218. $DIG $DIGOPTS tsigzone. \
  219. - @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
  220. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  221. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  222. # should succeed
  223. t=`expr $t + 1`
  224. $DIG $DIGOPTS tsigzone. \
  225. - @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
  226. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  227. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  228. # but only one or the other should fail
  229. t=`expr $t + 1`
  230. $DIG $DIGOPTS tsigzone. \
  231. - @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
  232. + @10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  233. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  234. t=`expr $t + 1`
  235. @@ -98,7 +98,7 @@ grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $tt failed" ; status=1
  236. # and other values? right out
  237. t=`expr $t + 1`
  238. $DIG $DIGOPTS tsigzone. \
  239. - @10.53.0.2 -b 127.0.0.1 axfr -y three:1234abcd8765 > dig.out.${t}
  240. + @10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:three:1234abcd8765 > dig.out.${t}
  241. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  242. # now we only allow 10.53.0.1 *and* key one, or 10.53.0.2 *and* key two
  243. @@ -109,31 +109,31 @@ sleep 5
  244. # should succeed
  245. t=`expr $t + 1`
  246. $DIG $DIGOPTS tsigzone. \
  247. - @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 > dig.out.${t}
  248. + @10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  249. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  250. # should succeed
  251. t=`expr $t + 1`
  252. $DIG $DIGOPTS tsigzone. \
  253. - @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
  254. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  255. grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
  256. # should fail
  257. t=`expr $t + 1`
  258. $DIG $DIGOPTS tsigzone. \
  259. - @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 > dig.out.${t}
  260. + @10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  261. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  262. # should fail
  263. t=`expr $t + 1`
  264. $DIG $DIGOPTS tsigzone. \
  265. - @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
  266. + @10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
  267. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  268. # should fail
  269. t=`expr $t + 1`
  270. $DIG $DIGOPTS tsigzone. \
  271. - @10.53.0.2 -b 10.53.0.3 axfr -y one:1234abcd8765 > dig.out.${t}
  272. + @10.53.0.2 -b 10.53.0.3 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
  273. grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
  274. echo_i "testing allow-query-on ACL processing"
  275. diff --git a/bin/tests/system/allow-query/ns2/named10.conf.in b/bin/tests/system/allow-query/ns2/named10.conf.in
  276. index b91d19a..ae485e8 100644
  277. --- a/bin/tests/system/allow-query/ns2/named10.conf.in
  278. +++ b/bin/tests/system/allow-query/ns2/named10.conf.in
  279. @@ -12,7 +12,7 @@
  280. */
  281. key one {
  282. - algorithm hmac-md5;
  283. + algorithm @DEFAULT_HMAC@;
  284. secret "1234abcd8765";
  285. };
  286. diff --git a/bin/tests/system/allow-query/ns2/named11.conf.in b/bin/tests/system/allow-query/ns2/named11.conf.in
  287. index 308c4ca..8a5e806 100644
  288. --- a/bin/tests/system/allow-query/ns2/named11.conf.in
  289. +++ b/bin/tests/system/allow-query/ns2/named11.conf.in
  290. @@ -12,12 +12,12 @@
  291. */
  292. key one {
  293. - algorithm hmac-md5;
  294. + algorithm @DEFAULT_HMAC@;
  295. secret "1234abcd8765";
  296. };
  297. key two {
  298. - algorithm hmac-md5;
  299. + algorithm @DEFAULT_HMAC@;
  300. secret "1234efgh8765";
  301. };
  302. diff --git a/bin/tests/system/allow-query/ns2/named12.conf.in b/bin/tests/system/allow-query/ns2/named12.conf.in
  303. index 6b0fe55..a10c6d0 100644
  304. --- a/bin/tests/system/allow-query/ns2/named12.conf.in
  305. +++ b/bin/tests/system/allow-query/ns2/named12.conf.in
  306. @@ -12,7 +12,7 @@
  307. */
  308. key one {
  309. - algorithm hmac-md5;
  310. + algorithm @DEFAULT_HMAC@;
  311. secret "1234abcd8765";
  312. };
  313. diff --git a/bin/tests/system/allow-query/ns2/named30.conf.in b/bin/tests/system/allow-query/ns2/named30.conf.in
  314. index aefc474..52981a7 100644
  315. --- a/bin/tests/system/allow-query/ns2/named30.conf.in
  316. +++ b/bin/tests/system/allow-query/ns2/named30.conf.in
  317. @@ -12,7 +12,7 @@
  318. */
  319. key one {
  320. - algorithm hmac-md5;
  321. + algorithm @DEFAULT_HMAC@;
  322. secret "1234abcd8765";
  323. };
  324. diff --git a/bin/tests/system/allow-query/ns2/named31.conf.in b/bin/tests/system/allow-query/ns2/named31.conf.in
  325. index 27eccc2..f627870 100644
  326. --- a/bin/tests/system/allow-query/ns2/named31.conf.in
  327. +++ b/bin/tests/system/allow-query/ns2/named31.conf.in
  328. @@ -12,12 +12,12 @@
  329. */
  330. key one {
  331. - algorithm hmac-md5;
  332. + algorithm @DEFAULT_HMAC@;
  333. secret "1234abcd8765";
  334. };
  335. key two {
  336. - algorithm hmac-md5;
  337. + algorithm @DEFAULT_HMAC@;
  338. secret "1234efgh8765";
  339. };
  340. diff --git a/bin/tests/system/allow-query/ns2/named32.conf.in b/bin/tests/system/allow-query/ns2/named32.conf.in
  341. index adbb203..6fd516b 100644
  342. --- a/bin/tests/system/allow-query/ns2/named32.conf.in
  343. +++ b/bin/tests/system/allow-query/ns2/named32.conf.in
  344. @@ -12,7 +12,7 @@
  345. */
  346. key one {
  347. - algorithm hmac-md5;
  348. + algorithm @DEFAULT_HMAC@;
  349. secret "1234abcd8765";
  350. };
  351. diff --git a/bin/tests/system/allow-query/ns2/named40.conf.in b/bin/tests/system/allow-query/ns2/named40.conf.in
  352. index 364f94b..de37915 100644
  353. --- a/bin/tests/system/allow-query/ns2/named40.conf.in
  354. +++ b/bin/tests/system/allow-query/ns2/named40.conf.in
  355. @@ -16,12 +16,12 @@ acl accept { 10.53.0.2; };
  356. acl badaccept { 10.53.0.1; };
  357. key one {
  358. - algorithm hmac-md5;
  359. + algorithm @DEFAULT_HMAC@;
  360. secret "1234abcd8765";
  361. };
  362. key two {
  363. - algorithm hmac-md5;
  364. + algorithm @DEFAULT_HMAC@;
  365. secret "1234efgh8765";
  366. };
  367. diff --git a/bin/tests/system/allow-query/tests.sh b/bin/tests/system/allow-query/tests.sh
  368. index 01a13cf..3711c63 100644
  369. --- a/bin/tests/system/allow-query/tests.sh
  370. +++ b/bin/tests/system/allow-query/tests.sh
  371. @@ -201,7 +201,7 @@ rndc_reload ns2 10.53.0.2
  372. echo_i "test $n: key allowed - query allowed"
  373. ret=0
  374. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  375. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  376. grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
  377. grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
  378. if [ $ret != 0 ]; then echo_i "failed"; fi
  379. @@ -214,7 +214,7 @@ rndc_reload ns2 10.53.0.2
  380. echo_i "test $n: key not allowed - query refused"
  381. ret=0
  382. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
  383. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
  384. grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
  385. grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
  386. grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
  387. @@ -228,7 +228,7 @@ rndc_reload ns2 10.53.0.2
  388. echo_i "test $n: key disallowed - query refused"
  389. ret=0
  390. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  391. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  392. grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
  393. grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
  394. grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
  395. @@ -367,7 +367,7 @@ rndc_reload ns2 10.53.0.2
  396. echo_i "test $n: views key allowed - query allowed"
  397. ret=0
  398. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  399. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  400. grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
  401. grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
  402. if [ $ret != 0 ]; then echo_i "failed"; fi
  403. @@ -380,7 +380,7 @@ rndc_reload ns2 10.53.0.2
  404. echo_i "test $n: views key not allowed - query refused"
  405. ret=0
  406. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
  407. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
  408. grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
  409. grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
  410. grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
  411. @@ -394,7 +394,7 @@ rndc_reload ns2 10.53.0.2
  412. echo_i "test $n: views key disallowed - query refused"
  413. ret=0
  414. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  415. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
  416. grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
  417. grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
  418. grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
  419. @@ -534,7 +534,7 @@ status=`expr $status + $ret`
  420. n=`expr $n + 1`
  421. echo_i "test $n: zone key allowed - query allowed"
  422. ret=0
  423. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
  424. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
  425. grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
  426. grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null || ret=1
  427. if [ $ret != 0 ]; then echo_i "failed"; fi
  428. @@ -544,7 +544,7 @@ status=`expr $status + $ret`
  429. n=`expr $n + 1`
  430. echo_i "test $n: zone key not allowed - query refused"
  431. ret=0
  432. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
  433. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
  434. grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
  435. grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
  436. grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null && ret=1
  437. @@ -555,7 +555,7 @@ status=`expr $status + $ret`
  438. n=`expr $n + 1`
  439. echo_i "test $n: zone key disallowed - query refused"
  440. ret=0
  441. -$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
  442. +$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
  443. grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
  444. grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
  445. grep '^a.keydisallow.example' dig.out.ns2.$n > /dev/null && ret=1
  446. diff --git a/bin/tests/system/checkconf/bad-tsig.conf b/bin/tests/system/checkconf/bad-tsig.conf
  447. index 4af25b0..9f202d5 100644
  448. --- a/bin/tests/system/checkconf/bad-tsig.conf
  449. +++ b/bin/tests/system/checkconf/bad-tsig.conf
  450. @@ -13,7 +13,7 @@
  451. /* Bad secret */
  452. key "badtsig" {
  453. - algorithm hmac-md5;
  454. + algorithm hmac-sha256;
  455. secret "jEdD+BPKg==";
  456. };
  457. diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf
  458. index 93939ff..3f78622 100644
  459. --- a/bin/tests/system/checkconf/good.conf
  460. +++ b/bin/tests/system/checkconf/good.conf
  461. @@ -280,6 +280,6 @@ dyndb "name" "library.so" {
  462. system;
  463. };
  464. key "mykey" {
  465. - algorithm "hmac-md5";
  466. + algorithm "hmac-sha256";
  467. secret "qwertyuiopasdfgh";
  468. };
  469. diff --git a/bin/tests/system/cookie/ns1/named.conf.in b/bin/tests/system/cookie/ns1/named.conf.in
  470. index 1304303..e9c28c6 100644
  471. --- a/bin/tests/system/cookie/ns1/named.conf.in
  472. +++ b/bin/tests/system/cookie/ns1/named.conf.in
  473. @@ -18,7 +18,7 @@ key rndc_key {
  474. key foo {
  475. secret "aaaaaaaaaaaa";
  476. - algorithm hmac-sha256;
  477. + algorithm @DEFAULT_HMAC@;
  478. };
  479. server 10.53.0.10 {
  480. diff --git a/bin/tests/system/dnssec/ns4/named5.conf.in b/bin/tests/system/dnssec/ns4/named5.conf.in
  481. index f1b817a..e457062 100644
  482. --- a/bin/tests/system/dnssec/ns4/named5.conf.in
  483. +++ b/bin/tests/system/dnssec/ns4/named5.conf.in
  484. @@ -35,5 +35,5 @@ controls {
  485. key auth {
  486. secret "1234abcd8765";
  487. - algorithm hmac-sha256;
  488. + algorithm @DEFAULT_HMAC@;
  489. };
  490. diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c
  491. index b1adaed..3942df6 100644
  492. --- a/bin/tests/system/feature-test.c
  493. +++ b/bin/tests/system/feature-test.c
  494. @@ -17,6 +17,7 @@
  495. #include <string.h>
  496. #include <unistd.h>
  497. +#include <isc/md.h>
  498. #include <isc/net.h>
  499. #include <isc/print.h>
  500. #include <isc/util.h>
  501. @@ -143,6 +144,19 @@ main(int argc, char **argv) {
  502. #endif
  503. }
  504. + if (strcmp(argv[1], "--md5") == 0) {
  505. + unsigned char digest[ISC_MAX_MD_SIZE];
  506. + const unsigned char test[] = "test";
  507. + unsigned int size = sizeof(digest);
  508. +
  509. + if (isc_md(ISC_MD_MD5, test, sizeof(test),
  510. + digest, &size) == ISC_R_SUCCESS) {
  511. + return (0);
  512. + } else {
  513. + return (1);
  514. + }
  515. + }
  516. +
  517. if (strcmp(argv[1], "--ipv6only=no") == 0) {
  518. #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
  519. int s;
  520. diff --git a/bin/tests/system/notify/ns5/named.conf.in b/bin/tests/system/notify/ns5/named.conf.in
  521. index 5cab276..c0492e1 100644
  522. --- a/bin/tests/system/notify/ns5/named.conf.in
  523. +++ b/bin/tests/system/notify/ns5/named.conf.in
  524. @@ -12,17 +12,17 @@
  525. */
  526. key "a" {
  527. - algorithm "hmac-md5";
  528. + algorithm "@DEFAULT_HMAC@";
  529. secret "aaaaaaaaaaaaaaaaaaaa";
  530. };
  531. key "b" {
  532. - algorithm "hmac-md5";
  533. + algorithm "@DEFAULT_HMAC@";
  534. secret "bbbbbbbbbbbbbbbbbbbb";
  535. };
  536. key "c" {
  537. - algorithm "hmac-md5";
  538. + algorithm "@DEFAULT_HMAC@";
  539. secret "cccccccccccccccccccc";
  540. };
  541. diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh
  542. index 706b7fc..2565ab4 100644
  543. --- a/bin/tests/system/notify/tests.sh
  544. +++ b/bin/tests/system/notify/tests.sh
  545. @@ -179,7 +179,7 @@ test_start "checking notify to multiple views using tsig"
  546. $NSUPDATE << EOF
  547. server 10.53.0.5 ${PORT}
  548. zone x21
  549. -key a aaaaaaaaaaaaaaaaaaaa
  550. +key hmac-sha256:a aaaaaaaaaaaaaaaaaaaa
  551. update add added.x21 0 in txt "test string"
  552. send
  553. EOF
  554. @@ -187,9 +187,9 @@ fnb="dig.out.b.ns5.test$n"
  555. fnc="dig.out.c.ns5.test$n"
  556. for i in 1 2 3 4 5 6 7 8 9
  557. do
  558. - dig_plus_opts added.x21. -y b:bbbbbbbbbbbbbbbbbbbb @10.53.0.5 \
  559. + dig_plus_opts added.x21. -y hmac-sha256:b:bbbbbbbbbbbbbbbbbbbb @10.53.0.5 \
  560. txt > "$fnb" || ret=1
  561. - dig_plus_opts added.x21. -y c:cccccccccccccccccccc @10.53.0.5 \
  562. + dig_plus_opts added.x21. -y hmac-sha256:c:cccccccccccccccccccc @10.53.0.5 \
  563. txt > "$fnc" || ret=1
  564. grep "test string" "$fnb" > /dev/null &&
  565. grep "test string" "$fnc" > /dev/null &&
  566. diff --git a/bin/tests/system/nsupdate/ns1/named.conf.in b/bin/tests/system/nsupdate/ns1/named.conf.in
  567. index 2b67360..a734584 100644
  568. --- a/bin/tests/system/nsupdate/ns1/named.conf.in
  569. +++ b/bin/tests/system/nsupdate/ns1/named.conf.in
  570. @@ -39,7 +39,7 @@ controls {
  571. };
  572. key altkey {
  573. - algorithm hmac-md5;
  574. + algorithm hmac-sha512;
  575. secret "1234abcd8765";
  576. };
  577. diff --git a/bin/tests/system/nsupdate/ns2/named.conf.in b/bin/tests/system/nsupdate/ns2/named.conf.in
  578. index c85eef5..428b6b1 100644
  579. --- a/bin/tests/system/nsupdate/ns2/named.conf.in
  580. +++ b/bin/tests/system/nsupdate/ns2/named.conf.in
  581. @@ -34,7 +34,7 @@ controls {
  582. };
  583. key altkey {
  584. - algorithm hmac-md5;
  585. + algorithm hmac-sha512;
  586. secret "1234abcd8765";
  587. };
  588. diff --git a/bin/tests/system/nsupdate/ns9/named.conf.in b/bin/tests/system/nsupdate/ns9/named.conf.in
  589. index 6a7ff88..0b70745 100644
  590. --- a/bin/tests/system/nsupdate/ns9/named.conf.in
  591. +++ b/bin/tests/system/nsupdate/ns9/named.conf.in
  592. @@ -32,7 +32,7 @@ key rndc_key {
  593. key subkey {
  594. secret "1234abcd8765";
  595. - algorithm hmac-sha256;
  596. + algorithm @DEFAULT_HMAC@;
  597. };
  598. controls {
  599. diff --git a/bin/tests/system/nsupdate/setup.sh b/bin/tests/system/nsupdate/setup.sh
  600. index 50056dc..a4a1a3f 100644
  601. --- a/bin/tests/system/nsupdate/setup.sh
  602. +++ b/bin/tests/system/nsupdate/setup.sh
  603. @@ -72,7 +72,11 @@ EOF
  604. $TSIGKEYGEN ddns-key.example.nil > ns1/ddns.key
  605. -$TSIGKEYGEN -a hmac-md5 md5-key > ns1/md5.key
  606. +if $FEATURETEST --md5; then
  607. + $TSIGKEYGEN -a hmac-md5 md5-key > ns1/md5.key
  608. +else
  609. + echo -n > ns1/md5.key
  610. +fi
  611. $TSIGKEYGEN -a hmac-sha1 sha1-key > ns1/sha1.key
  612. $TSIGKEYGEN -a hmac-sha224 sha224-key > ns1/sha224.key
  613. $TSIGKEYGEN -a hmac-sha256 sha256-key > ns1/sha256.key
  614. diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh
  615. index d612a22..9f18e57 100755
  616. --- a/bin/tests/system/nsupdate/tests.sh
  617. +++ b/bin/tests/system/nsupdate/tests.sh
  618. @@ -841,7 +841,12 @@ fi
  619. n=$((n + 1))
  620. ret=0
  621. echo_i "check TSIG key algorithms (nsupdate -k) ($n)"
  622. -for alg in md5 sha1 sha224 sha256 sha384 sha512; do
  623. +MD5ALG='md5'
  624. +if ! $FEATURETEST --md5; then
  625. + MD5ALG=''
  626. + echo_i "skipping disabled md5 algorithm"
  627. +fi
  628. +for alg in $MD5ALG sha1 sha224 sha256 sha384 sha512; do
  629. $NSUPDATE -k ns1/${alg}.key <<END > /dev/null || ret=1
  630. server 10.53.0.1 ${PORT}
  631. update add ${alg}.keytests.nil. 600 A 10.10.10.3
  632. @@ -849,7 +854,7 @@ send
  633. END
  634. done
  635. sleep 2
  636. -for alg in md5 sha1 sha224 sha256 sha384 sha512; do
  637. +for alg in $ALGS; do
  638. $DIG $DIGOPTS +short @10.53.0.1 ${alg}.keytests.nil | grep 10.10.10.3 > /dev/null 2>&1 || ret=1
  639. done
  640. if [ $ret -ne 0 ]; then
  641. diff --git a/bin/tests/system/rndc/ns2/named.conf.in b/bin/tests/system/rndc/ns2/named.conf.in
  642. index 117a5f4..be1af25 100644
  643. --- a/bin/tests/system/rndc/ns2/named.conf.in
  644. +++ b/bin/tests/system/rndc/ns2/named.conf.in
  645. @@ -27,7 +27,7 @@ key rndc_key {
  646. key secondkey {
  647. secret "abcd1234abcd8765";
  648. - algorithm hmac-sha256;
  649. + algorithm @DEFAULT_HMAC@;
  650. };
  651. controls {
  652. diff --git a/bin/tests/system/rndc/ns3/named.conf.in b/bin/tests/system/rndc/ns3/named.conf.in
  653. index 3078e90..fd97ca2 100644
  654. --- a/bin/tests/system/rndc/ns3/named.conf.in
  655. +++ b/bin/tests/system/rndc/ns3/named.conf.in
  656. @@ -25,7 +25,7 @@ key rndc_key {
  657. key secondkey {
  658. secret "abcd1234abcd8765";
  659. - algorithm hmac-sha256;
  660. + algorithm @DEFAULT_HMAC@;
  661. };
  662. controls {
  663. diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh
  664. index 5f638ef..85d6b73 100644
  665. --- a/bin/tests/system/rndc/setup.sh
  666. +++ b/bin/tests/system/rndc/setup.sh
  667. @@ -47,7 +47,7 @@ make_key () {
  668. sed 's/allow { 10.53.0.4/allow { any/' >> ns4/named.conf
  669. }
  670. -make_key 1 ${EXTRAPORT1} hmac-md5
  671. +$FEATURETEST --md5 && make_key 1 ${EXTRAPORT1} hmac-md5
  672. make_key 2 ${EXTRAPORT2} hmac-sha1
  673. make_key 3 ${EXTRAPORT3} hmac-sha224
  674. make_key 4 ${EXTRAPORT4} hmac-sha256
  675. diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh
  676. index e68428c..acbeb52 100644
  677. --- a/bin/tests/system/rndc/tests.sh
  678. +++ b/bin/tests/system/rndc/tests.sh
  679. @@ -350,15 +350,19 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
  680. status=$((status+ret))
  681. n=$((n+1))
  682. -echo_i "testing rndc with hmac-md5 ($n)"
  683. -ret=0
  684. -$RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key1.conf status > /dev/null 2>&1 || ret=1
  685. -for i in 2 3 4 5 6
  686. -do
  687. - $RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1
  688. -done
  689. -if [ $ret != 0 ]; then echo_i "failed"; fi
  690. -status=$((status+ret))
  691. +if $FEATURETEST --md5; then
  692. + echo_i "testing rndc with hmac-md5 ($n)"
  693. + ret=0
  694. + $RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key1.conf status > /dev/null 2>&1 || ret=1
  695. + for i in 2 3 4 5 6
  696. + do
  697. + $RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1
  698. + done
  699. + if [ $ret != 0 ]; then echo_i "failed"; fi
  700. + status=$((status+ret))
  701. +else
  702. + echo_i "skipping rndc with hmac-md5 ($n)"
  703. +fi
  704. n=$((n+1))
  705. echo_i "testing rndc with hmac-sha1 ($n)"
  706. diff --git a/bin/tests/system/tsig/ns1/named.conf.in b/bin/tests/system/tsig/ns1/named.conf.in
  707. index 76cf970..22637af 100644
  708. --- a/bin/tests/system/tsig/ns1/named.conf.in
  709. +++ b/bin/tests/system/tsig/ns1/named.conf.in
  710. @@ -23,10 +23,7 @@ options {
  711. notify no;
  712. };
  713. -key "md5" {
  714. - secret "97rnFx24Tfna4mHPfgnerA==";
  715. - algorithm hmac-md5;
  716. -};
  717. +# md5 key appended by setup.sh at the end
  718. key "sha1" {
  719. secret "FrSt77yPTFx6hTs4i2tKLB9LmE0=";
  720. @@ -53,10 +50,7 @@ key "sha512" {
  721. algorithm hmac-sha512;
  722. };
  723. -key "md5-trunc" {
  724. - secret "97rnFx24Tfna4mHPfgnerA==";
  725. - algorithm hmac-md5-80;
  726. -};
  727. +# md5-trunc key appended by setup.sh at the end
  728. key "sha1-trunc" {
  729. secret "FrSt77yPTFx6hTs4i2tKLB9LmE0=";
  730. diff --git a/bin/tests/system/tsig/ns1/rndc5.conf.in b/bin/tests/system/tsig/ns1/rndc5.conf.in
  731. new file mode 100644
  732. index 0000000..0682194
  733. --- /dev/null
  734. +++ b/bin/tests/system/tsig/ns1/rndc5.conf.in
  735. @@ -0,0 +1,10 @@
  736. +# Conditionally included when support for MD5 is available
  737. +key "md5" {
  738. + secret "97rnFx24Tfna4mHPfgnerA==";
  739. + algorithm hmac-md5;
  740. +};
  741. +
  742. +key "md5-trunc" {
  743. + secret "97rnFx24Tfna4mHPfgnerA==";
  744. + algorithm hmac-md5-80;
  745. +};
  746. diff --git a/bin/tests/system/tsig/setup.sh b/bin/tests/system/tsig/setup.sh
  747. index 34cc73b..d51ff21 100644
  748. --- a/bin/tests/system/tsig/setup.sh
  749. +++ b/bin/tests/system/tsig/setup.sh
  750. @@ -16,3 +16,8 @@
  751. $SHELL clean.sh
  752. copy_setports ns1/named.conf.in ns1/named.conf
  753. +
  754. +if $FEATURETEST --md5
  755. +then
  756. + cat ns1/rndc5.conf.in >> ns1/named.conf
  757. +fi
  758. diff --git a/bin/tests/system/tsig/tests.sh b/bin/tests/system/tsig/tests.sh
  759. index 1067227..ee05e83 100644
  760. --- a/bin/tests/system/tsig/tests.sh
  761. +++ b/bin/tests/system/tsig/tests.sh
  762. @@ -27,20 +27,25 @@ sha512="jI/Pa4qRu96t76Pns5Z/Ndxbn3QCkwcxLOgt9vgvnJw5wqTRvNyk3FtD6yIMd1dWVlqZ+Y4f
  763. status=0
  764. -echo_i "fetching using hmac-md5 (old form)"
  765. -ret=0
  766. -$DIG $DIGOPTS example.nil. -y "md5:$md5" @10.53.0.1 soa > dig.out.md5.old || ret=1
  767. -grep -i "md5.*TSIG.*NOERROR" dig.out.md5.old > /dev/null || ret=1
  768. -if [ $ret -eq 1 ] ; then
  769. - echo_i "failed"; status=1
  770. -fi
  771. -
  772. -echo_i "fetching using hmac-md5 (new form)"
  773. -ret=0
  774. -$DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1
  775. -grep -i "md5.*TSIG.*NOERROR" dig.out.md5.new > /dev/null || ret=1
  776. -if [ $ret -eq 1 ] ; then
  777. - echo_i "failed"; status=1
  778. +if $FEATURETEST --md5
  779. +then
  780. + echo_i "fetching using hmac-md5 (old form)"
  781. + ret=0
  782. + $DIG $DIGOPTS example.nil. -y "md5:$md5" @10.53.0.1 soa > dig.out.md5.old || ret=1
  783. + grep -i "md5.*TSIG.*NOERROR" dig.out.md5.old > /dev/null || ret=1
  784. + if [ $ret -eq 1 ] ; then
  785. + echo_i "failed"; status=1
  786. + fi
  787. +
  788. + echo_i "fetching using hmac-md5 (new form)"
  789. + ret=0
  790. + $DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1
  791. + grep -i "md5.*TSIG.*NOERROR" dig.out.md5.new > /dev/null || ret=1
  792. + if [ $ret -eq 1 ] ; then
  793. + echo_i "failed"; status=1
  794. + fi
  795. +else
  796. + echo_i "skipping using hmac-md5"
  797. fi
  798. echo_i "fetching using hmac-sha1"
  799. @@ -88,12 +93,17 @@ fi
  800. # Truncated TSIG
  801. #
  802. #
  803. -echo_i "fetching using hmac-md5 (trunc)"
  804. -ret=0
  805. -$DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5-trunc:$md5" @10.53.0.1 soa > dig.out.md5.trunc || ret=1
  806. -grep -i "md5-trunc.*TSIG.*NOERROR" dig.out.md5.trunc > /dev/null || ret=1
  807. -if [ $ret -eq 1 ] ; then
  808. - echo_i "failed"; status=1
  809. +if $FEATURETEST --md5
  810. +then
  811. + echo_i "fetching using hmac-md5 (trunc)"
  812. + ret=0
  813. + $DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5-trunc:$md5" @10.53.0.1 soa > dig.out.md5.trunc || ret=1
  814. + grep -i "md5-trunc.*TSIG.*NOERROR" dig.out.md5.trunc > /dev/null || ret=1
  815. + if [ $ret -eq 1 ] ; then
  816. + echo_i "failed"; status=1
  817. + fi
  818. +else
  819. + echo_i "skipping using hmac-md5 (trunc)"
  820. fi
  821. echo_i "fetching using hmac-sha1 (trunc)"
  822. @@ -142,12 +152,17 @@ fi
  823. # Check for bad truncation.
  824. #
  825. #
  826. -echo_i "fetching using hmac-md5-80 (BADTRUNC)"
  827. -ret=0
  828. -$DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5:$md5" @10.53.0.1 soa > dig.out.md5-80 || ret=1
  829. -grep -i "md5.*TSIG.*BADTRUNC" dig.out.md5-80 > /dev/null || ret=1
  830. -if [ $ret -eq 1 ] ; then
  831. - echo_i "failed"; status=1
  832. +if $FEATURETEST --md5
  833. +then
  834. + echo_i "fetching using hmac-md5-80 (BADTRUNC)"
  835. + ret=0
  836. + $DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5:$md5" @10.53.0.1 soa > dig.out.md5-80 || ret=1
  837. + grep -i "md5.*TSIG.*BADTRUNC" dig.out.md5-80 > /dev/null || ret=1
  838. + if [ $ret -eq 1 ] ; then
  839. + echo_i "failed"; status=1
  840. + fi
  841. +else
  842. + echo_i "skipping using hmac-md5-80 (BADTRUNC)"
  843. fi
  844. echo_i "fetching using hmac-sha1-80 (BADTRUNC)"
  845. diff --git a/bin/tests/system/upforwd/ns1/named.conf.in b/bin/tests/system/upforwd/ns1/named.conf.in
  846. index c2b57dd..ea744f8 100644
  847. --- a/bin/tests/system/upforwd/ns1/named.conf.in
  848. +++ b/bin/tests/system/upforwd/ns1/named.conf.in
  849. @@ -12,7 +12,7 @@
  850. */
  851. key "update.example." {
  852. - algorithm "hmac-md5";
  853. + algorithm "@DEFAULT_HMAC@";
  854. secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
  855. };
  856. diff -Nuar a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh
  857. --- a/bin/tests/system/upforwd/tests.sh 2023-01-13 01:21:15.238402000 +0300
  858. +++ b/bin/tests/system/upforwd/tests.sh 2023-01-26 15:22:00.879249456 +0300
  859. @@ -80,7 +80,7 @@
  860. echo_i "updating zone (signed) ($n)"
  861. ret=0
  862. -$NSUPDATE -y update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <<EOF || ret=1
  863. +$NSUPDATE -y hmac-sha256:update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <<EOF || ret=1
  864. local 10.53.0.1
  865. server 10.53.0.3 ${PORT}
  866. update add updated.example. 600 A 10.10.10.1
  867. --
  868. 2.39.0