diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-09 16:15:32 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-09 16:15:32 +0000 |
commit | aba599ddd94139578193c9bcdc774ac558a0f15f (patch) | |
tree | fcd27722abc5968b8b5ad21f38a3139093468ad8 /src/scalarproduct/scalarproduct_api.c | |
parent | 19933122ffe6ff84cb0dcccb2782704f89df54bb (diff) | |
download | gnunet-aba599ddd94139578193c9bcdc774ac558a0f15f.tar.gz gnunet-aba599ddd94139578193c9bcdc774ac558a0f15f.zip |
sanitized the scalarproduct client
fixed a typo in the SP API
changed SP-service to always use GCRYMPI_FMT_STD when sending the result back to client. Even though gcry currently can not print negative numbers, we can just remove the if-else block above it once that's supported
Diffstat (limited to 'src/scalarproduct/scalarproduct_api.c')
-rw-r--r-- | src/scalarproduct/scalarproduct_api.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c index b3390f349..ee2e6e5eb 100644 --- a/src/scalarproduct/scalarproduct_api.c +++ b/src/scalarproduct/scalarproduct_api.c | |||
@@ -184,7 +184,7 @@ process_result_message (void *cls, | |||
184 | gcry_mpi_t num; | 184 | gcry_mpi_t num; |
185 | size_t read = 0; | 185 | size_t read = 0; |
186 | 186 | ||
187 | if (0 != (rc = gcry_mpi_scan (&num, GCRYMPI_FMT_USG, &msg[1], product_len, &read))) | 187 | if (0 != (rc = gcry_mpi_scan (&num, GCRYMPI_FMT_STD, &msg[1], product_len, &read))) |
188 | { | 188 | { |
189 | LOG_GCRY(GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc); | 189 | LOG_GCRY(GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc); |
190 | gcry_mpi_release (result); | 190 | gcry_mpi_release (result); |
@@ -338,7 +338,7 @@ GNUNET_SCALARPRODUCT_response (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
338 | return NULL; | 338 | return NULL; |
339 | } | 339 | } |
340 | h->stats = GNUNET_STATISTICS_create ("scalarproduct-api", cfg); | 340 | h->stats = GNUNET_STATISTICS_create ("scalarproduct-api", cfg); |
341 | if (!h->th) | 341 | if (!h->stats) |
342 | { | 342 | { |
343 | LOG (GNUNET_ERROR_TYPE_ERROR, | 343 | LOG (GNUNET_ERROR_TYPE_ERROR, |
344 | _ ("Failed to send a message to the statistics service\n")); | 344 | _ ("Failed to send a message to the statistics service\n")); |
@@ -431,7 +431,7 @@ GNUNET_SCALARPRODUCT_request (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
431 | return NULL; | 431 | return NULL; |
432 | } | 432 | } |
433 | h->stats = GNUNET_STATISTICS_create ("scalarproduct-api", cfg); | 433 | h->stats = GNUNET_STATISTICS_create ("scalarproduct-api", cfg); |
434 | if (!h->th) | 434 | if (!h->stats) |
435 | { | 435 | { |
436 | LOG (GNUNET_ERROR_TYPE_ERROR, | 436 | LOG (GNUNET_ERROR_TYPE_ERROR, |
437 | _ ("Failed to send a message to the statistics service\n")); | 437 | _ ("Failed to send a message to the statistics service\n")); |