provider-compatibility.yml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. # Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License 2.0 (the "License"). You may not use
  4. # this file except in compliance with the License. You can obtain a copy
  5. # in the file LICENSE in the source distribution or at
  6. # https://www.openssl.org/source/license.html
  7. # This verifies that FIPS and legacy providers built against some earlier
  8. # released versions continue to run against the current branch.
  9. name: Provider compatibility across versions
  10. on: #[pull_request]
  11. schedule:
  12. - cron: '0 15 * * *'
  13. permissions:
  14. contents: read
  15. env:
  16. opts: enable-rc5 enable-md2 enable-ssl3 enable-weak-ssl-ciphers enable-zlib
  17. jobs:
  18. fips-releases:
  19. strategy:
  20. matrix:
  21. release: [
  22. # Formally released versions should be added here.
  23. # `dir' it the directory inside the tarball.
  24. # `tgz' is the name of the tarball.
  25. # `utl' is the download URL.
  26. {
  27. dir: openssl-3.0.0,
  28. tgz: openssl-3.0.0.tar.gz,
  29. url: "https://www.openssl.org/source/old/3.0/openssl-3.0.0.tar.gz",
  30. },
  31. {
  32. dir: openssl-3.0.8,
  33. tgz: openssl-3.0.8.tar.gz,
  34. url: "https://www.openssl.org/source/openssl-3.0.8.tar.gz",
  35. },
  36. {
  37. dir: openssl-3.0.9,
  38. tgz: openssl-3.0.9.tar.gz,
  39. url: "https://www.openssl.org/source/openssl-3.0.9.tar.gz",
  40. },
  41. {
  42. dir: openssl-3.1.1,
  43. tgz: openssl-3.1.1.tar.gz,
  44. url: "https://www.openssl.org/source/openssl-3.1.1.tar.gz",
  45. },
  46. ]
  47. runs-on: ubuntu-latest
  48. steps:
  49. - name: create download directory
  50. run: mkdir downloads
  51. - name: download release source
  52. run: wget --no-verbose ${{ matrix.release.url }}
  53. working-directory: downloads
  54. - name: unpack release source
  55. run: tar xzf downloads/${{ matrix.release.tgz }}
  56. - name: localegen
  57. run: sudo locale-gen tr_TR.UTF-8
  58. - name: config release
  59. run: |
  60. ./config --banner=Configured enable-shared enable-fips ${{ env.opts }}
  61. working-directory: ${{ matrix.release.dir }}
  62. - name: config dump release
  63. run: ./configdata.pm --dump
  64. working-directory: ${{ matrix.release.dir }}
  65. - name: make release
  66. run: make -s -j4
  67. working-directory: ${{ matrix.release.dir }}
  68. - name: create release artifacts
  69. run: |
  70. tar cz -H posix -f ${{ matrix.release.tgz }} ${{ matrix.release.dir }}
  71. - name: show module versions from release
  72. run: |
  73. ./util/wrap.pl -fips apps/openssl list -provider-path providers \
  74. -provider base \
  75. -provider default \
  76. -provider fips \
  77. -provider legacy \
  78. -providers
  79. working-directory: ${{ matrix.release.dir }}
  80. - uses: actions/upload-artifact@v3
  81. with:
  82. name: ${{ matrix.release.tgz }}
  83. path: ${{ matrix.release.tgz }}
  84. retention-days: 7
  85. development-branches:
  86. strategy:
  87. matrix:
  88. branch: [
  89. # Currently supported FIPS capable branches should be added here.
  90. # `name' is the branch name used to checkout out.
  91. # `dir' directory that will be used to build and test in.
  92. # `tgz' is the name of the tarball use to keep the artifacts of
  93. # the build.
  94. {
  95. name: openssl-3.0,
  96. dir: branch-3.0,
  97. tgz: branch-3.0.tar.gz,
  98. }, {
  99. name: openssl-3.1,
  100. dir: branch-3.1,
  101. tgz: branch-3.1.tar.gz,
  102. }, {
  103. name: master,
  104. dir: branch-master,
  105. tgz: branch-master.tar.gz,
  106. },
  107. ]
  108. runs-on: ubuntu-latest
  109. steps:
  110. - uses: actions/checkout@v2
  111. with:
  112. path: ${{ matrix.branch.dir }}
  113. repository: openssl/openssl
  114. ref: ${{ matrix.branch.name }}
  115. - name: localegen
  116. run: sudo locale-gen tr_TR.UTF-8
  117. - name: config branch
  118. run: |
  119. ./config --banner=Configured enable-shared enable-fips ${{ env.opts }}
  120. working-directory: ${{ matrix.branch.dir }}
  121. - name: config dump current
  122. run: ./configdata.pm --dump
  123. working-directory: ${{ matrix.branch.dir }}
  124. - name: make branch
  125. run: make -s -j4
  126. working-directory: ${{ matrix.branch.dir }}
  127. - name: create branch artifacts
  128. run: |
  129. tar cz -H posix -f ${{ matrix.branch.tgz }} ${{ matrix.branch.dir }}
  130. - name: show module versions from branch
  131. run: |
  132. ./util/wrap.pl -fips apps/openssl list -provider-path providers \
  133. -provider base \
  134. -provider default \
  135. -provider fips \
  136. -provider legacy \
  137. -providers
  138. working-directory: ${{ matrix.branch.dir }}
  139. - name: make test
  140. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  141. working-directory: ${{ matrix.branch.dir }}
  142. - uses: actions/upload-artifact@v3
  143. with:
  144. name: ${{ matrix.branch.tgz }}
  145. path: ${{ matrix.branch.tgz }}
  146. retention-days: 7
  147. cross-testing:
  148. needs: [fips-releases, development-branches]
  149. runs-on: ubuntu-latest
  150. strategy:
  151. fail-fast: false
  152. matrix:
  153. # These can't be figured out earlier and included here as a variable
  154. # substitution.
  155. #
  156. # Note that releases are not used as a test environment for
  157. # later providers. Problems in these situations ought to be
  158. # caught by cross branch testing before the release.
  159. tree_a: [ branch-master, branch-3.1, branch-3.0,
  160. openssl-3.0.0, openssl-3.0.8, openssl-3.0.9, openssl-3.1.1 ]
  161. tree_b: [ branch-master, branch-3.1, branch-3.0 ]
  162. steps:
  163. - name: early exit checks
  164. id: early_exit
  165. run: |
  166. if [ "${{ matrix.tree_a }}" = "${{ matrix.tree_b }}" ]; \
  167. then \
  168. echo "Skipping because both are the same version"; \
  169. exit 1; \
  170. fi
  171. continue-on-error: true
  172. - uses: actions/download-artifact@v3
  173. if: steps.early_exit.outcome == 'success'
  174. with:
  175. name: ${{ matrix.tree_a }}.tar.gz
  176. - name: unpack first build
  177. if: steps.early_exit.outcome == 'success'
  178. run: tar xzf "${{ matrix.tree_a }}.tar.gz"
  179. - uses: actions/download-artifact@v3
  180. if: steps.early_exit.outcome == 'success'
  181. with:
  182. name: ${{ matrix.tree_b }}.tar.gz
  183. - name: unpack second build
  184. if: steps.early_exit.outcome == 'success'
  185. run: tar xzf "${{ matrix.tree_b }}.tar.gz"
  186. - name: set up cross validation of FIPS from A with tree from B
  187. if: steps.early_exit.outcome == 'success'
  188. run: |
  189. cp providers/fips.so ../${{ matrix.tree_b }}/providers/
  190. cp providers/fipsmodule.cnf ../${{ matrix.tree_b }}/providers/
  191. working-directory: ${{ matrix.tree_a }}
  192. - name: show module versions from cross validation
  193. if: steps.early_exit.outcome == 'success'
  194. run: |
  195. ./util/wrap.pl -fips apps/openssl list -provider-path providers \
  196. -provider base \
  197. -provider default \
  198. -provider fips \
  199. -provider legacy \
  200. -providers
  201. working-directory: ${{ matrix.tree_b }}
  202. - name: run cross validation tests of FIPS from A with tree from B
  203. if: steps.early_exit.outcome == 'success'
  204. run: |
  205. make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  206. working-directory: ${{ matrix.tree_b }}