From 92e1e3bebe7d7c70e6ec0fdbb53fd97f4a360441 Mon Sep 17 00:00:00 2001 From: Ralf Senderek Date: Fri, 11 Feb 2022 10:46:45 +0100 Subject: [PATCH] revert update to 3.4.6 --- COPYING | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ ccflagspatch | 12 +++++----- cryptlib.spec | 34 +++++++++++++--------------- gccversionpatch | 33 +++++++++++++++++++++++++++ javapatch | 6 ++--- perlpatch | 21 +++++++++++++++++ sources | 12 +++++----- threadpatch | 24 ++++++++++++++++++++ 8 files changed, 168 insertions(+), 34 deletions(-) create mode 100644 COPYING create mode 100644 gccversionpatch create mode 100644 perlpatch create mode 100644 threadpatch diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..efaaae9 --- /dev/null +++ b/COPYING @@ -0,0 +1,60 @@ +This file contains the usage terms for cryptlib. The full details of cryptlib +usage are provided on the cryptlib home page; although this file and the +information on the web page should be identical, in case of any dispute the +web page takes precedence. This file is included because some distributions +require the presence of a COPYING file. + +cryptlib is distributed under a dual license that allows free, open-source use +under a GPL-compatible license and closed-source use under a standard +commercial license. The GPL-compatible license (a.k.a. the Sleepycat license) +is given below. Further details on this license are available from the +cryptlib home page. + + Copyright 1992-2016 Peter Gutmann. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Redistributions in any form must be accompanied by information on how to + obtain complete source code for the cryptlib software and any accompanying + software that uses the cryptlib software. The source code must either be + included in the distribution or be available for no more than the cost of + distribution, and must be freely redistributable under reasonable + conditions. For an executable file, complete source code means the source + code for all modules it contains or uses. It does not include source code + for modules or files that typically accompany the major components of the + operating system on which the executable file runs. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO + EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +Note that decoupling the software from the user, for example by running in a +SaaS configuration, does not exempt you from these requirements. + +If you're unable to comply with the above license then the following, +alternate usage conditions apply: + + Any large-scale commercial use of cryptlib requires a license. "Large-scale + commercial use" means any revenue-generating purpose such as use for + company-internal purposes, or use of cryptlib in an application or product, + with a total gross revenue of over US$5,000. This allows cryptlib to be + used in freeware and shareware applications, for evaluation and research + purposes, and for non-revenue-generating or personal use without charge. In + addition the author reserves the right to grant free licenses for commercial + use in special cases (for example where there is a general benefit to the + public), contact the author for details if you think you qualify. diff --git a/ccflagspatch b/ccflagspatch index 5bed483..61352cd 100644 --- a/ccflagspatch +++ b/ccflagspatch @@ -1,11 +1,11 @@ ---- cl-original/makefile 2021-12-03 15:53:24.172492715 +0100 -+++ cl-patched/makefile 2021-12-03 15:54:55.914497971 +0100 -@@ -92,7 +92,7 @@ - # - # Standard build flags +--- cl-original/makefile 2019-03-10 11:50:35.325298573 +0100 ++++ cl-patched/makefile 2019-03-10 11:53:03.663407724 +0100 +@@ -90,7 +90,7 @@ + # Further cc flags are gathered dynamically at runtime via the ccopts.sh + # script. -CFLAGS = -c -D__UNIX__ -DNDEBUG -I. +CFLAGS = -c -D__UNIX__ -DNDEBUG -I. $(ADDFLAGS) CFLAGS_DEBUG = -c -D__UNIX__ -I. -g -O1 CFLAGS_DEBUGGCC = -c -D__UNIX__ -I. -ggdb3 -fno-omit-frame-pointer -O1 - + CFLAGS_ANALYSE = -c -D__UNIX__ -I. diff --git a/cryptlib.spec b/cryptlib.spec index a581c84..ddc8a41 100644 --- a/cryptlib.spec +++ b/cryptlib.spec @@ -4,14 +4,14 @@ %global withpython2 0 Name: cryptlib -Version: 3.4.6 -Release: 3%{?dist} +Version: 3.4.5 +Release: 21%{?dist} Summary: Security library and toolkit for encryption and authentication services License: Sleepycat and OpenSSL URL: https://www.cs.auckland.ac.nz/~pgut001/cryptlib -Source0: https://crypto-bone.com/fedora/cl346_fedora.zip -Source1: https://crypto-bone.com/fedora/cl346_fedora.zip.sig +Source0: https://crypto-bone.com/fedora/cl345_fedora.zip +Source1: https://crypto-bone.com/fedora/cl345_fedora.zip.sig # for security reasons a public signing key should always be stored in distgit # and never be used with a URL to make impersonation attacks harder # (verified: https://senderek.ie/keys/codesigningkey) @@ -21,9 +21,11 @@ Source4: https://crypto-bone.com/fedora/cryptlib-tests.tar.gz Source5: https://crypto-bone.com/fedora/cryptlib-perlfiles.tar.gz # soname is now libcl.so.3.4 -Patch1: flagspatch +Patch1: ccflagspatch Patch2: javapatch -Patch3: errorpatch +Patch3: perlpatch +Patch4: gccversionpatch +Patch5: threadpatch ExclusiveArch: x86_64 %{ix86} aarch64 ppc64 ppc64le @@ -143,6 +145,8 @@ cd %{name}-%{version} %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 # remove pre-build jar file rm %{_builddir}/%{name}-%{version}/bindings/cryptlib.jar @@ -165,7 +169,7 @@ cp /etc/alternatives/java_sdk/include/linux/jni_md.h . make clean make shared %{?_smp_mflags} ADDFLAGS="%{optflags}" -ln -s libcl.so.3.4.6 libcl.so +ln -s libcl.so.3.4.5 libcl.so ln -s libcl.so libcl.so.3.4 make stestlib %{?_smp_mflags} ADDFLAGS="%{optflags}" @@ -187,9 +191,9 @@ javadoc cryptlib mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_datadir}/licenses/%{name} mkdir -p %{buildroot}%{_docdir}/%{name} -cp %{_builddir}/%{name}-%{version}/libcl.so.3.4.6 %{buildroot}%{_libdir} +cp %{_builddir}/%{name}-%{version}/libcl.so.3.4.5 %{buildroot}%{_libdir} cd %{buildroot}%{_libdir} -ln -s libcl.so.3.4.6 libcl.so.3.4 +ln -s libcl.so.3.4.5 libcl.so.3.4 ln -s libcl.so.3.4 libcl.so # install header files @@ -257,7 +261,7 @@ tar xpzf %{SOURCE4} # in KOJI tests must be disabled as there is no networking %if %{includetests} cd %{_builddir}/%{name}-%{version} - ln -s libcl.so.3.4.6 ./libcl.so.3.4 + ln -s libcl.so.3.4.5 ./libcl.so.3.4 export LD_LIBRARY_PATH=. echo "Running tests on the cryptlib library. This will take a few minutes." echo "Network access is necessary to complete all tests!" @@ -270,7 +274,7 @@ tar xpzf %{SOURCE4} %files -%{_libdir}/libcl.so.3.4.6 +%{_libdir}/libcl.so.3.4.5 %{_libdir}/libcl.so.3.4 %{_libdir}/libcl.so @@ -309,15 +313,9 @@ tar xpzf %{SOURCE4} %changelog -* Sat Feb 05 2022 Jiri Vanek - 3.4.6-3 +* Fri Feb 11 2022 Ralf Senderek <>innovation@senderek.ie - 3.4.5-21 - Rebuilt for java-17-openjdk as system jdk -* Tue Feb 01 2022 Ralf Senderek - 3.4.6-2 -- 3.4.6 with flagspatch - -* Sun Jan 30 2022 Ralf Senderek - 3.4.6-1 -- update SCM to version 3.4.6, new test-files - * Thu Jan 20 2022 Fedora Release Engineering - 3.4.5-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/gccversionpatch b/gccversionpatch new file mode 100644 index 0000000..4d97861 --- /dev/null +++ b/gccversionpatch @@ -0,0 +1,33 @@ +--- cl-original/tools/ccopts.sh 2019-11-23 17:03:39.315504598 +0100 ++++ cl-testpatch/tools/ccopts.sh 2020-01-22 18:49:01.093189548 +0100 +@@ -508,10 +508,17 @@ + # apparent version less than 10 we add a trailing zero to the string to make + # the checks that follow work. + +-GCC_VER="$($CC -dumpversion | tr -d '.' | cut -c 1-2)" +-if [ "$GCC_VER" -lt 10 ] ; then +- GCC_VER="${GCC_VER}0" ; +-fi ++GCC_VER="$($CC -dumpversion)" ++case $GCC_VER in ++ [0-9]) ++ GCC_VER="${GCC_VER}0" ;; ++ ++ [0-9][0-9]*) ++ GCC_VER="$(echo $GCC_VER | tr -d '.' | cut -c 1-3)" ;; ++ ++ *) ++ GCC_VER="$(echo $GCC_VER | tr -d '.' | cut -c 1-2)" ;; ++esac + + # Try and determine the CPU type. This is made more complex by a pile of + # *BSE's which, along with antideluvian tools like an as that doesn't +@@ -606,7 +613,7 @@ + CCARGS="$CCARGS -march=pentium" ;; + esac ; + else +- CCARGS="$CCARGS -mcpu=pentium" ; ++ CCARGS="$CCARGS -march=native" ; + fi ; + fi + diff --git a/javapatch b/javapatch index 7d5f510..866fa2b 100644 --- a/javapatch +++ b/javapatch @@ -1,6 +1,6 @@ ---- cl-original/misc/config.h 2021-12-03 16:43:09.959891808 +0100 -+++ cl-patched/misc/config.h 2021-12-03 16:44:07.248896490 +0100 -@@ -218,7 +218,7 @@ +--- cl-original/misc/config.h 2019-03-10 11:50:06.827085487 +0100 ++++ cl-patched/misc/config.h 2019-03-10 11:51:27.444688279 +0100 +@@ -163,7 +163,7 @@ /* Whether to build the Java/JNI interface or not */ diff --git a/perlpatch b/perlpatch new file mode 100644 index 0000000..8c166ce --- /dev/null +++ b/perlpatch @@ -0,0 +1,21 @@ +--- cl-original/bindings/PerlCryptLib.xs 2019-03-10 08:45:35.962108583 -0400 ++++ cl-patched/bindings/PerlCryptLib.xs 2019-03-10 08:46:27.133451822 -0400 +@@ -594,18 +594,3 @@ + OUTPUT: + RETVAL + +-# Add deprecated functions when CRYPTLIB_VERSION prior 3.4.0 +-#if CRYPTLIB_VERSION < 3400 +- +-int cryptAsyncCancel(cryptObject) +- const int cryptObject; +- +- +-int cryptAsyncQuery(cryptObject) +- const int cryptObject; +- +- +-int cryptGenerateKeyAsync(cryptContext) +- const int cryptContext; +- +-#endif diff --git a/sources b/sources index 0d5bbca..1ae6d4f 100644 --- a/sources +++ b/sources @@ -1,7 +1,5 @@ -SHA512 (cl346_fedora.zip) = a6149c91ce262f5aed253e0e1de297f690b5ecfa194c06fe4a68d233a450666bce3ca51473fbe17b88aa6fede058ec9b91b6cf7378c7b192de312a503cbd7a93 -SHA512 (cl346_fedora.zip.sig) = 64e66b074823eeb42d2bdaa6d7136c2b3100aede2575a86ceb2257f3859511f2e1d57c3a9cfdc4e96ccc28ef0de66798bae31c51dc582dc9aa528e3d5a33b7f6 -SHA512 (flagspatch) = 2256cc51dc690ca28ba29958907f3ed8da955fbb3d51bd1ffc85e99d75e68d55e3777cf50b68c91065a42f3b85eb647a3db22c45c1f2d4d4499ed3b44cf669de -SHA512 (javapatch) = 3b433c11db09d5e815fd99a47c85df35b5da18dedfb11ca2a654c97017a50925e5b231785b18bc659534cefbbee7f4d6b9b5fe83cdbbf8edb18f3f2997168750 -SHA512 (errorpatch) = d12a95021b8ad48f75a3e6f2f0a7b8607ec5fcb6d93a69c7fd0d5181262b588be52865426b86b1e7035e90ec6f3d13c51acc381bab4c12116fcf12657d1a804c -SHA512 (cryptlib-tests.tar.gz) = 25f3cc41fd5fa1e8a3f1c800b86039cb960249c98a16243f7aef1af9ec1747cbc11b18a0d7b5c059a61c5247b45f290f84f3a4a11fc3257cb895607940e05c93 -SHA512 (cryptlib.spec) = 3e65af499091b5d3d7cd045f51473c5f77987259e33fd28e951df0cd1cdefdbc0eb73c43dddb453d0dd438d991700fbfd17dd91674f83f0cafd2afd5fc67c47b +SHA512 (cl345_fedora.zip) = 8eaa68752496ce5915b56e7d97434a6e8efcf458a83fdc7ef6b5dd23039fd5445b7b468c0b23e2d6482d5df625f78e12580ca7d09b9edf1839b53e8468f055bb +SHA512 (cl345_fedora.zip.sig) = 7f5be2253500f2984edd00d31156cc98878b5b96a4217386ce60b02232f7a4fd00be788c5dbe05d6490e5bc17eba349ca738be4fc7cb286f9eb909f3a957e92e +SHA512 (cryptlib-tests.tar.gz) = c798f775c846861f23ed22cdff8b4a38060087f795c01d829bddaa26470a287f38638b5c72cc76074e0218c5e78ccc7553094fd2bd9a0d1f0eefa499c850b80b +SHA512 (cryptlib-perlfiles.tar.gz) = b975d34acfd1d99a224bbd5536483e5489feac8801a567740ec668bcef9a1eff67fddbdad53f61b2ff48bd43396e92f070ebf4de622f3edeb70428f4aaae2ff6 +SHA512 (threadpatch) = d6dc99373ccb8bdfcbf2ca6a84229767ee7733455c3e2ee5d7301c3828dd2376057b7d0ad0dbab938ee3b042bcb97ac4aa80d4292ad663edfbf1033eb62b73b4 diff --git a/threadpatch b/threadpatch new file mode 100644 index 0000000..422bafe --- /dev/null +++ b/threadpatch @@ -0,0 +1,24 @@ +--- cl-original/kernel/thread.h 2021-06-24 14:55:26.169597780 +0200 ++++ cl-patched/kernel/thread.h 2021-06-24 14:58:02.485568178 +0200 +@@ -2979,6 +2979,8 @@ + "Posix is portable in the sense that you can use a forklift to move the + printed volumes around" */ + ++#include ++ + #define THREADFUNC_DEFINE( name, arg ) void *name( void *arg ) + #define THREAD_CREATE( function, arg, threadHandle, syncHandle, status ) \ + { \ +@@ -3016,7 +3018,11 @@ + #if defined( __linux__ ) && !defined( __USE_GNU ) + void pthread_yield( void ); + #endif /* Present but not prototyped unless GNU extensions are enabled */ +- #define THREAD_YIELD() pthread_yield() ++ ++ #if defined( __linux__ ) && ( OSVERSION > 3 ) ++ #define THREAD_YIELD() sched_yield() ++ #endif ++ + #endif /* Not-very-portable Posix portability */ + #define THREAD_SLEEP( ms ) { \ + struct timeval tv = { 0 }; \