changeset 11:5be1ecb80cc9

Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
author root <root@Really.UFO-Net.nl>
date Sat, 04 Dec 2010 02:10:00 +0000
parents 1e4ba8d8ffc2
children e4b60d041491
files build.sh src/proto.nacltai.c
diffstat 2 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/build.sh	Sat Dec 04 03:01:46 2010 +0100
+++ b/build.sh	Sat Dec 04 02:10:00 2010 +0000
@@ -48,12 +48,14 @@
 ##echo Building frontends...
 ##gcc -o out/quicktun.debian	src/run.debian.c -ldl
 
-if [ -x /usr/bin/dpkg-deb -a -x /usr/bin/fakeroot ]; then
+if [ -f /etc/network/interfaces ]; then
 	echo Building debian binary...
 	gcc -c -DCOMBINED_BINARY -DDEBIAN_BINARY src/run.combined.c -o obj/run.debian.o
 	gcc -o out/quicktun.debian obj/common.o obj/run.debian.o obj/proto.raw.o obj/proto.nacl0.o obj/proto.nacltai.o obj/crypto_scalarmult_curve25519.o -lnacl
-	echo -n Building debian package...
-	cd debian
-	./build.sh
-	cd ..
+	if [ -x /usr/bin/dpkg-deb -a -x /usr/bin/fakeroot ]; then
+		echo -n Building debian package...
+		cd debian
+		./build.sh
+		cd ..
+	fi
 fi
--- a/src/proto.nacltai.c	Sat Dec 04 03:01:46 2010 +0100
+++ b/src/proto.nacltai.c	Sat Dec 04 02:10:00 2010 +0000
@@ -119,7 +119,7 @@
 extern crypto_scalarmult_curve25519_base(unsigned char *pk, unsigned char *sk);
 
 static int encode(struct qtsession* sess, char* raw, char* enc, int len) {
-	fprintf(stderr, "Encoding packet of %d bytes from %d to %d\n", len, raw, enc);
+//	fprintf(stderr, "Encoding packet of %d bytes from %d to %d\n", len, raw, enc);
 	struct qt_proto_data_nacltai* d = (struct qt_proto_data_nacltai*)sess->protocol_data;
 	memset(raw, 0, crypto_box_ZEROBYTES);
 	taia_now(&d->cdtaic);
@@ -127,12 +127,12 @@
 	if (crypto_box_afternm(enc, raw, len + crypto_box_ZEROBYTES, d->cenonce, d->cbefore)) return errorexit("Crypto failed");
 	memcpy((void*)(enc + crypto_box_BOXZEROBYTES - noncelength), d->cenonce + nonceoffset, noncelength);
 	len += overhead;
-	fprintf(stderr, "Encoded packet of %d bytes from %d to %d\n", len, raw, enc);
+//	fprintf(stderr, "Encoded packet of %d bytes from %d to %d\n", len, raw, enc);
 	return len;
 }
 
 static int decode(struct qtsession* sess, char* enc, char* raw, int len) {
-	fprintf(stderr, "Decoding packet of %d bytes from %d to %d\n", len, enc, raw);
+//	fprintf(stderr, "Decoding packet of %d bytes from %d to %d\n", len, enc, raw);
 	struct qt_proto_data_nacltai* d = (struct qt_proto_data_nacltai*)sess->protocol_data;
 	int i;
 	if (len < overhead) {
@@ -152,7 +152,7 @@
 		return 0;
 	}
 	d->cdtaip = d->cdtaic;
-	fprintf(stderr, "Decoded packet of %d bytes from %d to %d\n", len, enc, raw);
+//	fprintf(stderr, "Decoded packet of %d bytes from %d to %d\n", len, enc, raw);
 	return len;
 }