diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-19 11:47:52 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-19 11:47:52 +0100 |
commit | 68a4d901347bfa159adfe67e00f149e09800ea22 (patch) | |
tree | 9f966c9c1ea7f15954552d0832a7ef1414549735 /src/util/crypto_helper_esign.c | |
parent | bdaaa0f6cb8f99168ed9916064a5e4145426480c (diff) |
-misc bugfixes
Diffstat (limited to 'src/util/crypto_helper_esign.c')
-rw-r--r-- | src/util/crypto_helper_esign.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/crypto_helper_esign.c b/src/util/crypto_helper_esign.c index 794a916a8..5c0d9449d 100644 --- a/src/util/crypto_helper_esign.c +++ b/src/util/crypto_helper_esign.c @@ -337,6 +337,8 @@ TALER_CRYPTO_helper_esign_sign_ ( struct TALER_ExchangePublicKeyP *exchange_pub, struct TALER_ExchangeSignatureP *exchange_sig) { + uint32_t purpose_size = ntohl (purpose->size); + if (GNUNET_OK != try_connect (esh)) { @@ -344,8 +346,9 @@ TALER_CRYPTO_helper_esign_sign_ ( "Failed to connect to helper\n"); return TALER_EC_EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE; } + GNUNET_assert (purpose_size < + UINT16_MAX - sizeof (struct TALER_CRYPTO_EddsaSignRequest)); { - uint32_t purpose_size = ntohl (purpose->size); char buf[sizeof (struct TALER_CRYPTO_EddsaSignRequest) + purpose_size - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)]; struct TALER_CRYPTO_EddsaSignRequest *sr @@ -414,6 +417,7 @@ more: if (off < sizeof (struct GNUNET_MessageHeader)) continue; msize = ntohs (hdr->size); + GNUNET_assert (msize <= sizeof (buf)); if (off < msize) continue; switch (ntohs (hdr->type)) |