2
0

provider-compatibility.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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: master,
  107. dir: branch-master,
  108. tgz: branch-master.tar.gz,
  109. },
  110. ]
  111. runs-on: ubuntu-latest
  112. steps:
  113. - uses: actions/checkout@v4
  114. with:
  115. path: ${{ matrix.branch.dir }}
  116. repository: openssl/openssl
  117. ref: ${{ matrix.branch.name }}
  118. - name: localegen
  119. run: sudo locale-gen tr_TR.UTF-8
  120. - name: config branch
  121. run: |
  122. ./config --banner=Configured enable-shared enable-fips ${{ env.opts }}
  123. working-directory: ${{ matrix.branch.dir }}
  124. - name: config dump current
  125. run: ./configdata.pm --dump
  126. working-directory: ${{ matrix.branch.dir }}
  127. - name: make branch
  128. run: make -s -j4
  129. working-directory: ${{ matrix.branch.dir }}
  130. - name: create branch artifacts
  131. run: |
  132. tar cz -H posix -f ${{ matrix.branch.tgz }} ${{ matrix.branch.dir }}
  133. - name: show module versions from branch
  134. run: |
  135. ./util/wrap.pl -fips apps/openssl list -provider-path providers \
  136. -provider base \
  137. -provider default \
  138. -provider fips \
  139. -provider legacy \
  140. -providers
  141. working-directory: ${{ matrix.branch.dir }}
  142. - name: get cpu info
  143. run: |
  144. cat /proc/cpuinfo
  145. ./util/opensslwrap.sh version -c
  146. working-directory: ${{ matrix.branch.dir }}
  147. - name: make test
  148. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  149. working-directory: ${{ matrix.branch.dir }}
  150. - uses: actions/upload-artifact@v3
  151. with:
  152. name: ${{ matrix.branch.tgz }}
  153. path: ${{ matrix.branch.tgz }}
  154. retention-days: 7
  155. cross-testing:
  156. needs: [fips-releases, development-branches]
  157. runs-on: ubuntu-latest
  158. strategy:
  159. fail-fast: false
  160. matrix:
  161. # These can't be figured out earlier and included here as a variable
  162. # substitution.
  163. #
  164. # Note that releases are not used as a test environment for
  165. # later providers. Problems in these situations ought to be
  166. # caught by cross branch testing before the release.
  167. tree_a: [ branch-master, branch-3.1, branch-3.0,
  168. openssl-3.0.0, openssl-3.0.8, openssl-3.0.9, openssl-3.1.2 ]
  169. tree_b: [ branch-master, branch-3.1, branch-3.0 ]
  170. steps:
  171. - name: early exit checks
  172. id: early_exit
  173. run: |
  174. if [ "${{ matrix.tree_a }}" = "${{ matrix.tree_b }}" ]; \
  175. then \
  176. echo "Skipping because both are the same version"; \
  177. exit 1; \
  178. fi
  179. continue-on-error: true
  180. - uses: actions/download-artifact@v3
  181. if: steps.early_exit.outcome == 'success'
  182. with:
  183. name: ${{ matrix.tree_a }}.tar.gz
  184. - name: unpack first build
  185. if: steps.early_exit.outcome == 'success'
  186. run: tar xzf "${{ matrix.tree_a }}.tar.gz"
  187. - uses: actions/download-artifact@v3
  188. if: steps.early_exit.outcome == 'success'
  189. with:
  190. name: ${{ matrix.tree_b }}.tar.gz
  191. - name: unpack second build
  192. if: steps.early_exit.outcome == 'success'
  193. run: tar xzf "${{ matrix.tree_b }}.tar.gz"
  194. - name: set up cross validation of FIPS from A with tree from B
  195. if: steps.early_exit.outcome == 'success'
  196. run: |
  197. cp providers/fips.so ../${{ matrix.tree_b }}/providers/
  198. cp providers/fipsmodule.cnf ../${{ matrix.tree_b }}/providers/
  199. working-directory: ${{ matrix.tree_a }}
  200. - name: show module versions from cross validation
  201. if: steps.early_exit.outcome == 'success'
  202. run: |
  203. ./util/wrap.pl -fips apps/openssl list -provider-path providers \
  204. -provider base \
  205. -provider default \
  206. -provider fips \
  207. -provider legacy \
  208. -providers
  209. working-directory: ${{ matrix.tree_b }}
  210. - name: get cpu info
  211. if: steps.early_exit.outcome == 'success'
  212. run: |
  213. cat /proc/cpuinfo
  214. ./util/opensslwrap.sh version -c
  215. working-directory: ${{ matrix.tree_b }}
  216. - name: run cross validation tests of FIPS from A with tree from B
  217. if: steps.early_exit.outcome == 'success'
  218. run: |
  219. make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  220. working-directory: ${{ matrix.tree_b }}