Refactor TLS1-PRF to create the MAC contexts early
[openssl.git] / util / mkrc.pl
index 08b0af1a7ab9605b75e470e6a28b0b37c886beef..b4c53edf6b9ee54cf29b11f5e008c1581a1eec33 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/env perl
-# Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
@@ -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
@@ -70,7 +46,7 @@ BEGIN
         BLOCK "040904b0"
         BEGIN
             // Required:
-            VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
+            VALUE "CompanyName", "The OpenSSL Project, https://www.openssl.org/\\0"
             VALUE "FileDescription", "$description\\0"
             VALUE "FileVersion", "$version\\0"
             VALUE "InternalName", "$filename\\0"