2
0

13-fragmentation.cnf.in 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. # -*- mode: perl; -*-
  2. # Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. ## Test packet fragmentation
  9. use strict;
  10. use warnings;
  11. package ssltests;
  12. our @tests = (
  13. # Default fragment size is 512.
  14. {
  15. name => "one-fragment-minus-app-data",
  16. server => { },
  17. client => { },
  18. test => {
  19. ApplicationData => 511,
  20. }
  21. },
  22. {
  23. name => "one-fragment-app-data",
  24. server => { },
  25. client => { },
  26. test => {
  27. ApplicationData => 512,
  28. }
  29. },
  30. {
  31. name => "one-fragment-plus-app-data",
  32. server => { },
  33. client => { },
  34. test => {
  35. ApplicationData => 513,
  36. }
  37. },
  38. {
  39. name => "small-app-data",
  40. server => { },
  41. client => { },
  42. test => {
  43. ApplicationData => 4 * 1024 + 1,
  44. }
  45. },
  46. {
  47. name => "small-app-data-large-fragment-size",
  48. server => { },
  49. client => { },
  50. test => {
  51. ApplicationData => 4 * 1024 + 1,
  52. MaxFragmentSize => 16384,
  53. }
  54. },
  55. {
  56. name => "medium-app-data",
  57. server => { },
  58. client => { },
  59. test => {
  60. ApplicationData => 32 * 1024 + 7,
  61. }
  62. },
  63. # Exceeds the 64kB write buffer size.
  64. {
  65. name => "medium-plus-app-data",
  66. server => { },
  67. client => { },
  68. test => {
  69. ApplicationData => 128 * 1024 - 3,
  70. }
  71. },
  72. {
  73. name => "large-app-data",
  74. server => { },
  75. client => { },
  76. test => {
  77. ApplicationData => 1024 * 1024,
  78. }
  79. },
  80. {
  81. name => "large-app-data-large-fragment-size",
  82. server => { },
  83. client => { },
  84. test => {
  85. ApplicationData => 1024 * 1024,
  86. MaxFragmentSize => 16384,
  87. }
  88. },
  89. {
  90. name => "large-app-data-odd-fragment-size",
  91. server => { },
  92. client => { },
  93. test => {
  94. ApplicationData => 1024 * 1024,
  95. MaxFragmentSize => 5 * 1024 - 5,
  96. }
  97. },
  98. # When the buffer / fragment size ratio is sufficiently large,
  99. # multi-buffer code kicks in on some platforms for AES-SHA. The
  100. # exact minimum ratio depends on the platform, and is usually
  101. # around 4. Since the test buffer is 64kB, a 4kB fragment is
  102. # easily sufficient.
  103. #
  104. # (We run this test on all platforms though it's only true multibuffer
  105. # on some of them.)
  106. {
  107. name => "large-app-data-aes-sha1-multibuffer",
  108. server => { },
  109. client => {
  110. CipherString => "AES128-SHA",
  111. MaxProtocol => "TLSv1.2"
  112. },
  113. test => {
  114. ApplicationData => 1024 * 1024,
  115. MaxFragmentSize => 4 * 1024,
  116. }
  117. },
  118. {
  119. name => "large-app-data-aes-sha2-multibuffer",
  120. server => { },
  121. client => {
  122. CipherString => "AES128-SHA256",
  123. MaxProtocol => "TLSv1.2"
  124. },
  125. test => {
  126. ApplicationData => 1024 * 1024,
  127. MaxFragmentSize => 4 * 1024,
  128. }
  129. },
  130. {
  131. name => "large-app-data-aes-sha1-multibuffer-odd-fragment",
  132. server => { },
  133. client => {
  134. CipherString => "AES128-SHA",
  135. MaxProtocol => "TLSv1.2"
  136. },
  137. test => {
  138. ApplicationData => 1024 * 1024 + 3,
  139. MaxFragmentSize => 5 * 1024 - 5,
  140. }
  141. },
  142. {
  143. name => "large-app-data-aes-sha2-multibuffer-odd-fragment",
  144. server => { },
  145. client => {
  146. CipherString => "AES128-SHA256",
  147. MaxProtocol => "TLSv1.2"
  148. },
  149. test => {
  150. ApplicationData => 1024 * 1024 - 3,
  151. MaxFragmentSize => 5 * 1024 + 5,
  152. }
  153. },
  154. # Test that multibuffer-capable code also handles small data correctly.
  155. # Here fragment size == app data size < buffer size,
  156. # so no multibuffering should happen.
  157. {
  158. name => "small-app-data-aes-sha1-multibuffer",
  159. server => { },
  160. client => {
  161. CipherString => "AES128-SHA",
  162. MaxProtocol => "TLSv1.2"
  163. },
  164. test => {
  165. ApplicationData => 4 * 1024,
  166. MaxFragmentSize => 4 * 1024,
  167. }
  168. },
  169. {
  170. name => "small-app-data-aes-sha2-multibuffer",
  171. server => { },
  172. client => {
  173. CipherString => "AES128-SHA256",
  174. MaxProtocol => "TLSv1.2"
  175. },
  176. test => {
  177. ApplicationData => 4 * 1024,
  178. MaxFragmentSize => 4 * 1024,
  179. }
  180. },
  181. ############################################
  182. # Default (Max) Fragment Size is 512.
  183. # Default Application data size is 256.
  184. {
  185. name => "Maximum Fragment Len extension set to 1024 w. FragmentSize disabled",
  186. server => { },
  187. client => {
  188. extra => {
  189. MaxFragmentLenExt => 1024,
  190. },
  191. },
  192. test => {
  193. ApplicationData => 3072,
  194. MaxFragmentSize => 16384,
  195. }
  196. },
  197. {
  198. name => "Maximum Fragment Len extension equal FragmentSize to 2048",
  199. server => { },
  200. client => {
  201. extra => {
  202. MaxFragmentLenExt => 2048,
  203. },
  204. },
  205. test => {
  206. ApplicationData => 3072,
  207. MaxFragmentSize => 2048,
  208. }
  209. },
  210. {
  211. name => "Maximum Fragment Len extension 512 lower than FragmentSize 1024",
  212. server => { },
  213. client => {
  214. extra => {
  215. MaxFragmentLenExt => 512,
  216. },
  217. },
  218. test => {
  219. ApplicationData => 3072,
  220. MaxFragmentSize => 1024,
  221. }
  222. },
  223. {
  224. name => "Maximum Fragment Len extension 1024 lower than FragmentSize 1024",
  225. server => { },
  226. client => {
  227. extra => {
  228. MaxFragmentLenExt => 2048,
  229. },
  230. },
  231. test => {
  232. ApplicationData => 3072,
  233. MaxFragmentSize => 1024,
  234. }
  235. },
  236. {
  237. name => "Maximum Fragment Len extension 4096 greater than FragmentSize 2048",
  238. server => { },
  239. client => {
  240. extra => {
  241. MaxFragmentLenExt => 4096,
  242. },
  243. },
  244. test => {
  245. ApplicationData => 8196,
  246. MaxFragmentSize => 2048,
  247. }
  248. },
  249. {
  250. name => "Maximum Fragment Len extension 2048 greater than FragmentSize 1024",
  251. server => { },
  252. client => {
  253. extra => {
  254. MaxFragmentLenExt => 2048,
  255. },
  256. },
  257. test => {
  258. ApplicationData => 3072,
  259. MaxFragmentSize => 1024,
  260. }
  261. },
  262. );