Update the release HOWTO following the 3.1 release
[tools.git] / HOWTO-make-a-release.md
1 # HOW TO MAKE A RELEASE
2
3 This file documents how to make an OpenSSL release.  Please fix any errors
4 you find while doing, or just after, your next release!
5
6 Releases are done by one person, with a second person acting as the reviewer
7 and additional tester.
8
9 # Table of contents
10
11 -   [Prerequisites](#prerequisites)
12     -   [Software](#software)
13     -   [Repositories](#repositories)
14     -   [PGP / GnuPG key](#pgp-gnupg-key)
15     -   [SSH access](#check-your-access)
16     -   [A method for reviewing](#a-way-to-reviewing)
17 -   [Pre-publishing tasks](#pre-publishing-tasks)
18     -   [Prepare your repository checkouts](#prepare-your-repository-checkouts)
19     -   [Freeze the source repository](#freeze-the-source-repository) [three business days before release]
20     -   [Make sure that the openssl source is up to date](#make-sure-that-the-openssl-source-is-up-to-date)
21     -   [Generate the tarball and announcement text](#generating-the-tarball-and-announcement-text)
22         -   [OpenSSL 3.0 and on](#openssl-3.0-and-on)
23         -   [OpenSSL before 3.0](#openssl-before-3.0)
24     -   [Update the release data locally](#update-the-release-data-locally)
25         [do not push]
26 -   [Publish the release](#publish-the-release)
27     -   [Updating the release data](#updating-the-release-data)
28 -   [Post-publishing tasks](#post-publishing-tasks)
29     -   [Check the website](#check-the-website) [only for public releases]
30     -   [Send the announcement mail](#send-the-announcement-mail)
31     -   [Send out the Security Advisory](#send-out-the-security-advisory)
32     -   [Unfreeze the source repository](#unfreeze-the-source-repository)
33     -   [Security fixes](#security-fixes)
34     -   [Keep in touch](#keep-in-touch)
35
36
37 # Prerequisites
38
39 ## Software
40
41 Apart from the basic operating system utilities, you must have the following
42 programs in you `$PATH`:
43
44 - openssl
45 - ssh
46 - gpg
47 - git
48
49 (note: this may not be a complete list)
50
51 ## Repositories
52
53 You must have access to the following repositories:
54
55 -   `git@github.openssl.org:openssl/openssl.git` or
56     `git@github.openssl.org:openssl/premium.git`
57
58     `openssl/openssl` is the public source repository, while
59     `openssl/premium` is the premium release repository.
60
61 -   `git@github.openssl.org:otc/tools.git`
62
63     This contains certain common tools
64
65 -   `git@github.openssl.org:omc/data.git`
66
67     This contains files to be updated as part of any release
68
69 ## PGP / GnuPG key
70
71 You must have a PGP / GnuPG key, and its fingerprint should be present in
72 the file `doc/fingerprints.txt` in the source of the immediately prior
73 OpenSSL release.
74
75 ## SSH access
76
77 To perform a release, you must have appropriate access to OpenSSL's
78 development host, dev.openssl.org.  To test this, try to log in with ssh:
79
80     ssh dev.openssl.org
81
82 You must also check that you can perform tasks as the user 'openssl' on
83 dev.openssl.org.  When you have successfully logged in, test your access to
84 that user with sudo:
85
86     sudo -u openssl id
87
88 ## A method for reviewing
89
90 For reviewing to take place, the release person and the reviewer need a way
91 to share changes that are being applied.  Most commonly, that's done as PRs
92 (for normal releases) or security advisories (for undisclosed security
93 fixes) through Github.
94
95 Security advisories are created using the Github Security tab, and will
96 generate a private repository, to which you can add collaborators (the
97 reviewer, for instance), and use it to fix the issue via pull requests.
98 For more information, please read Github's [creating a security advisory],
99 including the "Next Steps" at the end of that page.
100
101 [creating a security advisory]:
102 <https://docs.github.com/en/free-pro-team@latest/github/managing-security-vulnerabilities/creating-a-security-advisory>
103
104 The release person and the reviewer are allowed to use other means to share
105 the commits to be reviewed if they desire.
106
107 The release person and the reviewer must have a conversation to confirm or
108 figure out how the review shall be done.
109
110 # Pre-publishing tasks
111
112 Some of the actions in this section need to be repeated for each OpenSSL
113 version released.
114
115 ## Prepare your repository checkouts
116
117 You will need to checkout at least three working trees:
118
119 -   one for extra tools
120
121         git clone git@github.openssl.org:otc/tools.git tools
122
123     The resulting directory will be referred to as `$TOOLS`
124
125 -   one for release data
126
127         git clone git@github.openssl.org:omc/data.git data
128
129 -   At least one for openssl source
130
131         git clone git@github.openssl.org:openssl/openssl.git
132
133     or
134
135         git clone git@github.openssl.org:openssl/premium.git
136
137     If you're doing multiple releases in one go, there are many ways to deal
138     with it.  One possibility, available since git 2.5, is to use `git
139     worktree`:
140
141         (cd openssl;
142          git worktree add ../openssl-1.1.1 OpenSSL_1_1_1-stable)
143
144 ## Freeze the source repository
145
146 Three business day before the release, freeze the appropriate source
147 repository.
148
149 This locks out everyone but the named user, who is doing the release, from
150 doing any pushes.  Someone other than the person doing the release should
151 run the command.
152
153 This must be done from a checkout of that source repository, so for public
154 releases:
155
156     git push git@github.openssl.org:openssl/openssl.git HEAD:refs/frozen/NAME
157
158 and for premium releases:
159
160     git push git@github.openssl.org:openssl/premium.git HEAD:refs/frozen/NAME
161
162 Where `NAME` is the github username of the user doing the release.
163
164 Note: it currently doesn't matter what source branch is used when pushing,
165 the whole repository is frozen either way.  The example above uses whatever
166 branch you happen to have checked out.
167
168 ## Make sure that the openssl source is up to date
169
170 The person doing the release and the reviewer should both sanity-check the
171 source to be released at this point.  Checks to consider include building
172 and verifying that make test passes on multiple plaforms - Linux, Windows,
173 etc.
174
175 *NOTE: the files CHANGES and NEWS are called CHANGES.md and NEWS.md in
176 OpenSSL versions from version 3.0 and on*
177
178 For each source checkout, make sure that the CHANGES and NEWS files have
179 been updated and reviewed.
180
181 The NEWS file should contain a summary of any changes for the release;
182 for a security release, it's often simply a list of the CVEs addressed.
183 You should also update NEWS.md in the master branch to include details of
184 all releases.  Only update the bullet points - do not change the release
185 date, keep it as **under development**.
186
187 Add any security fixes to the tree and commit them.
188
189 Make sure that the copyrights are updated.  This script will update the
190 copyright markers and commit the changes (where $TOOLS stands for the
191 openssl-tools.git checkout directory):
192
193     $TOOLS/release-tools/do-copyright-year
194
195 Obtain approval for these commits from the reviewer and add the Release and
196 Reviewed-By trailers as required.
197
198 *Do* send the auto-generated commits to the reviewer and await their
199 approval.
200
201 *Do not push* changes to the source repo at this stage.
202 (the source repo being one of `git@github.openssl.org:openssl/openssl.git`
203 or `git@github.openssl.org:openssl/premium.git`)
204
205 ## Generate the tarball and announcement text
206
207 *The changes in this section should be made in your clone of the openssl
208 source repo*
209
210 The method to generate a release tarball and announcement text has changed
211 with OpenSSL 3.0, so while we continue to make pre-3.0 OpenSSL releases,
212 there are two methods to be aware of.
213
214 Both methods will leave a handful of files, most importantly the release
215 tarball.  When they are done, they display a set of instructions on how to
216 perform the publishing tasks, *please take note of them*.
217
218 After having run the release script, verify that its results are sensible.
219 Check the commits that were added, using for example `git log`.  Check the
220 signed announcement .asc file.  Check that the tarball length and hashes
221 match in the .md5, .sha1, .sha256, and review the announcment file.
222
223 *Do* send the auto-generated commits to the reviewer and await their
224 approval.
225
226 *Do not push* changes to the source repo at this stage.
227 (the source repo being one of `git@github.openssl.org:openssl/openssl.git`
228 or `git@github.openssl.org:openssl/premium.git`)
229
230 ### OpenSSL 3.0 and on
231
232 The release generating script is in the OpenSSL source checkout, and is
233 generally called like this:
234
235     dev/release.sh --reviewer=NAME
236
237 This script has a multitude of other options that are useful for specific
238 cases, and is also self-documented:
239
240 -   To get a quick usage reminder:
241
242         dev/release.sh --help
243
244 -   To get a man-page:
245
246         dev/release.sh --manual
247
248 ### OpenSSL before 3.0
249
250 The release generating script is in the tools checkout, represented here
251 with $TOOLS, and is generally called like this:
252
253     $TOOLS/release-tools/mkrelease.pl --reviewer=NAME
254
255 The manual for that script is found in `$TOOLS/release-tools/MKRELEASE.md`
256
257 ## Update the release data locally
258
259 *The changes in this section should be made in your clone of the release
260 data repo*
261
262 -   Newsflash *[only for public releases]*
263
264     Update the newsflash.txt file.  This normally is one or two lines.  Just
265     copy and paste existing announcements making minor changes for the date
266     and version number as necessary.  If there is an advisory then ensure
267     you include a link to it.
268
269 -   Security advisory *[both public and premium releases]*
270
271     Update the vulnerabilities.xml file if appropriate.
272
273     If there is a Security Advisory then copy it into the secadv directory.
274
275 Make a pull request from your changes, against the release data repo (the
276 release data repo being `git@github.openssl.org:omc/data.git`).
277
278 *Do not merge the pull request at this point*, even if the reviewer already
279 approved it.
280
281 *Do* send the commits to the reviewer and await their approval.  It's
282 advisable to use this command to get a copy of those commits:
283
284     git format-patch
285
286 # Publish the release
287
288 *BE CAREFUL*  This section makes everything visible and is therefore largely
289 irreversible.  If you are performing a dry run then DO NOT perform any steps
290 in this section.
291
292 Check that the release has been uploaded properly.  The release tarballs and
293 associated files should be in ~openssl/dist/new.  They should be owned by
294 the "upload" userid and world-readable.
295
296 Copy the tarballs to appropriate directories.  This can be done using the
297 do-release.pl script.  See $TOOLS/release-tools/DO-RELEASE.md for a
298 description of the options.  For example:
299
300     sudo -u openssl perl ~openssl/do-release.pl --copy --move
301
302 This will copy the relevant files to the website and move them from
303 `~openssl/dist/new` to `~openssl/dist/old` so they will not seen by a
304 subsequent release.  Alternatively if you want to perform one release at a
305 time or copy/move the files manually, see below.
306
307 The do-release.pl script will display the commands you will need to issue to
308 send the announcement emails later.  Keep a note of those commands for
309 future reference.
310
311 For public releases, verify that the tarballs are available via FTP:
312
313     ls /srv/ftp/source
314
315 For premium releases, verify that the tarballs are available via SFTP:
316
317     ls /srv/premium
318
319 *For OpenSSL 3.0 and on*, push your local changes to the appropriate source
320 repo as instructed by `dev/release.sh`.  You may want to sanity check the
321 pushes by inserting the `-n` (dry-run) option.
322
323 *For OpenSSL before 3.0*, simply push your local changes to the appropriate
324 source repo, and please do remember to push the release tags as well. You
325 may want to sanity check the pushes by inserting the `-n` (dry-run)
326 option. You must specify the repository / remote and tag to be pushed:
327
328     git push <repository> <tagname>
329
330 Upload the release files to the "Releases" section on github. Visit this URL:
331
332 https://github.com/openssl/openssl/releases
333
334 Click the "Draft a new release" button. Give the release a title, e.g.
335 "OpenSSL 3.1.0". Give it a description. Typically this will be the same text
336 that was used in the newsflash.txt file to announce the release. Upload the
337 four release files, e.g.
338
339 openssl-3.1.0.tar.gz
340 openssl-3.1.0.tar.gz.asc
341 openssl-3.1.0.tar.gz.sha1
342 openssl-3.1.0.tar.gz.sha256
343
344 If this is not the latest stable release, uncheck the "Set as the latest release"
345 checkbox. If this is an alpha or beta release check the "Set as a pre-release"
346 checkbox. Finally click "Publish release".
347
348 ## Updating the release data
349
350 If there is a PR against the release repo to be merged, perform the merge
351 now.
352
353 When you do this for a public release, the website will get updated and a
354 script to flush the Akamai CDN cache will be run.
355
356 You can look at <https://automation.openssl.org/> to see the automation
357 builds in action.  The builder called `web` is of particular interest.
358
359 You can also look at the result at <https://www-origin.openssl.org>; the
360 CDN-hosted www.openssl.org should get updated withing minutes later.
361
362 # Post-publishing tasks
363
364 ## Check the website
365
366 *NOTE: This is **only** for public releases*
367
368 Verify that the release notes, which are built from the CHANGES.md file
369 in the release, have been updated.  This is done automatically by OpenSSL
370 automation; if you see a problem, check if the web build job has been
371 performed yet, you may have to wait a few minutes before it kicks in.
372
373 Wait for a while for the Akamai flush to work (normally within a few minutes).
374 Have a look at the website and news announcement at:
375
376 -   <https://www.openssl.org/>
377 -   <https://www.openssl.org/news/>
378
379 Check the download page has updated properly:
380
381 -   <https://www.openssl.org/source/>
382
383 Check the notes look sensible at:
384
385 -   <https://www.openssl.org/news/newslog.html>
386
387 Also check the notes here:
388
389 -   <https://www.openssl.org/news/openssl-1.0.2-notes.html>
390 -   <https://www.openssl.org/news/openssl-1.1.0-notes.html>
391 -   <https://www.openssl.org/news/openssl-1.1.1-notes.html>
392
393 ## Send the announcement mail
394
395 Send out the announcements.  Generic release announcement messages will be
396 created automatically by the build script and the commands you need to use
397 to send them were displayed when you executed do-release.pl above. They
398 should be sent from the account of the person that owns the key used for
399 signing the release announcement. Ensure that mutt is configured correctly -
400 send a test email first if necessary.
401
402 If do-release.pl was used with `--move` be sure to move the announcement
403 text files away from the staging directory *after they have been sent*.
404 This is done as follows (with VERSION replaced with the version of OpenSSL
405 to announce):
406
407     sudo -u openssl \
408         mv ~openssl/dist/new/openssl-VERSION.txt.asc ~openssl/dist/old
409
410 ## Send out the Security Advisory
411
412 *The secadv file mentioned in this section is the Security Advisory
413 that you copied into the release data repo, up in the section
414 [Update the release data locally](#update-the-release-data-locally)*
415  
416 *This section is only applicable if this is a security release*
417
418 Start with signing the Security Advisory as yourself:
419
420     gpg --clearsign secadv_FILENAME.txt
421
422 Then copy the result to the temporary directory on dev.openssl.org:
423
424     scp secadv_FILENAME.txt.asc dev.openssl.org:/tmp
425
426 To finish, log in on dev.openssl.org and send the signed Security
427 Advisory by email as the user that signed the advisory.
428
429 For all releases, send them to the default set of public mailing lists:
430
431     REPLYTO="openssl@openssl.org" mutt -s "OpenSSL Security Advisory" \
432             openssl-project openssl-users openssl-announce \
433             oss-security@lists.openwall.com \
434             </tmp/secadv_FILENAME.txt.asc
435
436 For premium releases, send them to support-announce as well *and
437 separately*:
438
439     REPLYTO="openssl@openssl.org" mutt -s "OpenSSL Security Advisory" \
440             support-announce </tmp/secadv_FILENAME.txt.asc
441
442 When done, remove the email file:
443
444     rm /tmp/secadv_FILENAME.txt.asc
445
446 Approve the openssl-announce email.  Go to
447 <https://mta.openssl.org/mailman/admindb/openssl-announce>
448 and approve the messages.
449
450 For premium releases, approve the support-announce email as well.  Go to
451 <https://mta.openssl.org/mailman/admindb/support-announce> and approve the
452 messages.
453
454 Check that the mailing list messages have arrived.
455
456 ## Unfreeze the source repository.
457
458 This must be done from a checkout of the appropriate source repo:
459
460     git push --delete git@github.openssl.org:openssl/openssl.git \
461         refs/frozen/NAME
462
463 or:
464
465     git push --delete git@github.openssl.org:openssl/premium.git \
466         refs/frozen/NAME
467
468 ## Security fixes
469
470 If this release includes security fixes with a CVE then you should inform
471 MITRE about them.  See the instructions at the top of cvepool.txt in omc.
472
473 Close the github advisory without pushing to github and remove the private
474 github fork if there was one.
475
476 ## Keep in touch
477
478 Check mailing lists over the next few hours for reports of any success or
479 failure.  If necessary fix these and in the worst case make another
480 release.
481