Before that, calls to 'HashSink::currentHash()' would eventually lead to
a segfault because the underlying gcrypt handle has been closed. (Note
that this method is only used via 'importPaths' and 'exportPath', though.)
* nix/libutil/gcrypt-hash.hh (struct guix_hash_context): Add a
constructor and a copy constructor; move out of 'extern "C"'.
* nix/libutil/gcrypt-hash.cc (guix_hash_final): Clear 'md_handle' upon
exit.
* nix/sync-with-upstream (top_srcdir): Change hash.{cc,hh} to read
'struct Ctx' instead of 'union Ctx'.
Fixes compilation with the forthcoming libgcrypt 1.6.x.
Reported by Matthias Wachs <wachs@net.in.tum.de>
and NIIBE Yutaka <gniibe@fsij.org>.
* nix/libutil/gcrypt-hash.cc (guix_hash_init, guix_hash_final): Use
'int' as the type of the 'algo' parameter.
* nix/libutil/gcrypt-hash.hh: Update declarations accordingly.