aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-09-27 15:56:35 +0200
committerRichard Levitte <levitte@openssl.org>2018-12-06 12:24:47 +0100
commit3a63dbef15b62b121c5df8762f8cb915fb06b27a (patch)
tree5408ad7c75146d2a70da69adf99c395f5fa67c19 /util
parent672f943ad6c6d16b1f65a77b8e2c83c8f44a112b (diff)
downloadopenssl-3a63dbef15b62b121c5df8762f8cb915fb06b27a.zip
openssl-3a63dbef15b62b121c5df8762f8cb915fb06b27a.tar.gz
openssl-3a63dbef15b62b121c5df8762f8cb915fb06b27a.tar.bz2
Switch to MAJOR.MINOR.PATCH versioning and version 3.0.0-dev
We're strictly use version numbers of the form MAJOR.MINOR.PATCH. Letter releases are things of days past. The most central change is that we now express the version number with three macros, one for each part of the version number: OPENSSL_VERSION_MAJOR OPENSSL_VERSION_MINOR OPENSSL_VERSION_PATCH We also provide two additional macros to express pre-release and build metadata information (also specified in semantic versioning): OPENSSL_VERSION_PRE_RELEASE OPENSSL_VERSION_BUILD_METADATA To get the library's idea of all those values, we introduce the following functions: unsigned int OPENSSL_version_major(void); unsigned int OPENSSL_version_minor(void); unsigned int OPENSSL_version_patch(void); const char *OPENSSL_version_pre_release(void); const char *OPENSSL_version_build_metadata(void); Additionally, for shared library versioning (which is out of scope in semantic versioning, but that we still need): OPENSSL_SHLIB_VERSION We also provide a macro that contains the release date. This is not part of the version number, but is extra information that we want to be able to display: OPENSSL_RELEASE_DATE Finally, also provide the following convenience functions: const char *OPENSSL_version_text(void); const char *OPENSSL_version_text_full(void); The following macros and functions are deprecated, and while currently existing for backward compatibility, they are expected to disappear: OPENSSL_VERSION_NUMBER OPENSSL_VERSION_TEXT OPENSSL_VERSION OpenSSL_version_num() OpenSSL_version() Also, this function is introduced to replace OpenSSL_version() for all indexes except for OPENSSL_VERSION: OPENSSL_info() For configuration, the option 'newversion-only' is added to disable all the macros and functions that are mentioned as deprecated above. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7724)
Diffstat (limited to 'util')
-rw-r--r--util/libcrypto.num59
-rwxr-xr-xutil/mkdef.pl14
-rwxr-xr-xutil/mkrc.pl32
-rw-r--r--util/perl/OpenSSL/Ordinals.pm8
-rw-r--r--util/perl/OpenSSL/Test.pm11
-rw-r--r--util/private.num9
6 files changed, 56 insertions, 77 deletions
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 85a15a0..964f581 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -3263,7 +3263,7 @@ CMS_RecipientInfo_get0_pkey_ctx 3215 1_1_0 EXIST::FUNCTION:CMS
OCSP_REQINFO_free 3216 1_1_0 EXIST::FUNCTION:OCSP
AUTHORITY_KEYID_new 3217 1_1_0 EXIST::FUNCTION:
i2d_DIST_POINT_NAME 3218 1_1_0 EXIST::FUNCTION:
-OpenSSL_version_num 3219 1_1_0 EXIST::FUNCTION:
+OpenSSL_version_num 3219 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_3
OCSP_CERTID_free 3220 1_1_0 EXIST::FUNCTION:OCSP
BIO_hex_string 3221 1_1_0 EXIST::FUNCTION:
X509_REQ_sign_ctx 3222 1_1_0 EXIST::FUNCTION:
@@ -4577,29 +4577,34 @@ OCSP_resp_get0_respdata 4530 1_1_0j EXIST::FUNCTION:OCSP
EVP_MD_CTX_set_pkey_ctx 4531 1_1_1 EXIST::FUNCTION:
EVP_PKEY_meth_set_digest_custom 4532 1_1_1 EXIST::FUNCTION:
EVP_PKEY_meth_get_digest_custom 4533 1_1_1 EXIST::FUNCTION:
-EVP_MAC_CTX_new 4534 1_1_2 EXIST::FUNCTION:
-EVP_MAC_CTX_new_id 4535 1_1_2 EXIST::FUNCTION:
-EVP_MAC_CTX_free 4536 1_1_2 EXIST::FUNCTION:
-EVP_MAC_CTX_copy 4537 1_1_2 EXIST::FUNCTION:
-EVP_MAC_CTX_mac 4538 1_1_2 EXIST::FUNCTION:
-EVP_MAC_size 4539 1_1_2 EXIST::FUNCTION:
-EVP_MAC_init 4540 1_1_2 EXIST::FUNCTION:
-EVP_MAC_update 4541 1_1_2 EXIST::FUNCTION:
-EVP_MAC_final 4542 1_1_2 EXIST::FUNCTION:
-EVP_MAC_ctrl 4543 1_1_2 EXIST::FUNCTION:
-EVP_MAC_vctrl 4544 1_1_2 EXIST::FUNCTION:
-EVP_MAC_ctrl_str 4545 1_1_2 EXIST::FUNCTION:
-EVP_MAC_str2ctrl 4546 1_1_2 EXIST::FUNCTION:
-EVP_MAC_hex2ctrl 4547 1_1_2 EXIST::FUNCTION:
-EVP_MAC_nid 4548 1_1_2 EXIST::FUNCTION:
-EVP_get_macbyname 4549 1_1_2 EXIST::FUNCTION:
-EVP_MAC_do_all 4550 1_1_2 EXIST::FUNCTION:
-EVP_MAC_do_all_sorted 4551 1_1_2 EXIST::FUNCTION:
-EVP_str2ctrl 4552 1_1_2 EXIST::FUNCTION:
-EVP_hex2ctrl 4553 1_1_2 EXIST::FUNCTION:
-EVP_PKEY_supports_digest_nid 4554 1_1_2 EXIST::FUNCTION:
-SRP_VBASE_add0_user 4555 1_1_2 EXIST::FUNCTION:SRP
-SRP_user_pwd_new 4556 1_1_2 EXIST::FUNCTION:SRP
-SRP_user_pwd_set_gN 4557 1_1_2 EXIST::FUNCTION:SRP
-SRP_user_pwd_set1_ids 4558 1_1_2 EXIST::FUNCTION:SRP
-SRP_user_pwd_set0_sv 4559 1_1_2 EXIST::FUNCTION:SRP
+EVP_MAC_CTX_new 4534 3_0_0 EXIST::FUNCTION:
+EVP_MAC_CTX_new_id 4535 3_0_0 EXIST::FUNCTION:
+EVP_MAC_CTX_free 4536 3_0_0 EXIST::FUNCTION:
+EVP_MAC_CTX_copy 4537 3_0_0 EXIST::FUNCTION:
+EVP_MAC_CTX_mac 4538 3_0_0 EXIST::FUNCTION:
+EVP_MAC_size 4539 3_0_0 EXIST::FUNCTION:
+EVP_MAC_init 4540 3_0_0 EXIST::FUNCTION:
+EVP_MAC_update 4541 3_0_0 EXIST::FUNCTION:
+EVP_MAC_final 4542 3_0_0 EXIST::FUNCTION:
+EVP_MAC_ctrl 4543 3_0_0 EXIST::FUNCTION:
+EVP_MAC_vctrl 4544 3_0_0 EXIST::FUNCTION:
+EVP_MAC_ctrl_str 4545 3_0_0 EXIST::FUNCTION:
+EVP_MAC_str2ctrl 4546 3_0_0 EXIST::FUNCTION:
+EVP_MAC_hex2ctrl 4547 3_0_0 EXIST::FUNCTION:
+EVP_MAC_nid 4548 3_0_0 EXIST::FUNCTION:
+EVP_get_macbyname 4549 3_0_0 EXIST::FUNCTION:
+EVP_MAC_do_all 4550 3_0_0 EXIST::FUNCTION:
+EVP_MAC_do_all_sorted 4551 3_0_0 EXIST::FUNCTION:
+EVP_str2ctrl 4552 3_0_0 EXIST::FUNCTION:
+EVP_hex2ctrl 4553 3_0_0 EXIST::FUNCTION:
+EVP_PKEY_supports_digest_nid 4554 3_0_0 EXIST::FUNCTION:
+SRP_VBASE_add0_user 4555 3_0_0 EXIST::FUNCTION:SRP
+SRP_user_pwd_new 4556 3_0_0 EXIST::FUNCTION:SRP
+SRP_user_pwd_set_gN 4557 3_0_0 EXIST::FUNCTION:SRP
+SRP_user_pwd_set1_ids 4558 3_0_0 EXIST::FUNCTION:SRP
+SRP_user_pwd_set0_sv 4559 3_0_0 EXIST::FUNCTION:SRP
+OPENSSL_version_major 4560 3_0_0 EXIST::FUNCTION:
+OPENSSL_version_minor 4561 3_0_0 EXIST::FUNCTION:
+OPENSSL_version_patch 4562 3_0_0 EXIST::FUNCTION:
+OPENSSL_version_pre_release 4563 3_0_0 EXIST::FUNCTION:
+OPENSSL_version_build_metadata 4564 3_0_0 EXIST::FUNCTION:
diff --git a/util/mkdef.pl b/util/mkdef.pl
index 9cb1147..eac4f50 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -386,19 +386,9 @@ _____
_____
if (defined $version) {
- my ($libvmajor, $libvminor, $libvedit, $libvpatch) =
- $version =~ /^(\d+)_(\d+)_(\d+)([a-z]{0,2})(?:-.*)?$/;
- my $libvpatchnum = 0;
- for (split '', $libvpatch // '') {
- $libvpatchnum += ord(lc($_)) - 96;
- # To compensate because the letter 'z' is always followed by
- # another, i.e. doesn't add any value on its own
- $libvpatchnum-- if lc($_) eq 'z';
- }
- my $match1 = $libvmajor * 100 + $libvminor;
- my $match2 = $libvedit * 100 + $libvpatchnum;
+ my ($libvmajor, $libvminor) = $version =~ /^(\d+)_(\d+)$/;
print <<"_____";
-GSMATCH=LEQUAL,$match1,$match2
+GSMATCH=LEQUAL,$libvmajor,$libvminor;
_____
}
}
diff --git a/util/mkrc.pl b/util/mkrc.pl
index 6762bc4..16b1ab4 100755
--- a/util/mkrc.pl
+++ b/util/mkrc.pl
@@ -10,33 +10,9 @@ use strict;
use warnings;
use lib ".";
use configdata;
-use File::Spec::Functions;
-my $versionfile = catfile( $config{sourcedir}, "include/openssl/opensslv.h" );
-
-my ( $ver, $v1, $v2, $v3, $v4, $beta, $version );
-
-open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n";
-while (<FD>) {
- if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
- $ver = hex($1);
- $v1 = ( $ver >> 28 );
- $v2 = ( $ver >> 20 ) & 0xff;
- $v3 = ( $ver >> 12 ) & 0xff;
- $v4 = ( $ver >> 4 ) & 0xff;
- $beta = $ver & 0xf;
- $version = "$v1.$v2.$v3";
- if ( $beta == 0xf ) {
- $version .= chr( ord('a') + $v4 - 1 ) if ($v4);
- } elsif ( $beta == 0 ) {
- $version .= "-dev";
- } else {
- $version .= "-beta$beta";
- }
- last;
- }
-}
-close(FD);
+my $cversion = "$config{major},$config{minor},$config{patch}";
+my $version = "$config{major}.$config{minor}.$config{patch}$config{prerelease}$config{build_metadata}";
my $filename = $ARGV[0];
my $description = "OpenSSL library";
@@ -53,8 +29,8 @@ print <<___;
LANGUAGE 0x09,0x01
1 VERSIONINFO
- FILEVERSION $v1,$v2,$v3,$v4
- PRODUCTVERSION $v1,$v2,$v3,$v4
+ FILEVERSION $cversion
+ PRODUCTVERSION $cversion
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x01L
diff --git a/util/perl/OpenSSL/Ordinals.pm b/util/perl/OpenSSL/Ordinals.pm
index 07bdf81..928e383 100644
--- a/util/perl/OpenSSL/Ordinals.pm
+++ b/util/perl/OpenSSL/Ordinals.pm
@@ -638,7 +638,7 @@ STRING must conform to the following EBNF description:
space = " " | "\t";
symbol = ( letter | "_"), { letter | digit | "_" };
ordinal = number;
- version = number, "_", number, "_", number, letter, [ letter ];
+ version = number, "_", number, "_", number, [ letter, [ letter ] ];
exist = "EXIST" | "NOEXIST";
platforms = platform, { ",", platform };
platform = ( letter | "_" ) { letter | digit | "_" };
@@ -678,7 +678,7 @@ sub new {
unless ( scalar @a == 4
&& $a[0] =~ /^[A-Za-z_][A-Za-z_0-9]*$/
&& $a[1] =~ /^\d+$/
- && $a[2] =~ /^(?:\*|\d+_\d+_\d+(?:[a-z]{0,2}))$/
+ && $a[2] =~ /^(?:\*|\d+_\d+_\d+[a-z]{0,2})$/
&& $a[3] =~ /^
(?:NO)?EXIST:
[^:]*:
@@ -841,6 +841,8 @@ OpenSSL::Ordinals::Item objects.
=cut
sub by_version {
+ # Until we're rid of everything with the old version scheme,
+ # we need to be able to handle older style x.y.zl versions.
sub _ossl_versionsplit {
my $textversion = shift;
return $textversion if $textversion eq '*';
@@ -891,7 +893,7 @@ sub f_version {
$version =~ s|\.|_|g if $version;
croak "No version specified"
- unless $version && $version =~ /^\d_\d_\d[a-z]{0,2}$/;
+ unless $version && $version =~ /^\d+_\d+_\d+[a-z]{0,2}$/;
return sub { $_[0]->version() eq $version };
}
diff --git a/util/perl/OpenSSL/Test.pm b/util/perl/OpenSSL/Test.pm
index 9564b26..a9436e6 100644
--- a/util/perl/OpenSSL/Test.pm
+++ b/util/perl/OpenSSL/Test.pm
@@ -810,9 +810,9 @@ sub quotify {
=item B<openssl_versions>
-Returns a list of two numbers, the first representing the build version,
-the second representing the library version. See opensslv.h for more
-information on those numbers.
+Returns a list of two version numbers, the first representing the build
+version, the second representing the library version. See opensslv.h for
+more information on those numbers.
=back
@@ -823,9 +823,8 @@ sub openssl_versions {
unless (@versions) {
my %lines =
map { s/\R$//;
- /^(.*): (0x[[:xdigit:]]{8})$/;
- die "Weird line: $_" unless defined $1;
- $1 => hex($2) }
+ /^(.*): (.*)$/;
+ $1 => $2 }
run(test(['versions']), capture => 1);
@versions = ( $lines{'Build version'}, $lines{'Library version'} );
}
diff --git a/util/private.num b/util/private.num
index d6724ed..8e89f1f 100644
--- a/util/private.num
+++ b/util/private.num
@@ -282,7 +282,14 @@ EVP_rc5_32_12_16_cfb define
EVP_seed_cfb define
EVP_sm4_cfb define
OBJ_cleanup define deprecated 1.1.0
-OPENSSL_VERSION_NUMBER define
+OPENSSL_VERSION_MAJOR define
+OPENSSL_VERSION_MINOR define
+OPENSSL_VERSION_NUMBER define deprecated 3.0.0
+OPENSSL_VERSION_PATCH define
+OPENSSL_VERSION_PRE_RELEASE define
+OPENSSL_VERSION_BUILD_METADATA define
+OPENSSL_VERSION_PRE_RELEASE_STR define
+OPENSSL_VERSION_BUILD_METADATA_STR define
OPENSSL_VERSION_TEXT define
OPENSSL_clear_free define
OPENSSL_clear_realloc define