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