From: Christian Grothoff Date: Thu, 14 Feb 2019 09:54:01 +0000 (+0100) Subject: fix uninit e_hash issue X-Git-Tag: v0.11.0~63^2~66 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b7433c7e45b47dcff9a8c9d1dfc8966c85bb8f14;p=oweals%2Fgnunet.git fix uninit e_hash issue --- diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c index d4c01fedb..e423217f2 100644 --- a/src/secretsharing/gnunet-service-secretsharing.c +++ b/src/secretsharing/gnunet-service-secretsharing.c @@ -11,7 +11,7 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -994,11 +994,16 @@ get_fair_encryption_challenge (const struct GNUNET_SECRETSHARING_FairEncryption } hash_data; struct GNUNET_HashCode e_hash; + memset (&hash_data, + 0, + sizeof (hash_data)); GNUNET_memcpy (&hash_data.c, &fe->c, sizeof (struct GNUNET_CRYPTO_PaillierCiphertext)); GNUNET_memcpy (&hash_data.h, &fe->h, GNUNET_SECRETSHARING_ELGAMAL_BITS / 8); GNUNET_memcpy (&hash_data.t1, &fe->t1, GNUNET_SECRETSHARING_ELGAMAL_BITS / 8); GNUNET_memcpy (&hash_data.t2, &fe->t2, GNUNET_CRYPTO_PAILLIER_BITS * 2 / 8); - + GNUNET_CRYPTO_hash (&hash_data, + sizeof (hash_data), + &e_hash); GNUNET_CRYPTO_mpi_scan_unsigned (&e, &e_hash, sizeof (struct GNUNET_HashCode)); gcry_mpi_mod (e, e, elgamal_q); } diff --git a/src/secretsharing/secretsharing.conf.in b/src/secretsharing/secretsharing.conf.in index bd8da6177..ddc41b978 100644 --- a/src/secretsharing/secretsharing.conf.in +++ b/src/secretsharing/secretsharing.conf.in @@ -8,8 +8,9 @@ ACCEPT_FROM6 = ::1; UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-secretsharing.sock UNIX_MATCH_UID = YES UNIX_MATCH_GID = YES +PREFIX = valgrind --leak-check=yes # DISABLE_SOCKET_FORWARDING = NO -# USERNAME = +# USERNAME = # MAXBUF = # TIMEOUT = # DISABLEV6 =