epel9
Simone Caronni 9 years ago
parent 85c66e7b15
commit 20358c51c4

1
.gitignore vendored

@ -1 +1,2 @@
crypt-1.17.tar.bz2
/libtomcrypt-912eff4.tar.gz

@ -1,17 +0,0 @@
--- libtomcrypt-1.17.orig/makefile.shared 2007-05-12 08:46:25.000000000 -0600
+++ libtomcrypt-1.17/makefile.shared 2007-06-27 21:56:29.000000000 -0600
@@ -29,10 +29,12 @@
ifndef IGNORE_SPEED
# optimize for SPEED
-CFLAGS += -O3 -funroll-loops
+# removed for building in Fedora
+#CFLAGS += -O3 -funroll-loops
# add -fomit-frame-pointer. hinders debugging!
-CFLAGS += -fomit-frame-pointer
+# removed for building in Fedora
+#CFLAGS += -fomit-frame-pointer
# optimize for SIZE
#CFLAGS += -Os -DLTC_SMALL_CODE

@ -1,34 +0,0 @@
--- libtomcrypt-1.17.orig/makefile.shared
+++ libtomcrypt-1.17/makefile.shared
@@ -248,15 +248,16 @@
objs: $(OBJECTS)
-$(LIBNAME): $(OBJECTS) testprof/$(LIBTEST)
+$(LIBNAME): $(OBJECTS)
libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
install: $(LIBNAME)
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
- cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install
libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
+ install -d $(DESTDIR)$(LIBPATH)/pkgconfig
+ install -m 0644 -g $(GROUP) -o $(USER) libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
#This rule makes the hash program included with libtomcrypt
hashsum: library
--- libtomcrypt-1.17.orig/libtomcrypt.pc
+++ libtomcrypt-1.17/libtomcrypt.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: LibTomCrypt
+Description: public domain open source cryptographic toolkit
+Version: 1.17
+Libs: -L${libdir} -ltomcrypt
+Cflags: -I${includedir}

@ -1,53 +0,0 @@
From 445dfa67a64dcd30067dab823f6bae31d1019c1e Mon Sep 17 00:00:00 2001
From: Paul Howarth <paul@city-fan.org>
Date: Tue, 15 Apr 2014 11:25:18 +0100
Subject: [PATCH] des.c: Add support for two-key Triple-DES
Add two-key 3DES support, needed by pycrypto.
This commit is based on the one for the bundled libtomcrypt 1.16
code in pycrypto:
https://github.com/dlitz/pycrypto/commit/65085f16
---
src/ciphers/des.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/ciphers/des.c b/src/ciphers/des.c
index af3a4d0..0034c80 100644
--- a/src/ciphers/des.c
+++ b/src/ciphers/des.c
@@ -1562,17 +1562,27 @@ int des3_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_k
return CRYPT_INVALID_ROUNDS;
}
- if (keylen != 24) {
+ if (keylen != 24 && keylen != 16) {
return CRYPT_INVALID_KEYSIZE;
}
deskey(key, EN0, skey->des3.ek[0]);
deskey(key+8, DE1, skey->des3.ek[1]);
- deskey(key+16, EN0, skey->des3.ek[2]);
+ if (keylen == 24) {
+ deskey(key+16, EN0, skey->des3.ek[2]);
+ } else {
+ /* two-key 3DES: K3=K1 */
+ deskey(key, EN0, skey->des3.ek[2]);
+ }
deskey(key, DE1, skey->des3.dk[2]);
deskey(key+8, EN0, skey->des3.dk[1]);
- deskey(key+16, DE1, skey->des3.dk[0]);
+ if (keylen == 24) {
+ deskey(key+16, DE1, skey->des3.dk[0]);
+ } else {
+ /* two-key 3DES: K3=K1 */
+ deskey(key, DE1, skey->des3.dk[0]);
+ }
return CRYPT_OK;
}
--
1.9.0

