Steve Grubb 628394
diff -urp aide-0.13.1.orig/doc/aide.1.in aide-0.13.1/doc/aide.1.in
Steve Grubb 628394
--- aide-0.13.1.orig/doc/aide.1.in	2009-12-01 12:23:10.000000000 -0500
Steve Grubb 628394
+++ aide-0.13.1/doc/aide.1.in	2009-12-01 12:28:14.000000000 -0500
Steve Grubb 628394
@@ -67,6 +67,7 @@ conditions:
Steve Grubb 628394
 .IP "16 Unimplemented function error"
Steve Grubb 628394
 .IP "17 Invalid configureline error"
Steve Grubb 628394
 .IP "18 IO error"
Steve Grubb 628394
+.IP "19 Version mismatch error"
Steve Grubb 628394
 .PP
Steve Grubb 628394
 .SH NOTES
Steve Grubb 628394
 Please note that due to mmap issues, aide cannot be terminated with
Steve Grubb 628394
diff -urp aide-0.13.1.orig/include/report.h aide-0.13.1/include/report.h
Steve Grubb 628394
--- aide-0.13.1.orig/include/report.h	2009-12-01 12:23:10.000000000 -0500
Steve Grubb 628394
+++ aide-0.13.1/include/report.h	2009-12-01 12:27:43.000000000 -0500
Steve Grubb 628394
@@ -31,6 +31,7 @@
Steve Grubb 628394
 #define UNIMPLEMENTED_FUNCTION_ERROR 16
Steve Grubb 628394
 #define INVALID_CONFIGURELINE_ERROR 17
Steve Grubb 628394
 #define IO_ERROR 18
Steve Grubb 628394
+#define VERSION_MISMATCH_ERROR 19
Steve Grubb 628394
 
Steve Grubb 628394
 /* Errorcodes */
Steve Grubb 628394
 #define HASH_ALGO_ERROR 30
Steve Grubb 628394
diff -urp aide-0.13.1.orig/src/md.c aide-0.13.1/src/md.c
Steve Grubb 628394
--- aide-0.13.1.orig/src/md.c	2009-12-01 12:23:10.000000000 -0500
Steve Grubb 628394
+++ aide-0.13.1/src/md.c	2009-12-01 12:27:04.000000000 -0500
Steve Grubb 628394
@@ -201,6 +201,15 @@ int init_md(struct md_container* md) {
Steve Grubb 628394
 #endif 
Steve Grubb 628394
 #ifdef WITH_GCRYPT
Steve Grubb 628394
   error(255,"Gcrypt library initialization\n");
Steve Grubb 628394
+  	/* 
Steve Grubb 628394
+  	  Initialize libgcrypt as per
Steve Grubb 628394
+  	  http://www.gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html
Steve Grubb 628394
+  	 */
Steve Grubb 628394
+  	if(!gcry_check_version(GCRYPT_VERSION)) {
Steve Grubb 628394
+		error(0,"libgcrypt version mismatch\n");
Steve Grubb 628394
+		exit(VERSION_MISMATCH_ERROR);
Steve Grubb 628394
+	}
Steve Grubb 628394
+	gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
Steve Grubb 628394
 	if(gcry_md_open(&md->mdh,0,0)!=GPG_ERR_NO_ERROR){
Steve Grubb 628394
 		error(0,"gcrypt_md_open failed\n");
Steve Grubb 628394
 		exit(IO_ERROR);