From e49d368d5d2de1466284e818d1f949bfdf45e257 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sat, 10 May 2014 16:16:59 +0200 Subject: [PATCH 1/2] Add patch to fix prime testing. --- botan-1.8.14-fix_prime_testing.patch | 14 ++++++++++++++ botan.spec | 9 ++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 botan-1.8.14-fix_prime_testing.patch diff --git a/botan-1.8.14-fix_prime_testing.patch b/botan-1.8.14-fix_prime_testing.patch new file mode 100644 index 0000000..5698c6a --- /dev/null +++ b/botan-1.8.14-fix_prime_testing.patch @@ -0,0 +1,14 @@ +============================================================ +--- src/math/numbertheory/numthry.cpp e810b1dace1f2f07c3fceabddb59844a8807d58f ++++ src/math/numbertheory/numthry.cpp 03df310d0075893ff7b86ca57867fa0f0293c22e +@@ -285,9 +285,9 @@ bool passes_mr_tests(RandomNumberGenerat + + u32bit tests = miller_rabin_test_iterations(n.bits(), verify); + +- BigInt nonce; + for(u32bit i = 0; i != tests; ++i) + { ++ BigInt nonce; + if(!verify && PRIMES[i] < (n-1)) + nonce = PRIMES[i]; + else diff --git a/botan.spec b/botan.spec index 152464a..bb6be7e 100644 --- a/botan.spec +++ b/botan.spec @@ -1,6 +1,6 @@ Name: botan Version: 1.8.14 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Crypto library written in C++ Group: System Environment/Libraries @@ -12,6 +12,9 @@ Source0: Botan-%{version}.stripped.tbz Source1: README.fedora # soname was changed unintentionally upstream, revert it. Patch0: botan-1.8.14-soname.patch +# patch to fix prime testing, see also +# http://botan.randombit.net/relnotes/1_10_8.html +Patch1: botan-1.8.14-fix_prime_testing.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gcc-c++ @@ -51,6 +54,7 @@ developing applications that use %{name}. %prep %setup -q -n Botan-%{version} %patch0 -p0 +%patch1 -p0 cp -av %{SOURCE1} . %build @@ -122,6 +126,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./check --validate %changelog +* Sat May 10 2014 Thomas Moschny - 1.8.14-3 +- Add patch to fix prime testing. + * Wed Feb 13 2013 Fedora Release Engineering - 1.8.14-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild From f47d9511a5e59e747f4adf815de403abb821df41 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 4 Jun 2014 18:55:32 +0200 Subject: [PATCH 2/2] Update to 1.10.8, based on the current rawhide spec file, also containing these changes: - Added ppc64le arch support (Brent Baude ) - Added AArch64 arch support (Marcin Juszkiewicz , Peter Robinson ) - Re-enable IDEA (rhbz#1003052) and SRP-6 Modernize spec file New - -doc subpackage containing HTML documentation Package Python - binding --- .gitignore | 2 + README.fedora | 19 ++--- botan-1.10-add-ppc64le.patch | 50 ++++++++++++ botan-1.8.14-fix_prime_testing.patch | 14 ---- botan-1.8.14-soname.patch | 19 ----- botan-aarch64.patch | 21 ++++++ botan.spec | 109 ++++++++++++++++++++------- repack.sh | 18 ++--- sources | 2 +- 9 files changed, 172 insertions(+), 82 deletions(-) create mode 100644 botan-1.10-add-ppc64le.patch delete mode 100644 botan-1.8.14-fix_prime_testing.patch delete mode 100644 botan-1.8.14-soname.patch create mode 100644 botan-aarch64.patch diff --git a/.gitignore b/.gitignore index c755cb4..c7a054a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ /Botan-1.8.12.stripped.tbz /Botan-1.8.13.stripped.tbz /Botan-1.8.14.stripped.tbz +/Botan-1.10.5.stripped.tbz +/Botan-1.10.8.stripped.tbz diff --git a/README.fedora b/README.fedora index f3b8795..038f1bf 100644 --- a/README.fedora +++ b/README.fedora @@ -1,14 +1,11 @@ For legal reasons, the following modules have been completely removed from the Botan package in Fedora: - * Block Ciphers - * IDEA [src/block/idea] - * RC6 [src/block/rc6] - * RC5 [src/block/rc5] - * Public Key Base - * ECC Public Key [src/pubkey/ecc_key] - * ECC Domain Parameters [src/pubkey/ec_dompar] - * ECDSA [src/pubkey/ecdsa] - * ECKAEG [src/pubkey/eckaeg] - * Math - * GF(p) Math [src/math/gfpmath] +* RC5 Block Cipher [src/block/rc5] +* RC6 Block Cipher [src/block/rc6] +* GF(p) Math [src/math/ec_gfp] +* ECC Domain Parameters [src/pubkey/ec_group] +* ECC Public Key [src/pubkey/ecc_key] +* ECDH [src/pubkey/ecdh] +* ECDSA [src/pubkey/ecdsa] +* GOST 34.10 [src/pubkey/gost_3410] diff --git a/botan-1.10-add-ppc64le.patch b/botan-1.10-add-ppc64le.patch new file mode 100644 index 0000000..05794cd --- /dev/null +++ b/botan-1.10-add-ppc64le.patch @@ -0,0 +1,50 @@ +diff -Naur Botan-1.10.8.orig/src/build-data/arch/ppc64le.txt Botan-1.10.8/src/build-data/arch/ppc64le.txt +--- Botan-1.10.8.orig/src/build-data/arch/ppc64le.txt 1969-12-31 18:00:00.000000000 -0600 ++++ Botan-1.10.8/src/build-data/arch/ppc64le.txt 2014-05-25 12:59:22.030001491 -0500 +@@ -0,0 +1,16 @@ ++ ++endian little ++family ppc64le ++ ++ ++ppc64el # For Debian ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -Naur Botan-1.10.8.orig/src/build-data/cc/gcc.txt Botan-1.10.8/src/build-data/cc/gcc.txt +--- Botan-1.10.8.orig/src/build-data/cc/gcc.txt 2014-05-25 12:44:19.580001491 -0500 ++++ Botan-1.10.8/src/build-data/cc/gcc.txt 2014-05-25 12:55:57.750001491 -0500 +@@ -83,6 +83,7 @@ + mips64 -> "-mips3 -mcpu=SUBMODEL" mips64- + ppc32 -> "-mcpu=SUBMODEL" ppc + ppc64 -> "-mcpu=SUBMODEL" ppc ++ppc64le -> "-mcpu=SUBMODEL" + sparc32 -> "-mcpu=SUBMODEL -Wa,-xarch=v8plus" sparc32- + sparc64 -> "-mcpu=v9 -mtune=SUBMODEL" + x86_32 -> "-march=SUBMODEL -momit-leaf-frame-pointer" +@@ -98,6 +99,7 @@ + sparc32 -> "-m32 -mno-app-regs" + sparc64 -> "-m64 -mno-app-regs" + ppc64 -> "-m64" ++ppc64le -> "-m64" + + # This should probably be used on most/all targets, but the docs are unclear + openbsd -> "-pthread" +diff -Naur Botan-1.10.8.orig/src/math/mp/mp_asm64/info.txt Botan-1.10.8/src/math/mp/mp_asm64/info.txt +--- Botan-1.10.8.orig/src/math/mp/mp_asm64/info.txt 2014-05-25 12:44:19.620001491 -0500 ++++ Botan-1.10.8/src/math/mp/mp_asm64/info.txt 2014-05-25 12:45:01.580001491 -0500 +@@ -13,6 +13,7 @@ + mips64 + ppc64 + sparc64 ++ppc64le + + + # The inline asm only works with gcc, but it looks like (at least on diff --git a/botan-1.8.14-fix_prime_testing.patch b/botan-1.8.14-fix_prime_testing.patch deleted file mode 100644 index 5698c6a..0000000 --- a/botan-1.8.14-fix_prime_testing.patch +++ /dev/null @@ -1,14 +0,0 @@ -============================================================ ---- src/math/numbertheory/numthry.cpp e810b1dace1f2f07c3fceabddb59844a8807d58f -+++ src/math/numbertheory/numthry.cpp 03df310d0075893ff7b86ca57867fa0f0293c22e -@@ -285,9 +285,9 @@ bool passes_mr_tests(RandomNumberGenerat - - u32bit tests = miller_rabin_test_iterations(n.bits(), verify); - -- BigInt nonce; - for(u32bit i = 0; i != tests; ++i) - { -+ BigInt nonce; - if(!verify && PRIMES[i] < (n-1)) - nonce = PRIMES[i]; - else diff --git a/botan-1.8.14-soname.patch b/botan-1.8.14-soname.patch deleted file mode 100644 index 6976728..0000000 --- a/botan-1.8.14-soname.patch +++ /dev/null @@ -1,19 +0,0 @@ -# -# old_revision [adcf24b7e258c125f78aaff4ef2d3557f1183c3e] -# -# patch "configure.py" -# from [b43917e0e74e7ef1ff0024542da0dabe104a1582] -# to [ba82e657a585f31e9ba20056a57c5f597c0f0297] -# -============================================================ ---- configure.py b43917e0e74e7ef1ff0024542da0dabe104a1582 -+++ configure.py ba82e657a585f31e9ba20056a57c5f597c0f0297 -@@ -38,7 +38,7 @@ class BuildConfigurationInformation(obje - version_major = 1 - version_minor = 8 - version_patch = 14 -- version_so_patch = 13 -+ version_so_patch = 2 - version_suffix = '' - - version_string = '%d.%d.%d%s' % ( diff --git a/botan-aarch64.patch b/botan-aarch64.patch new file mode 100644 index 0000000..ffb6888 --- /dev/null +++ b/botan-aarch64.patch @@ -0,0 +1,21 @@ +Index: Botan-1.10.8/src/build-data/arch/aarch64.txt +=================================================================== +--- /dev/null ++++ Botan-1.10.8/src/build-data/arch/aarch64.txt +@@ -0,0 +1,16 @@ ++ ++endian little ++family aarch64 ++ ++ ++arm64 # For Debian ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ diff --git a/botan.spec b/botan.spec index bb6be7e..35c3257 100644 --- a/botan.spec +++ b/botan.spec @@ -1,6 +1,8 @@ +%global major_version 1.10 + Name: botan -Version: 1.8.14 -Release: 3%{?dist} +Version: %{major_version}.8 +Release: 5%{?dist} Summary: Crypto library written in C++ Group: System Environment/Libraries @@ -10,21 +12,22 @@ URL: http://botan.randombit.net/ # here: http://files.randombit.net/botan/Botan-%%{version}.tbz Source0: Botan-%{version}.stripped.tbz Source1: README.fedora -# soname was changed unintentionally upstream, revert it. -Patch0: botan-1.8.14-soname.patch -# patch to fix prime testing, see also -# http://botan.randombit.net/relnotes/1_10_8.html -Patch1: botan-1.8.14-fix_prime_testing.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: botan-aarch64.patch +Patch1: botan-1.10-add-ppc64le.patch BuildRequires: gcc-c++ BuildRequires: python +BuildRequires: python-sphinx +BuildRequires: python-devel +BuildRequires: boost-python-devel BuildRequires: bzip2-devel BuildRequires: zlib-devel BuildRequires: gmp-devel BuildRequires: openssl-devel +# do not check .so files in the python_sitelib directory +%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$ %description Botan is a BSD-licensed crypto library written in C++. It provides a @@ -38,25 +41,49 @@ flavor of the library. %package devel Summary: Development files for %{name} Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pkgconfig Requires: bzip2-devel Requires: zlib-devel Requires: gmp-devel Requires: openssl-devel - %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. +%package doc +Summary: Documentation for %{name} +Group: Documentation +BuildArch: noarch + +%description doc +%{summary} + +This package contains HTML documentation for %{name}. + + +%package python +Summary: Python bindings for %{name} +Group: System Environment/Libraries + +%description python +%{summary} + +This package contains the Python binding for %{name}. + +Note: The Python binding should be considered alpha software, and the +interfaces may change in the future. + + %prep %setup -q -n Botan-%{version} -%patch0 -p0 -%patch1 -p0 +%patch0 -p1 +%patch1 -p1 cp -av %{SOURCE1} . + %build # we have the necessary prerequisites, so enable optional modules %define enable_modules gnump,bzip2,zlib,openssl @@ -71,23 +98,31 @@ cp -av %{SOURCE1} . --os=linux \ --cpu=%{_arch} \ --enable-modules=%{enable_modules} \ - --disable-modules=%{disable_modules} + --disable-modules=%{disable_modules} \ + --with-boost-python \ + --with-python-version=%{python_version} # (ab)using CXX as an easy way to inject our CXXFLAGS make CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} +make -f Makefile.python \ + CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} %install -rm -rf %{buildroot} make install \ DESTDIR=%{buildroot}%{_prefix} \ DOCDIR=_doc \ INSTALL_CMD_EXEC="install -p -m 755" \ - INSTALL_CMD_DATA="install -p -m 644" \ + INSTALL_CMD_DATA="install -p -m 644" +make -f Makefile.python install \ + PYTHON_SITE_PACKAGE_DIR=%{buildroot}%{python_sitearch} -%clean -rm -rf %{buildroot} +# fixups +find doc/examples -type f -exec chmod -x {} \; +mv doc/examples/python doc/python-examples +rm _doc/manual/.buildinfo +rm -r _doc/manual/.doctrees %post -p /sbin/ldconfig @@ -97,22 +132,30 @@ rm -rf %{buildroot} %files -%defattr(-,root,root,-) -%{_libdir}/libbotan*-*.so -%doc _doc/readme.txt _doc/log.txt _doc/thanks.txt _doc/credits.txt -%doc _doc/license.txt _doc/fips140.tex _doc/pgpkeys.asc +%doc _doc/readme.txt +%doc doc/license.txt %doc README.fedora +%{_libdir}/libbotan-%{major_version}.so.* %files devel -%defattr(-,root,root,-) %doc doc/examples -%doc _doc/api* _doc/tutorial* -%{_bindir}/botan-config +%{_bindir}/botan-config-%{major_version} %{_includedir}/* -%exclude %{_libdir}/libbotan.a -%{_libdir}/libbotan.so -%{_libdir}/pkgconfig/botan-1.8.pc +%exclude %{_libdir}/libbotan-%{major_version}.a +%{_libdir}/libbotan-%{major_version}.so +%{_libdir}/pkgconfig/botan-%{major_version}.pc + + +%files doc +%doc _doc/manual +%doc _doc/readme.txt +%doc doc/license.txt + + +%files python +%doc doc/python-examples +%{python_sitearch}/%{name} %check @@ -120,12 +163,22 @@ make CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags} check # these checks would fail mv checks/validate.dat{,.orig} -awk '/\[.*\]/{f=0} /\[(RC5.*|RC6|IDEA)\]/{f=1} (f && !/^#/){sub(/^/,"#")} {print}' \ +awk '/\[.*\]/{f=0} /\[(RC5.*|RC6)\]/{f=1} (f && !/^#/){sub(/^/,"#")} {print}' \ checks/validate.dat.orig > checks/validate.dat LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./check --validate %changelog +* Wed Jun 4 2014 Thomas Moschny - 1.10.8-5 +- Update to 1.10.8, based on the current rawhide spec file, also + containing these changes: + - Added ppc64le arch support (Brent Baude ) + - Added AArch64 arch support (Marcin Juszkiewicz + , Peter Robinson ) + - Re-enable IDEA (rhbz#1003052) and SRP-6 Modernize spec file New + - -doc subpackage containing HTML documentation Package Python + - binding + * Sat May 10 2014 Thomas Moschny - 1.8.14-3 - Add patch to fix prime testing. diff --git a/repack.sh b/repack.sh index 9bd4162..9f40365 100755 --- a/repack.sh +++ b/repack.sh @@ -1,6 +1,6 @@ #! /bin/bash -version=1.8.14 +version=1.10.8 name=Botan-${version} suffix=.tbz newsuffix=.stripped.tbz @@ -11,13 +11,13 @@ tmpfile=$(mktemp) ${compr} -cd ${name}${suffix} > ${tmpfile} -tar --delete --file=${tmpfile} ./Botan-${version}/src/block/idea -tar --delete --file=${tmpfile} ./Botan-${version}/src/block/rc6 -tar --delete --file=${tmpfile} ./Botan-${version}/src/block/rc5 -tar --delete --file=${tmpfile} ./Botan-${version}/src/math/gfpmath -tar --delete --file=${tmpfile} ./Botan-${version}/src/pubkey/ec_dompar -tar --delete --file=${tmpfile} ./Botan-${version}/src/pubkey/ecc_key -tar --delete --file=${tmpfile} ./Botan-${version}/src/pubkey/ecdsa -tar --delete --file=${tmpfile} ./Botan-${version}/src/pubkey/eckaeg +tar --delete --file=${tmpfile} Botan-${version}/src/block/rc6 +tar --delete --file=${tmpfile} Botan-${version}/src/block/rc5 +tar --delete --file=${tmpfile} Botan-${version}/src/math/ec_gfp +tar --delete --file=${tmpfile} Botan-${version}/src/pubkey/ecc_key +tar --delete --file=${tmpfile} Botan-${version}/src/pubkey/ecdh +tar --delete --file=${tmpfile} Botan-${version}/src/pubkey/ecdsa +tar --delete --file=${tmpfile} Botan-${version}/src/pubkey/ec_group +tar --delete --file=${tmpfile} Botan-${version}/src/pubkey/gost_3410 ${compr} -c ${tmpfile} > ${name}${newsuffix} diff --git a/sources b/sources index 219b46d..89d7334 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4b5ce78b1cfc0735eb7ec4f6903068ca Botan-1.8.14.stripped.tbz +c7ebfad55bdfe0089e6201d11b0faa75 Botan-1.10.8.stripped.tbz