provider-compatibility.yml 9.2 KB

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