aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_helper_cs.c
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2022-01-11 21:21:18 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:36:11 +0100
commit5b7e8f9ac55990823363edffa0e907256d15ce4f (patch)
tree7c0b265ea23c46a40e131ea3eea16090688b0a0c /src/util/crypto_helper_cs.c
parentdaa7fdcfb1053bdd943ad7cd1bd8eb623d1c9157 (diff)
downloadexchange-5b7e8f9ac55990823363edffa0e907256d15ce4f.tar.xz
refactoring
Diffstat (limited to 'src/util/crypto_helper_cs.c')
-rw-r--r--src/util/crypto_helper_cs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/crypto_helper_cs.c b/src/util/crypto_helper_cs.c
index c24815a6a..240c13552 100644
--- a/src/util/crypto_helper_cs.c
+++ b/src/util/crypto_helper_cs.c
@@ -175,7 +175,6 @@ handle_mt_avail (struct TALER_CRYPTO_CsDenominationHelper *dh,
= (const struct TALER_CRYPTO_CsKeyAvailableNotification *) hdr;
const char *buf = (const char *) &kan[1];
const char *section_name;
- uint16_t ps;
uint16_t snl;
if (sizeof (*kan) > ntohs (hdr->size))
@@ -183,9 +182,8 @@ handle_mt_avail (struct TALER_CRYPTO_CsDenominationHelper *dh,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- ps = ntohs (kan->pub_size);
snl = ntohs (kan->section_name_len);
- if (ntohs (hdr->size) != sizeof (*kan) + ps + snl)
+ if (ntohs (hdr->size) != sizeof (*kan) + snl)
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -195,7 +193,7 @@ handle_mt_avail (struct TALER_CRYPTO_CsDenominationHelper *dh,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- section_name = &buf[ps];
+ section_name = buf;
if ('\0' != section_name[snl - 1])
{
GNUNET_break_op (0);
@@ -207,8 +205,8 @@ handle_mt_avail (struct TALER_CRYPTO_CsDenominationHelper *dh,
struct TALER_CsPubHashP h_cs;
denom_pub.cipher = TALER_DENOMINATION_CS;
+ denom_pub.details.cs_public_key = kan->denom_pub;
- memcpy (&denom_pub.details.cs_public_key, buf, ntohs (kan->pub_size));
TALER_cs_pub_hash (&denom_pub.details.cs_public_key, &h_cs);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Received CS key %s (%s)\n",