From b7433c7e45b47dcff9a8c9d1dfc8966c85bb8f14 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 14 Feb 2019 10:54:01 +0100 Subject: [PATCH] fix uninit e_hash issue --- src/secretsharing/gnunet-service-secretsharing.c | 9 +++++++-- src/secretsharing/secretsharing.conf.in | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) 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 = -- 2.25.1