2
0

03-custom_verify.cnf.in 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # -*- mode: perl; -*-
  2. # Copyright 2016-2021 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. ## SSL test configurations
  9. package ssltests;
  10. our @tests = (
  11. # Sanity-check that verification indeed succeeds without the
  12. # restrictive callback.
  13. {
  14. name => "verify-success",
  15. server => { },
  16. client => { },
  17. test => { "ExpectedResult" => "Success" },
  18. },
  19. # Same test as above but with a custom callback that always fails.
  20. {
  21. name => "verify-custom-reject",
  22. server => { },
  23. client => {
  24. extra => {
  25. "VerifyCallback" => "RejectAll",
  26. },
  27. },
  28. test => {
  29. "ExpectedResult" => "ClientFail",
  30. "ExpectedClientAlert" => "HandshakeFailure",
  31. },
  32. },
  33. # Same test as above but with a custom callback that always succeeds.
  34. {
  35. name => "verify-custom-allow",
  36. server => { },
  37. client => {
  38. extra => {
  39. "VerifyCallback" => "AcceptAll",
  40. },
  41. },
  42. test => {
  43. "ExpectedResult" => "Success",
  44. },
  45. },
  46. # Same test as above but with a custom callback that requests retry once.
  47. {
  48. name => "verify-custom-retry",
  49. server => { },
  50. client => {
  51. extra => {
  52. "VerifyCallback" => "RetryOnce",
  53. },
  54. },
  55. test => {
  56. "ExpectedResult" => "Success",
  57. },
  58. },
  59. # Sanity-check that verification indeed succeeds if peer verification
  60. # is not requested.
  61. {
  62. name => "noverify-success",
  63. server => { },
  64. client => {
  65. "VerifyMode" => undef,
  66. "VerifyCAFile" => undef,
  67. },
  68. test => { "ExpectedResult" => "Success" },
  69. },
  70. # Same test as above but with a custom callback that always fails.
  71. # The callback return has no impact on handshake success in this mode.
  72. {
  73. name => "noverify-ignore-custom-reject",
  74. server => { },
  75. client => {
  76. "VerifyMode" => undef,
  77. "VerifyCAFile" => undef,
  78. extra => {
  79. "VerifyCallback" => "RejectAll",
  80. },
  81. },
  82. test => {
  83. "ExpectedResult" => "Success",
  84. },
  85. },
  86. # Same test as above but with a custom callback that always succeeds.
  87. # The callback return has no impact on handshake success in this mode.
  88. {
  89. name => "noverify-accept-custom-allow",
  90. server => { },
  91. client => {
  92. "VerifyMode" => undef,
  93. "VerifyCAFile" => undef,
  94. extra => {
  95. "VerifyCallback" => "AcceptAll",
  96. },
  97. },
  98. test => {
  99. "ExpectedResult" => "Success",
  100. },
  101. },
  102. # Sanity-check that verification indeed fails without the
  103. # permissive callback.
  104. {
  105. name => "verify-fail-no-root",
  106. server => { },
  107. client => {
  108. # Don't set up the client root file.
  109. "VerifyCAFile" => undef,
  110. },
  111. test => {
  112. "ExpectedResult" => "ClientFail",
  113. "ExpectedClientAlert" => "UnknownCA",
  114. },
  115. },
  116. # Same test as above but with a custom callback that always succeeds.
  117. {
  118. name => "verify-custom-success-no-root",
  119. server => { },
  120. client => {
  121. "VerifyCAFile" => undef,
  122. extra => {
  123. "VerifyCallback" => "AcceptAll",
  124. },
  125. },
  126. test => {
  127. "ExpectedResult" => "Success"
  128. },
  129. },
  130. # Same test as above but with a custom callback that always fails.
  131. {
  132. name => "verify-custom-fail-no-root",
  133. server => { },
  134. client => {
  135. "VerifyCAFile" => undef,
  136. extra => {
  137. "VerifyCallback" => "RejectAll",
  138. },
  139. },
  140. test => {
  141. "ExpectedResult" => "ClientFail",
  142. "ExpectedClientAlert" => "HandshakeFailure",
  143. },
  144. },
  145. );