@ -1,17 +1,17 @@
%global commit0 912eff4949f46c0b426d2180429a6fa4c1144f1d
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Name: libtomcrypt
Version: 1.17
Release: 26%{?dist}
Release: 27%{?dist}
Summary: A comprehensive, portable cryptographic toolkit
License: Public Domain
URL: http://www.libtom.org/?page=features&newsitems=5&whatfile=crypt
Source0: http://www.libtom.org/files/crypt-%{version}.tar.bz2
Patch0: %{name}-makefile.patch
Patch1: %{name}-pkgconfig.patch
Patch2: %{name}-two-key-triple-des.patch
URL: http://www.libtom.org/
Source0: https://github.com/libtom/%{name}/archive/%{commit0}/%{name}-%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz
BuildRequires: ghostscript
BuildRequires: libtommath-devel >= 0.42.0-3
BuildRequires: libtommath-devel >= 1.0
BuildRequires: libtool
%if 0%{?fedora} || 0%{?rhel} >= 7
@ -22,7 +22,7 @@ BuildRequires: tetex-dvips
BuildRequires: tetex-latex
%endif
Requires: libtommath >= 0.42.0
#Requires: libtommath >= 1.0
%description
A comprehensive, modular and portable cryptographic toolkit that provides
@ -54,20 +54,26 @@ Obsoletes: %{name}-doc < 1.17-19
The %{name}-doc package contains documentation for use with %{name}.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%setup -qn %{name}-%{commit0}
# Be verbose when calling latex so we can see what's breaking
sed -i -e 's|> /dev/null||g' makefile
# Latex syntax update
sed -i \
-e 's|\[here\]|\[ht\]|g' \
-e 's|\[here!\]|\[h!\]|g' \
-e 's|\[!here\]|\[!ht\]|g' \
*.{pl,tex}
# Remove spurious permissions
find . -name '*.c' -exec chmod 644 {} \;
%build
# No configure script ships with libtomcrypt. Its only requirement is ANSI C and
# libtommath. Explicitly force it to be built against libtommath.
export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC"
export CFLAGS="%{optflags} -DLTM_DESC"
make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared
make %{?_smp_mflags} LIBPATH=%{_libdir} -f makefile docs
make LIBPATH=%{_libdir} -f makefile docs
%check
export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -DUSE_LTM"
export CFLAGS="%{optflags} -DLTM_DESC -DUSE_LTM"
make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" test
./test
@ -77,24 +83,23 @@ make %{?_smp_mflags} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" test
# INSTALL_GROUP environment variables.
export INSTALL_USER=$(id -un)
export INSTALL_GROUP=$(id -gn)
export CFLAGS="$RPM_OPT_FLAGS -DLTM_DESC -DUSE_LTM"
make install DESTDIR=%{buildroot} LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared
find %{buildroot} -name '*.h' -exec chmod 644 {} \;
find %{buildroot} -name '*.c' -exec chmod 644 {} \;
chmod 644 LICENSE
export CFLAGS="%{optflags} -DLTM_DESC -DUSE_LTM"
%make_install LIBPATH=%{_libdir} EXTRALIBS="-ltommath" -f makefile.shared
# Remove unneeded files
find %{buildroot} -name '*.la' -delete
find %{buildroot} -name '*.a' -delete
find %{buildroot} -name 'libtomcrypt_prof*' -delete
# Remove spurious permissions
find %{buildroot} -name '*.h' -exec chmod 644 {} \;
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc LICENSE
%{!?_licensedir:%global license %%doc}
%license LICENSE
%{_libdir}/*.so.*
%files devel
@ -103,9 +108,15 @@ find %{buildroot} -name 'libtomcrypt_prof*' -delete
%{_libdir}/pkgconfig/libtomcrypt.pc
%files doc
%doc LICENSE doc/crypt.pdf
%doc doc/crypt.pdf
%changelog
* Tue Feb 23 2016 Simone Caronni <negativo17@gmail.com> - 1.17-27
- Fix FTBFS (#1307740); requires libtommath 1.x.
- Update URL.
- Use license macro.
- Clean up SPEC file.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.17-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

@ -1 +1 @@
cea7e5347979909f458fe7ebb5a44f85 crypt-1.17.tar.bz2
e3188afd7a3719427d81db92665d4efb libtomcrypt-912eff4.tar.gz

Loading…
Cancel
Save