|
|
11423e |
diff -up ./src/aide.c.orig ./aide-0.16b1/src/aide.c
|
|
|
11423e |
--- ./src/aide.c.orig 2016-07-12 11:10:08.013158385 +0200
|
|
|
11423e |
+++ ./src/aide.c 2016-07-12 11:30:54.867833064 +0200
|
|
|
11423e |
@@ -511,9 +511,28 @@ int main(int argc,char**argv)
|
|
|
11423e |
#endif
|
|
|
11423e |
umask(0177);
|
|
|
11423e |
init_sighandler();
|
|
|
11423e |
-
|
|
|
11423e |
setdefaults_before_config();
|
|
|
11423e |
|
|
|
11423e |
+#if WITH_GCRYPT
|
|
|
11423e |
+ error(255,"Gcrypt library initialization\n");
|
|
|
11423e |
+ /*
|
|
|
11423e |
+ * Initialize libgcrypt as per
|
|
|
11423e |
+ * http://www.gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html
|
|
|
11423e |
+ *
|
|
|
11423e |
+ *
|
|
|
11423e |
+ */
|
|
|
11423e |
+ gcry_control(GCRYCTL_SET_ENFORCED_FIPS_FLAG, 0);
|
|
|
11423e |
+ gcry_control(GCRYCTL_INIT_SECMEM, 1);
|
|
|
11423e |
+
|
|
|
11423e |
+ if(!gcry_check_version(GCRYPT_VERSION)) {
|
|
|
11423e |
+ error(0,"libgcrypt version mismatch\n");
|
|
|
11423e |
+ exit(VERSION_MISMATCH_ERROR);
|
|
|
11423e |
+ }
|
|
|
11423e |
+
|
|
|
11423e |
+ gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
|
|
|
11423e |
+#endif /* WITH_GCRYPT */
|
|
|
11423e |
+
|
|
|
11423e |
+
|
|
|
11423e |
if(read_param(argc,argv)==RETFAIL){
|
|
|
11423e |
error(0, _("Invalid argument\n") );
|
|
|
11423e |
exit(INVALID_ARGUMENT_ERROR);
|
|
|
11423e |
@@ -646,6 +665,9 @@ int main(int argc,char**argv)
|
|
|
11423e |
}
|
|
|
11423e |
#endif
|
|
|
11423e |
}
|
|
|
11423e |
+#ifdef WITH_GCRYPT
|
|
|
11423e |
+ gcry_control(GCRYCTL_TERM_SECMEM, 0);
|
|
|
11423e |
+#endif /* WITH_GCRYPT */
|
|
|
11423e |
return RETOK;
|
|
|
11423e |
}
|
|
|
11423e |
const char* aide_key_3=CONFHMACKEY_03;
|
|
|
11423e |
diff -up ./src/md.c.orig ./aide-0.16b1/src/md.c
|
|
|
11423e |
--- ./src/md.c.orig 2016-04-15 23:30:16.000000000 +0200
|
|
|
11423e |
+++ ./src/md.c 2016-07-12 11:35:04.007675329 +0200
|
|
|
11423e |
@@ -201,14 +201,7 @@ int init_md(struct md_container* md) {
|
|
|
11423e |
}
|
|
|
11423e |
#endif
|
|
|
11423e |
#ifdef WITH_GCRYPT
|
|
|
11423e |
- error(255,"Gcrypt library initialization\n");
|
|
|
11423e |
- if(!gcry_check_version(GCRYPT_VERSION)) {
|
|
|
11423e |
- error(0,"libgcrypt version mismatch\n");
|
|
|
11423e |
- exit(VERSION_MISMATCH_ERROR);
|
|
|
11423e |
- }
|
|
|
11423e |
- gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
|
|
|
11423e |
- gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
|
|
|
11423e |
- if(gcry_md_open(&md->mdh,0,0)!=GPG_ERR_NO_ERROR){
|
|
|
11423e |
+ if(gcry_md_open(&md->mdh,0,GCRY_MD_FLAG_SECURE)!=GPG_ERR_NO_ERROR){
|
|
|
11423e |
error(0,"gcrypt_md_open failed\n");
|
|
|
11423e |
exit(IO_ERROR);
|
|
|
11423e |
}
|
|
|
11423e |
@@ -299,7 +292,7 @@ int close_md(struct md_container* md) {
|
|
|
11423e |
|
|
|
11423e |
/*. There might be more hashes in the library. Add those here.. */
|
|
|
11423e |
|
|
|
11423e |
- gcry_md_reset(md->mdh);
|
|
|
11423e |
+ gcry_md_close(md->mdh);
|
|
|
11423e |
#endif
|
|
|
11423e |
|
|
|
11423e |
#ifdef WITH_MHASH
|
|
|
11423e |
diff -up ./src/util.c.orig ./aide-0.16b1/src/util.c
|
|
|
11423e |
--- ./src/util.c.orig 2016-07-12 11:39:17.023437355 +0200
|
|
|
11423e |
+++ ./src/util.c 2016-07-12 11:39:51.618721157 +0200
|
|
|
11423e |
@@ -519,28 +519,5 @@ int syslog_facility_lookup(char *s)
|
|
|
11423e |
return(AIDE_SYSLOG_FACILITY);
|
|
|
11423e |
}
|
|
|
11423e |
|
|
|
11423e |
-/* We need these dummy stubs to fool the linker into believing that
|
|
|
11423e |
- we do not need them at link time */
|
|
|
11423e |
-
|
|
|
11423e |
-void* dlopen(char*filename,int flag)
|
|
|
11423e |
-{
|
|
|
11423e |
- return NULL;
|
|
|
11423e |
-}
|
|
|
11423e |
-
|
|
|
11423e |
-void* dlsym(void*handle,char*symbol)
|
|
|
11423e |
-{
|
|
|
11423e |
- return NULL;
|
|
|
11423e |
-}
|
|
|
11423e |
-
|
|
|
11423e |
-void* dlclose(void*handle)
|
|
|
11423e |
-{
|
|
|
11423e |
- return NULL;
|
|
|
11423e |
-}
|
|
|
11423e |
-
|
|
|
11423e |
-const char* dlerror(void)
|
|
|
11423e |
-{
|
|
|
11423e |
- return NULL;
|
|
|
11423e |
-}
|
|
|
11423e |
-
|
|
|
11423e |
const char* aide_key_2=CONFHMACKEY_02;
|
|
|
11423e |
const char* db_key_2=DBHMACKEY_02;
|