Steve Grubb af2e13
diff -up aide-0.13.1/src/md.c.gcryptinit aide-0.13.1/src/md.c
Steve Grubb af2e13
--- aide-0.13.1/src/md.c.gcryptinit	2009-10-23 04:48:19.000000000 +0200
Steve Grubb af2e13
+++ aide-0.13.1/src/md.c	2009-10-23 04:53:09.000000000 +0200
Steve Grubb af2e13
@@ -201,6 +201,15 @@ int init_md(struct md_container* md) {
Steve Grubb af2e13
 #endif 
Steve Grubb af2e13
 #ifdef WITH_GCRYPT
Steve Grubb af2e13
   error(255,"Gcrypt library initialization\n");
Steve Grubb af2e13
+  	/* 
Steve Grubb af2e13
+  	  Initialize libgcrypt as per
Steve Grubb af2e13
+  	  http://www.gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html
Steve Grubb af2e13
+  	 */
Steve Grubb af2e13
+  	if(!gcry_check_version(GCRYPT_VERSION)) {
Steve Grubb af2e13
+		error(0,"libgcrypt version mismatch\n");
Steve Grubb af2e13
+		exit(1);
Steve Grubb af2e13
+	}
Steve Grubb af2e13
+	gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
Steve Grubb af2e13
 	if(gcry_md_open(&md->mdh,0,0)!=GPG_ERR_NO_ERROR){
Steve Grubb af2e13
 		error(0,"gcrypt_md_open failed\n");
Steve Grubb af2e13
 		exit(IO_ERROR);