summaryrefslogtreecommitdiff
path: root/security/libtomcrypt/files
diff options
context:
space:
mode:
authorThierry Thomas <thierry@FreeBSD.org>2004-04-10 23:16:07 +0000
committerThierry Thomas <thierry@FreeBSD.org>2004-04-10 23:16:07 +0000
commit62e2ae73b205524fc3e352c4b013f65e217655d2 (patch)
tree210f4011c768139ad925ffd8cd66c743344ee8c9 /security/libtomcrypt/files
parentThe tarball of 0.92 has been replaced by 0.92a. (diff)
Add libtomcrypt 0.92, comprehensive, modular and portable
cryptographic toolkit. PR: 62581 Submitted by: Yonatan <Yonatan@Xpert.com> Approved by: pav (mentor).
Notes
Notes: svn path=/head/; revision=106695
Diffstat (limited to 'security/libtomcrypt/files')
-rw-r--r--security/libtomcrypt/files/patch-dsa.c88
-rw-r--r--security/libtomcrypt/files/patch-makefile50
2 files changed, 138 insertions, 0 deletions
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.