head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2012.10.23.15.34.47;	author mi;	state Exp;
branches;
next	;


desc
@@


1.1
log
@SVN rev 306315 on 2012-10-23 15:34:47Z by mi

Add the test-target for running vendor's self-tests and attempt to
make sure, the tests complete.

Add one more header to the installation list -- this is required in 3.0.3
for 3rd-party modules to build.

Approved by:	maintainer
Feature safe:	yes
@
text
@This arranges for using SHA256 found in -lmd, instead of
the copy bundled with Varnish sources.

	-mi

P.S. OpenSSL has the same SHA256 API and could also be used
for the same purpose.
--- include/vsha256.h	2012-08-20 05:20:40.000000000 -0400
+++ include/vsha256.h	2012-09-26 14:28:29.000000000 -0400
@@@@ -28,20 +28,8 @@@@
 
 #ifndef _SHA256_H_
-#define _SHA256_H_
 
-#include <stdint.h>
+#include <sha256.h>
 
 #define SHA256_LEN		32
 
-typedef struct SHA256Context {
-	uint32_t state[8];
-	uint64_t count;
-	unsigned char buf[64];
-} SHA256_CTX;
-
-void	SHA256_Init(SHA256_CTX *);
-void	SHA256_Update(SHA256_CTX *, const void *, size_t);
-void	SHA256_Final(unsigned char [SHA256_LEN], SHA256_CTX *);
-void	SHA256_Test(void);
-
 #endif /* !_SHA256_H_ */
--- lib/libvarnish/Makefile.am	2012-08-20 05:20:40.000000000 -0400
+++ lib/libvarnish/Makefile.am	2012-09-26 14:28:35.000000000 -0400
@@@@ -26,10 +26,10 @@@@
 	vre.c \
 	vsb.c \
-	vsha256.c \
 	vss.c \
 	vtmpfile.c
 
 libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
 libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} @@PCRE_LIBS@@
+libvarnish_la_LIBADD+= -lmd
 
 if ENABLE_TESTS
--- lib/libvarnishapi/Makefile.am	2012-08-20 05:20:40.000000000 -0400
+++ lib/libvarnishapi/Makefile.am	2012-09-26 14:36:57.000000000 -0400
@@@@ -21,5 +21,4 @@@@
 	../libvarnish/vre.c \
 	../libvarnish/vsb.c \
-	../libvarnish/vsha256.c \
 	vsm.c \
 	vsl_arg.c \
@@@@ -31,5 +30,5 @@@@
 	-DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
 
-libvarnishapi_la_LIBADD = @@PCRE_LIBS@@
+libvarnishapi_la_LIBADD = @@PCRE_LIBS@@ -lmd
 
 if HAVE_LD_VERSION_SCRIPT
--- bin/varnishd/varnishd.c	2012-08-20 05:20:40.000000000 -0400
+++ bin/varnishd/varnishd.c	2012-09-26 14:50:04.000000000 -0400
@@@@ -391,9 +391,4 @@@@
 	assert(TIM_parse("Sun Nov  6 08:49:37 1994") == 784111777);
 
-	/*
-	 * Check that our SHA256 works
-	 */
-	SHA256_Test();
-
 	memset(cli, 0, sizeof cli);
 	cli[0].sb = VSB_new_auto();
@
