diff options
author | thierry <thierry@FreeBSD.org> | 2004-04-11 07:16:07 +0800 |
---|---|---|
committer | thierry <thierry@FreeBSD.org> | 2004-04-11 07:16:07 +0800 |
commit | 185e92021db914290dc5a11453f97c52916af474 (patch) | |
tree | 3bd442b408cd61b0284ea08dec3caed652f64409 /security | |
parent | e2073cc7352e0a345c844f8dac5c951e32f7100f (diff) | |
download | freebsd-ports-gnome-185e92021db914290dc5a11453f97c52916af474.tar.gz freebsd-ports-gnome-185e92021db914290dc5a11453f97c52916af474.tar.zst freebsd-ports-gnome-185e92021db914290dc5a11453f97c52916af474.zip |
Add libtomcrypt 0.92, comprehensive, modular and portable
cryptographic toolkit.
PR: 62581
Submitted by: Yonatan <Yonatan@Xpert.com>
Approved by: pav (mentor).
Diffstat (limited to 'security')
-rw-r--r-- | security/Makefile | 1 | ||||
-rw-r--r-- | security/libtomcrypt/Makefile | 35 | ||||
-rw-r--r-- | security/libtomcrypt/distinfo | 2 | ||||
-rw-r--r-- | security/libtomcrypt/files/patch-dsa.c | 88 | ||||
-rw-r--r-- | security/libtomcrypt/files/patch-makefile | 50 | ||||
-rw-r--r-- | security/libtomcrypt/pkg-descr | 5 | ||||
-rw-r--r-- | security/libtomcrypt/pkg-plist | 37 |
7 files changed, 218 insertions, 0 deletions
diff --git a/security/Makefile b/security/Makefile index f6d3efd0fafa..40aa52786b51 100644 --- a/security/Makefile +++ b/security/Makefile @@ -166,6 +166,7 @@ SUBDIR += libprelude SUBDIR += libsectok SUBDIR += libtasn1 + SUBDIR += libtomcrypt SUBDIR += libwhisker SUBDIR += liedentd SUBDIR += linux-pam-docs diff --git a/security/libtomcrypt/Makefile b/security/libtomcrypt/Makefile new file mode 100644 index 000000000000..8b01a2583ae4 --- /dev/null +++ b/security/libtomcrypt/Makefile @@ -0,0 +1,35 @@ +# Ports collection makefile for: libtomcrypt +# Date created: 22 Jan 2004 +# Whom: Yonatan <Yonatan@Xpert.com> +# +# $FreeBSD$ +# + +PORTNAME= libtomcrypt +PORTVERSION= 0.92 +CATEGORIES= security +MASTER_SITES= http://libtomcrypt.org/files/ +DISTNAME= crypt-${PORTVERSION} + +MAINTAINER= Yonatan@xpert.com +COMMENT= Comprehensive, modular and portable cryptographic toolkit + +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} +MAKEFILE= makefile +MAKE_ENV= PREFIX=${PREFIX} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} +USE_BZIP2= yes +ALL_TARGET= library + +.if defined(WITH_DOCS) +BUILD_DEPENDS+= latex:${PORTSDIR}/print/teTeX +.else +NOPORTDOCS= yes +INSTALL_TARGET= install-nodocs +.endif + +.if defined(MAINTAINER_MODE) +test: build + (cd ${WRKSRC} && ${MAKE} test && ${WRKSRC}/test) +.endif + +.include <bsd.port.mk> diff --git a/security/libtomcrypt/distinfo b/security/libtomcrypt/distinfo new file mode 100644 index 000000000000..cbf228b476ea --- /dev/null +++ b/security/libtomcrypt/distinfo @@ -0,0 +1,2 @@ +MD5 (crypt-0.92.tar.bz2) = 12fd407c6678e072446323aaf41c0719 +SIZE (crypt-0.92.tar.bz2) = 783233 diff --git a/security/libtomcrypt/files/patch-dsa.c b/security/libtomcrypt/files/patch-dsa.c new file mode 100644 index 000000000000..3ff2d8d0a48e --- /dev/null +++ b/security/libtomcrypt/files/patch-dsa.c @@ -0,0 +1,88 @@ +--- dsa.c.orig Tue Jan 13 14:52:15 2004 ++++ dsa.c Tue Jan 13 14:53:54 2004 +@@ -297,15 +297,15 @@ + return err;
+ }
+
+-#define OUTPUT_BIGNUM(num, buf2, y, z) \
+-{ \
+- z = (unsigned long)mp_unsigned_bin_size(num); \
+- if ((y + 4 + z) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \
+- STORE32L(z, out+y); \
+- y += 4; \
+- if (mp_to_unsigned_bin(num, out+y) != MP_OKAY) { return CRYPT_MEM; } \
+- y += z; \
+-}
++#define OUTPUT_BIGNUM(num, buf2, y, z) \ ++{ \ ++ z = (unsigned long)mp_unsigned_bin_size(num); \ ++ if ((y + 4 + z) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ ++ STORE32L(z, out+y); \ ++ y += 4; \ ++ if (mp_to_unsigned_bin(num, out+y) != MP_OKAY) { return CRYPT_MEM; } \ ++ y += z; \ ++} +
+ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key)
+ {
+@@ -352,33 +352,33 @@ + return CRYPT_OK;
+ }
+
+-#define INPUT_BIGNUM(num, in, x, y) \
+-{ \
+- /* load value */ \
+- if (y+4 > inlen) { \
+- err = CRYPT_INVALID_PACKET; \
+- goto error; \
+- } \
+- LOAD32L(x, in+y); \
+- y += 4; \
+- \
+- /* sanity check... */ \
+- if (y+x > inlen) { \
+- err = CRYPT_INVALID_PACKET; \
+- goto error; \
+- } \
+- \
+- /* load it */ \
+- if (mp_read_unsigned_bin(num, (unsigned char *)in+y, (int)x) != MP_OKAY) {\
+- err = CRYPT_MEM; \
+- goto error; \
+- } \
+- y += x; \
+- if (mp_shrink(num) != MP_OKAY) { \
+- err = CRYPT_MEM; \
+- goto error; \
+- } \
+-}
++#define INPUT_BIGNUM(num, in, x, y) \ ++{ \ ++ /* load value */ \ ++ if (y+4 > inlen) { \ ++ err = CRYPT_INVALID_PACKET; \ ++ goto error; \ ++ } \ ++ LOAD32L(x, in+y); \ ++ y += 4; \ ++ \ ++ /* sanity check... */ \ ++ if (y+x > inlen) { \ ++ err = CRYPT_INVALID_PACKET; \ ++ goto error; \ ++ } \ ++ \ ++ /* load it */ \ ++ if (mp_read_unsigned_bin(num, (unsigned char *)in+y, (int)x) != MP_OKAY) {\ ++ err = CRYPT_MEM; \ ++ goto error; \ ++ } \ ++ y += x; \ ++ if (mp_shrink(num) != MP_OKAY) { \ ++ err = CRYPT_MEM; \ ++ goto error; \ ++ } \ ++} +
+ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key)
+ {
diff --git a/security/libtomcrypt/files/patch-makefile b/security/libtomcrypt/files/patch-makefile new file mode 100644 index 000000000000..02b6cf2e557d --- /dev/null +++ b/security/libtomcrypt/files/patch-makefile @@ -0,0 +1,50 @@ +--- makefile.orig Wed Dec 24 20:59:55 2003 ++++ makefile Sat Apr 10 23:01:52 2004 +@@ -52,9 +52,9 @@ + #LIBPATH-The directory for libtomcrypt to be installed to. + #INCPATH-The directory to install the header files for libtomcrypt. + #DATAPATH-The directory to install the pdf docs. +-DESTDIR= +-LIBPATH=/usr/lib +-INCPATH=/usr/include ++DESTDIR=$(PREFIX) ++LIBPATH=/lib ++INCPATH=/include + DATAPATH=/usr/share/doc/libtomcrypt/pdf + + #List of objects to compile. +@@ -106,6 +106,7 @@ + + #This rule makes the test program included with libtomcrypt + test: library $(TESTOBJECTS) ++ mv $(TEST).o demos + $(CC) $(TESTOBJECTS) $(LIBNAME) -o $(TEST) $(WARN) + + #This rule makes the hash program included with libtomcrypt +@@ -129,13 +130,19 @@ + #This rule installs the library and the header files. This must be run + #as root in order to have a high enough permission to write to the correct + #directories and to set the owner and group to root. +-install: library docs +- install -d -g root -o root $(DESTDIR)$(LIBPATH) +- install -d -g root -o root $(DESTDIR)$(INCPATH) +- install -d -g root -o root $(DESTDIR)$(DATAPATH) +- install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH) +- install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH) +- install -g root -o root crypt.pdf $(DESTDIR)$(DATAPATH) ++install: library docs install-nodocs ++ install -d -g wheel -o root $(DOCSDIR) ++ install -g wheel -o root crypt.pdf $(DOCSDIR) ++ install -g wheel -o root notes/* $(DOCSDIR) ++ ++install-nodocs: ++ install -d -g wheel -o root $(DESTDIR)$(LIBPATH) ++ install -d -g wheel -o root $(DESTDIR)$(INCPATH) ++ install -d -g wheel -o root $(EXAMPLESDIR) ++ install -g wheel -o root $(LIBNAME) $(DESTDIR)$(LIBPATH) ++ install -g wheel -o root $(HEADERS) $(DESTDIR)$(INCPATH) ++ install -g wheel -o root examples/* $(EXAMPLESDIR) ++ install -g wheel -o root demos/* $(EXAMPLESDIR) + + #This rule cleans the source tree of all compiled code, not including the pdf + #documentation. diff --git a/security/libtomcrypt/pkg-descr b/security/libtomcrypt/pkg-descr new file mode 100644 index 000000000000..4bacfafe18de --- /dev/null +++ b/security/libtomcrypt/pkg-descr @@ -0,0 +1,5 @@ +LibTomCrypt is a portable ANSI C cryptographic library that supports symmetric +ciphers, one-way hashes, pseudo-random number generators, public key +cryptography (via RSA,DH or ECC/DH) and a plethora of support routines. + +WWW: http://www.libtomcrypt.org diff --git a/security/libtomcrypt/pkg-plist b/security/libtomcrypt/pkg-plist new file mode 100644 index 000000000000..aa7e652e277c --- /dev/null +++ b/security/libtomcrypt/pkg-plist @@ -0,0 +1,37 @@ +lib/libtomcrypt.a +include/tommath.h +include/mycrypt_cfg.h +include/mycrypt_gf.h +include/mycrypt_kr.h +include/mycrypt_misc.h +include/mycrypt_prng.h +include/mycrypt_cipher.h +include/mycrypt_hash.h +include/mycrypt_macros.h +include/mycrypt_pk.h +include/mycrypt.h +include/mycrypt_argchk.h +include/mycrypt_custom.h +%%EXAMPLESDIR%%/ch1-01.c +%%EXAMPLESDIR%%/ch1-02.c +%%EXAMPLESDIR%%/ch1-03.c +%%EXAMPLESDIR%%/ch2-01.c +%%EXAMPLESDIR%%/encrypt.c +%%EXAMPLESDIR%%/small.c +%%EXAMPLESDIR%%/timer.asm +%%EXAMPLESDIR%%/timer.h +%%EXAMPLESDIR%%/x86_prof.c +%%EXAMPLESDIR%%/hashsum.c +%%EXAMPLESDIR%%/test.c +%%EXAMPLESDIR%%/timer.c +%%EXAMPLESDIR%%/tv_gen.c +%%PORTDOCS%%%%DOCSDIR%%/crypt.pdf +%%PORTDOCS%%%%DOCSDIR%%/cipher_tv.txt +%%PORTDOCS%%%%DOCSDIR%%/hmac_tv.txt +%%PORTDOCS%%%%DOCSDIR%%/hash_tv.txt +%%PORTDOCS%%%%DOCSDIR%%/omac_tv.txt +%%PORTDOCS%%%%DOCSDIR%%/tech0001.txt +%%PORTDOCS%%%%DOCSDIR%%/tech0002.txt +%%PORTDOCS%%%%DOCSDIR%%/tech0003.txt +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%EXAMPLESDIR%% |