Skip to content

Commit

Permalink
Ensure ordinals are created during release process
Browse files Browse the repository at this point in the history
We introduce a new makefile target "make release-update" that forces
ordinal file renumbering, and also does the fips checksum updates. We
then call that  from the release script.

Fixes openssl#15806

Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#15901)
  • Loading branch information
mattcaswell authored and paulidale committed Jun 28, 2021
1 parent 52f5407 commit 6ee4741
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
13 changes: 13 additions & 0 deletions Configurations/unix-Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,19 @@ CRYPTOHEADERS={- join(" \\\n" . ' ' x 14,
fill_lines(" ", $COLUMNS - 14, sort keys %cryptoheaders)) -}
SSLHEADERS={- join(" \\\n" . ' ' x 11,
fill_lines(" ", $COLUMNS - 11, sort keys %sslheaders)) -}

renumber: build_generated
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
--ordinals $(SRCDIR)/util/libcrypto.num \
--symhacks $(SRCDIR)/include/openssl/symhacks.h \
--renumber \
$(CRYPTOHEADERS)
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
--ordinals $(SRCDIR)/util/libssl.num \
--symhacks $(SRCDIR)/include/openssl/symhacks.h \
--renumber \
$(SSLHEADERS)

ordinals: build_generated
$(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
--ordinals $(SRCDIR)/util/libcrypto.num \
Expand Down
7 changes: 6 additions & 1 deletion dev/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,12 @@ echo "== Configuring OpenSSL for update and release. This may take a bit of tim
$VERBOSE "== Checking source file updates and fips checksums"

make update >&42

# As long as we're doing an alpha release, we can have symbols without specific
# numbers assigned. In a beta or final release, all symbols MUST have an
# assigned number.
if [ "$next_method" != 'alpha' ]; then
make renumber >&42
fi
make update-fips-checksums >&42

if [ -n "$(git status --porcelain)" ]; then
Expand Down
9 changes: 3 additions & 6 deletions util/mknum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
my $version = undef; # the version to use for added symbols
my $checkexist = 0; # (unsure yet)
my $warnings = 1;
my $renumber = 0;
my $verbose = 0;
my $debug = 0;

GetOptions('ordinals=s' => \$ordinals_file,
'symhacks=s' => \$symhacks_file,
'version=s' => \$version,
'exist' => \$checkexist,
'renumber' => \$renumber,
'warnings!' => \$warnings,
'verbose' => \$verbose,
'debug' => \$debug)
Expand Down Expand Up @@ -88,12 +90,7 @@
close IN;
}

# As long as we're running in development or alpha releases, we can have
# symbols without specific numbers assigned. In beta or final release, all
# symbols MUST have an assigned number.
if ($version !~ m/^\d+\.\d+\.\d+(?:-alpha|(?:-.*?)?-dev$)/) {
$ordinals->renumber();
}
$ordinals->renumber() if $renumber;

if ($checkexist) {
my %new_names = map { $_->name() => 1 }
Expand Down

0 comments on commit 6ee4741

Please sign in to comment.