diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Makefile.am | 18 | ||||
-rw-r--r-- | src/util/configuration.c | 1 | ||||
-rw-r--r-- | src/util/container_meta_data.c | 7 | ||||
-rw-r--r-- | src/util/crypto_rsa.c | 1 | ||||
-rw-r--r-- | src/util/gnunet-crypto-tvg.c | 124 | ||||
-rw-r--r-- | src/util/os_installation.c | 5 |
6 files changed, 117 insertions, 39 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 6b9e083a7..e2614e5e3 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am | |||
@@ -25,6 +25,11 @@ if ENABLE_BENCHMARK | |||
25 | PTHREAD = -lpthread | 25 | PTHREAD = -lpthread |
26 | endif | 26 | endif |
27 | 27 | ||
28 | if HAVE_NOLIBGCRYPT19 | ||
29 | DLOG = crypto_ecc_dlog.c | ||
30 | DLOG_TEST = test_crypto_ecc_dlog | ||
31 | endif | ||
32 | |||
28 | gnunet_config_diff_SOURCES = \ | 33 | gnunet_config_diff_SOURCES = \ |
29 | gnunet-config-diff.c | 34 | gnunet-config-diff.c |
30 | gnunet_config_diff_LDADD = \ | 35 | gnunet_config_diff_LDADD = \ |
@@ -58,7 +63,7 @@ libgnunetutil_la_SOURCES = \ | |||
58 | crypto_symmetric.c \ | 63 | crypto_symmetric.c \ |
59 | crypto_crc.c \ | 64 | crypto_crc.c \ |
60 | crypto_ecc.c \ | 65 | crypto_ecc.c \ |
61 | crypto_ecc_dlog.c \ | 66 | $(DLOG) \ |
62 | crypto_ecc_setup.c \ | 67 | crypto_ecc_setup.c \ |
63 | crypto_hash.c \ | 68 | crypto_hash.c \ |
64 | crypto_hash_file.c \ | 69 | crypto_hash_file.c \ |
@@ -248,7 +253,6 @@ libgnunet_plugin_test_la_LDFLAGS = \ | |||
248 | if HAVE_BENCHMARKS | 253 | if HAVE_BENCHMARKS |
249 | BENCHMARKS = \ | 254 | BENCHMARKS = \ |
250 | perf_crypto_hash \ | 255 | perf_crypto_hash \ |
251 | perf_crypto_ecc_dlog \ | ||
252 | perf_crypto_rsa \ | 256 | perf_crypto_rsa \ |
253 | perf_crypto_paillier \ | 257 | perf_crypto_paillier \ |
254 | perf_crypto_symmetric \ | 258 | perf_crypto_symmetric \ |
@@ -256,6 +260,10 @@ if HAVE_BENCHMARKS | |||
256 | perf_malloc \ | 260 | perf_malloc \ |
257 | perf_mq \ | 261 | perf_mq \ |
258 | perf_scheduler | 262 | perf_scheduler |
263 | |||
264 | if HAVE_NOLIBGCRYPT19 | ||
265 | BENCHMARKS += perf_crypto_ecc_dlog | ||
266 | endif | ||
259 | endif | 267 | endif |
260 | 268 | ||
261 | if HAVE_SSH_KEY | 269 | if HAVE_SSH_KEY |
@@ -287,7 +295,7 @@ check_PROGRAMS = \ | |||
287 | test_crypto_ecdhe \ | 295 | test_crypto_ecdhe \ |
288 | test_crypto_ecdh_eddsa \ | 296 | test_crypto_ecdh_eddsa \ |
289 | test_crypto_ecdh_ecdsa \ | 297 | test_crypto_ecdh_ecdsa \ |
290 | test_crypto_ecc_dlog \ | 298 | $(DLOG_TEST) \ |
291 | test_crypto_hash \ | 299 | test_crypto_hash \ |
292 | test_crypto_hash_context \ | 300 | test_crypto_hash_context \ |
293 | test_crypto_hkdf \ | 301 | test_crypto_hkdf \ |
@@ -448,11 +456,13 @@ test_crypto_eddsa_LDADD = \ | |||
448 | libgnunetutil.la \ | 456 | libgnunetutil.la \ |
449 | $(LIBGCRYPT_LIBS) | 457 | $(LIBGCRYPT_LIBS) |
450 | 458 | ||
459 | if HAVE_NOLIBGCRYPT19 | ||
451 | test_crypto_ecc_dlog_SOURCES = \ | 460 | test_crypto_ecc_dlog_SOURCES = \ |
452 | test_crypto_ecc_dlog.c | 461 | test_crypto_ecc_dlog.c |
453 | test_crypto_ecc_dlog_LDADD = \ | 462 | test_crypto_ecc_dlog_LDADD = \ |
454 | libgnunetutil.la \ | 463 | libgnunetutil.la \ |
455 | $(LIBGCRYPT_LIBS) | 464 | $(LIBGCRYPT_LIBS) |
465 | endif | ||
456 | 466 | ||
457 | test_crypto_ecdhe_SOURCES = \ | 467 | test_crypto_ecdhe_SOURCES = \ |
458 | test_crypto_ecdhe.c | 468 | test_crypto_ecdhe.c |
@@ -595,11 +605,13 @@ perf_crypto_hash_SOURCES = \ | |||
595 | perf_crypto_hash_LDADD = \ | 605 | perf_crypto_hash_LDADD = \ |
596 | libgnunetutil.la | 606 | libgnunetutil.la |
597 | 607 | ||
608 | if HAVE_NOLIBGCRYPT19 | ||
598 | perf_crypto_ecc_dlog_SOURCES = \ | 609 | perf_crypto_ecc_dlog_SOURCES = \ |
599 | perf_crypto_ecc_dlog.c | 610 | perf_crypto_ecc_dlog.c |
600 | perf_crypto_ecc_dlog_LDADD = \ | 611 | perf_crypto_ecc_dlog_LDADD = \ |
601 | libgnunetutil.la \ | 612 | libgnunetutil.la \ |
602 | -lgcrypt | 613 | -lgcrypt |
614 | endif | ||
603 | 615 | ||
604 | perf_crypto_rsa_SOURCES = \ | 616 | perf_crypto_rsa_SOURCES = \ |
605 | perf_crypto_rsa.c | 617 | perf_crypto_rsa.c |
diff --git a/src/util/configuration.c b/src/util/configuration.c index bda643b83..3294d11f4 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -606,6 +606,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
606 | if (NULL == h) | 606 | if (NULL == h) |
607 | { | 607 | { |
608 | GNUNET_free (fn); | 608 | GNUNET_free (fn); |
609 | GNUNET_free (cfg_buf); | ||
609 | return GNUNET_SYSERR; | 610 | return GNUNET_SYSERR; |
610 | } | 611 | } |
611 | if (((ssize_t) size) != | 612 | if (((ssize_t) size) != |
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index b66a7b258..efaac1136 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c | |||
@@ -964,6 +964,9 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | |||
964 | { | 964 | { |
965 | /* does not fit! */ | 965 | /* does not fit! */ |
966 | GNUNET_free (ent); | 966 | GNUNET_free (ent); |
967 | if (NULL != cdata) | ||
968 | GNUNET_free (cdata); | ||
969 | cdata = NULL; | ||
967 | return GNUNET_SYSERR; | 970 | return GNUNET_SYSERR; |
968 | } | 971 | } |
969 | 972 | ||
@@ -976,9 +979,9 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | |||
976 | if (NULL != pos->mime_type) | 979 | if (NULL != pos->mime_type) |
977 | left -= strlen (pos->mime_type) + 1; | 980 | left -= strlen (pos->mime_type) + 1; |
978 | 981 | ||
979 | GNUNET_free (cdata); | 982 | if (NULL != cdata) |
983 | GNUNET_free (cdata); | ||
980 | cdata = NULL; | 984 | cdata = NULL; |
981 | |||
982 | i++; | 985 | i++; |
983 | } | 986 | } |
984 | GNUNET_free (ent); | 987 | GNUNET_free (ent); |
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 63232cab6..5e4c4d1e6 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c | |||
@@ -863,6 +863,7 @@ rsa_sign_mpi (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
863 | __FILE__, | 863 | __FILE__, |
864 | __LINE__, | 864 | __LINE__, |
865 | gcry_strerror (rc)); | 865 | gcry_strerror (rc)); |
866 | gcry_sexp_release (data); | ||
866 | GNUNET_break (0); | 867 | GNUNET_break (0); |
867 | return NULL; | 868 | return NULL; |
868 | } | 869 | } |
diff --git a/src/util/gnunet-crypto-tvg.c b/src/util/gnunet-crypto-tvg.c index 8949f427c..28e44e28b 100644 --- a/src/util/gnunet-crypto-tvg.c +++ b/src/util/gnunet-crypto-tvg.c | |||
@@ -128,6 +128,7 @@ d2j (json_t *vec, | |||
128 | json_object_set_new (vec, label, json); | 128 | json_object_set_new (vec, label, json); |
129 | } | 129 | } |
130 | 130 | ||
131 | |||
131 | /** | 132 | /** |
132 | * Add a number to a test vector. | 133 | * Add a number to a test vector. |
133 | * | 134 | * |
@@ -138,8 +139,8 @@ d2j (json_t *vec, | |||
138 | */ | 139 | */ |
139 | static void | 140 | static void |
140 | uint2j (json_t *vec, | 141 | uint2j (json_t *vec, |
141 | const char *label, | 142 | const char *label, |
142 | unsigned int num) | 143 | unsigned int num) |
143 | { | 144 | { |
144 | json_t *json = json_integer (num); | 145 | json_t *json = json_integer (num); |
145 | 146 | ||
@@ -154,7 +155,7 @@ expect_data_fixed (json_t *vec, | |||
154 | size_t expect_len) | 155 | size_t expect_len) |
155 | { | 156 | { |
156 | const char *s = json_string_value (json_object_get (vec, name)); | 157 | const char *s = json_string_value (json_object_get (vec, name)); |
157 | 158 | ||
158 | if (NULL == s) | 159 | if (NULL == s) |
159 | return GNUNET_NO; | 160 | return GNUNET_NO; |
160 | 161 | ||
@@ -166,6 +167,7 @@ expect_data_fixed (json_t *vec, | |||
166 | return GNUNET_OK; | 167 | return GNUNET_OK; |
167 | } | 168 | } |
168 | 169 | ||
170 | |||
169 | static int | 171 | static int |
170 | expect_data_dynamic (json_t *vec, | 172 | expect_data_dynamic (json_t *vec, |
171 | const char *name, | 173 | const char *name, |
@@ -173,6 +175,7 @@ expect_data_dynamic (json_t *vec, | |||
173 | size_t *ret_len) | 175 | size_t *ret_len) |
174 | { | 176 | { |
175 | const char *s = json_string_value (json_object_get (vec, name)); | 177 | const char *s = json_string_value (json_object_get (vec, name)); |
178 | char *tmp; | ||
176 | size_t len; | 179 | size_t len; |
177 | 180 | ||
178 | if (NULL == s) | 181 | if (NULL == s) |
@@ -181,10 +184,14 @@ expect_data_dynamic (json_t *vec, | |||
181 | len = (strlen (s) * 5) / 8; | 184 | len = (strlen (s) * 5) / 8; |
182 | if (NULL != ret_len) | 185 | if (NULL != ret_len) |
183 | *ret_len = len; | 186 | *ret_len = len; |
184 | *data = GNUNET_malloc (len); | 187 | tmp = GNUNET_malloc (len); |
185 | 188 | ||
186 | if (GNUNET_OK != GNUNET_STRINGS_string_to_data (s, strlen (s), *data, len)) | 189 | if (GNUNET_OK != GNUNET_STRINGS_string_to_data (s, strlen (s), tmp, len)) |
190 | { | ||
191 | GNUNET_free (tmp); | ||
187 | return GNUNET_NO; | 192 | return GNUNET_NO; |
193 | } | ||
194 | *data = tmp; | ||
188 | return GNUNET_OK; | 195 | return GNUNET_OK; |
189 | } | 196 | } |
190 | 197 | ||
@@ -197,7 +204,7 @@ expect_data_dynamic (json_t *vec, | |||
197 | * | 204 | * |
198 | * @returns GNUNET_OK if the vector is okay | 205 | * @returns GNUNET_OK if the vector is okay |
199 | */ | 206 | */ |
200 | static int | 207 | static int |
201 | checkvec (const char *operation, | 208 | checkvec (const char *operation, |
202 | json_t *vec) | 209 | json_t *vec) |
203 | { | 210 | { |
@@ -220,10 +227,11 @@ checkvec (const char *operation, | |||
220 | return GNUNET_SYSERR; | 227 | return GNUNET_SYSERR; |
221 | } | 228 | } |
222 | if (GNUNET_OK != expect_data_fixed (vec, | 229 | if (GNUNET_OK != expect_data_fixed (vec, |
223 | "output", | 230 | "output", |
224 | &hash_out, | 231 | &hash_out, |
225 | sizeof (hash_out))) | 232 | sizeof (hash_out))) |
226 | { | 233 | { |
234 | GNUNET_free (data); | ||
227 | GNUNET_break (0); | 235 | GNUNET_break (0); |
228 | return GNUNET_NO; | 236 | return GNUNET_NO; |
229 | } | 237 | } |
@@ -232,9 +240,11 @@ checkvec (const char *operation, | |||
232 | 240 | ||
233 | if (0 != GNUNET_memcmp (&hc, &hash_out)) | 241 | if (0 != GNUNET_memcmp (&hc, &hash_out)) |
234 | { | 242 | { |
243 | GNUNET_free (data); | ||
235 | GNUNET_break (0); | 244 | GNUNET_break (0); |
236 | return GNUNET_NO; | 245 | return GNUNET_NO; |
237 | } | 246 | } |
247 | GNUNET_free (data); | ||
238 | } | 248 | } |
239 | else if (0 == strcmp (operation, "ecc_ecdh")) | 249 | else if (0 == strcmp (operation, "ecc_ecdh")) |
240 | { | 250 | { |
@@ -245,33 +255,33 @@ checkvec (const char *operation, | |||
245 | struct GNUNET_HashCode skm_comp; | 255 | struct GNUNET_HashCode skm_comp; |
246 | 256 | ||
247 | if (GNUNET_OK != expect_data_fixed (vec, | 257 | if (GNUNET_OK != expect_data_fixed (vec, |
248 | "priv1", | 258 | "priv1", |
249 | &priv1, | 259 | &priv1, |
250 | sizeof (priv1))) | 260 | sizeof (priv1))) |
251 | { | 261 | { |
252 | GNUNET_break (0); | 262 | GNUNET_break (0); |
253 | return GNUNET_NO; | 263 | return GNUNET_NO; |
254 | } | 264 | } |
255 | if (GNUNET_OK != expect_data_fixed (vec, | 265 | if (GNUNET_OK != expect_data_fixed (vec, |
256 | "priv2", | 266 | "priv2", |
257 | &priv2, | 267 | &priv2, |
258 | sizeof (priv2))) | 268 | sizeof (priv2))) |
259 | { | 269 | { |
260 | GNUNET_break (0); | 270 | GNUNET_break (0); |
261 | return GNUNET_NO; | 271 | return GNUNET_NO; |
262 | } | 272 | } |
263 | if (GNUNET_OK != expect_data_fixed (vec, | 273 | if (GNUNET_OK != expect_data_fixed (vec, |
264 | "pub1", | 274 | "pub1", |
265 | &pub1, | 275 | &pub1, |
266 | sizeof (pub1))) | 276 | sizeof (pub1))) |
267 | { | 277 | { |
268 | GNUNET_break (0); | 278 | GNUNET_break (0); |
269 | return GNUNET_NO; | 279 | return GNUNET_NO; |
270 | } | 280 | } |
271 | if (GNUNET_OK != expect_data_fixed (vec, | 281 | if (GNUNET_OK != expect_data_fixed (vec, |
272 | "skm", | 282 | "skm", |
273 | &skm, | 283 | &skm, |
274 | sizeof (skm))) | 284 | sizeof (skm))) |
275 | { | 285 | { |
276 | GNUNET_break (0); | 286 | GNUNET_break (0); |
277 | return GNUNET_NO; | 287 | return GNUNET_NO; |
@@ -407,6 +417,8 @@ checkvec (const char *operation, | |||
407 | &ikm, | 417 | &ikm, |
408 | &ikm_len)) | 418 | &ikm_len)) |
409 | { | 419 | { |
420 | GNUNET_free (out); | ||
421 | GNUNET_free (out_comp); | ||
410 | GNUNET_break (0); | 422 | GNUNET_break (0); |
411 | return GNUNET_SYSERR; | 423 | return GNUNET_SYSERR; |
412 | } | 424 | } |
@@ -416,6 +428,9 @@ checkvec (const char *operation, | |||
416 | &salt, | 428 | &salt, |
417 | &salt_len)) | 429 | &salt_len)) |
418 | { | 430 | { |
431 | GNUNET_free (out); | ||
432 | GNUNET_free (out_comp); | ||
433 | GNUNET_free (ikm); | ||
419 | GNUNET_break (0); | 434 | GNUNET_break (0); |
420 | return GNUNET_SYSERR; | 435 | return GNUNET_SYSERR; |
421 | } | 436 | } |
@@ -425,6 +440,10 @@ checkvec (const char *operation, | |||
425 | &ctx, | 440 | &ctx, |
426 | &ctx_len)) | 441 | &ctx_len)) |
427 | { | 442 | { |
443 | GNUNET_free (out); | ||
444 | GNUNET_free (out_comp); | ||
445 | GNUNET_free (ikm); | ||
446 | GNUNET_free (salt); | ||
428 | GNUNET_break (0); | 447 | GNUNET_break (0); |
429 | return GNUNET_SYSERR; | 448 | return GNUNET_SYSERR; |
430 | } | 449 | } |
@@ -442,10 +461,19 @@ checkvec (const char *operation, | |||
442 | 461 | ||
443 | if (0 != memcmp (out, out_comp, out_len)) | 462 | if (0 != memcmp (out, out_comp, out_len)) |
444 | { | 463 | { |
464 | GNUNET_free (out); | ||
465 | GNUNET_free (out_comp); | ||
466 | GNUNET_free (ikm); | ||
467 | GNUNET_free (salt); | ||
468 | GNUNET_free (ctx); | ||
445 | GNUNET_break (0); | 469 | GNUNET_break (0); |
446 | return GNUNET_NO; | 470 | return GNUNET_NO; |
447 | } | 471 | } |
448 | 472 | GNUNET_free (out); | |
473 | GNUNET_free (out_comp); | ||
474 | GNUNET_free (ikm); | ||
475 | GNUNET_free (salt); | ||
476 | GNUNET_free (ctx); | ||
449 | } | 477 | } |
450 | else if (0 == strcmp (operation, "eddsa_ecdh")) | 478 | else if (0 == strcmp (operation, "eddsa_ecdh")) |
451 | { | 479 | { |
@@ -562,6 +590,7 @@ checkvec (const char *operation, | |||
562 | &public_enc_data, | 590 | &public_enc_data, |
563 | &public_enc_len)) | 591 | &public_enc_len)) |
564 | { | 592 | { |
593 | GNUNET_free (blinded_data); | ||
565 | GNUNET_break (0); | 594 | GNUNET_break (0); |
566 | return GNUNET_SYSERR; | 595 | return GNUNET_SYSERR; |
567 | } | 596 | } |
@@ -571,6 +600,8 @@ checkvec (const char *operation, | |||
571 | &secret_enc_data, | 600 | &secret_enc_data, |
572 | &secret_enc_len)) | 601 | &secret_enc_len)) |
573 | { | 602 | { |
603 | GNUNET_free (blinded_data); | ||
604 | GNUNET_free (public_enc_data); | ||
574 | GNUNET_break (0); | 605 | GNUNET_break (0); |
575 | return GNUNET_SYSERR; | 606 | return GNUNET_SYSERR; |
576 | } | 607 | } |
@@ -580,6 +611,9 @@ checkvec (const char *operation, | |||
580 | &sig_enc_data, | 611 | &sig_enc_data, |
581 | &sig_enc_length)) | 612 | &sig_enc_length)) |
582 | { | 613 | { |
614 | GNUNET_free (blinded_data); | ||
615 | GNUNET_free (public_enc_data); | ||
616 | GNUNET_free (secret_enc_data); | ||
583 | GNUNET_break (0); | 617 | GNUNET_break (0); |
584 | return GNUNET_SYSERR; | 618 | return GNUNET_SYSERR; |
585 | } | 619 | } |
@@ -601,6 +635,11 @@ checkvec (const char *operation, | |||
601 | blinded_data_comp, | 635 | blinded_data_comp, |
602 | blinded_len)) ) | 636 | blinded_len)) ) |
603 | { | 637 | { |
638 | GNUNET_free (blinded_data); | ||
639 | GNUNET_free (public_enc_data); | ||
640 | GNUNET_free (secret_enc_data); | ||
641 | GNUNET_free (sig_enc_data); | ||
642 | GNUNET_free (skey); | ||
604 | GNUNET_break (0); | 643 | GNUNET_break (0); |
605 | return GNUNET_NO; | 644 | return GNUNET_NO; |
606 | } | 645 | } |
@@ -611,14 +650,27 @@ checkvec (const char *operation, | |||
611 | pkey)); | 650 | pkey)); |
612 | public_enc_len = GNUNET_CRYPTO_rsa_public_key_encode (pkey, | 651 | public_enc_len = GNUNET_CRYPTO_rsa_public_key_encode (pkey, |
613 | &public_enc_data); | 652 | &public_enc_data); |
614 | sig_enc_length_comp = GNUNET_CRYPTO_rsa_signature_encode (sig, &sig_enc_data_comp); | 653 | sig_enc_length_comp = GNUNET_CRYPTO_rsa_signature_encode (sig, |
654 | &sig_enc_data_comp); | ||
615 | 655 | ||
616 | if ( (sig_enc_length != sig_enc_length_comp) || | 656 | if ( (sig_enc_length != sig_enc_length_comp) || |
617 | (0 != memcmp (sig_enc_data, sig_enc_data_comp, sig_enc_length) )) | 657 | (0 != memcmp (sig_enc_data, sig_enc_data_comp, sig_enc_length) )) |
618 | { | 658 | { |
659 | GNUNET_free (blinded_sig); | ||
660 | GNUNET_free (blinded_data); | ||
661 | GNUNET_free (public_enc_data); | ||
662 | GNUNET_free (secret_enc_data); | ||
663 | GNUNET_free (sig_enc_data); | ||
664 | GNUNET_free (skey); | ||
619 | GNUNET_break (0); | 665 | GNUNET_break (0); |
620 | return GNUNET_NO; | 666 | return GNUNET_NO; |
621 | } | 667 | } |
668 | GNUNET_free (blinded_sig); | ||
669 | GNUNET_free (blinded_data); | ||
670 | GNUNET_free (public_enc_data); | ||
671 | GNUNET_free (secret_enc_data); | ||
672 | GNUNET_free (sig_enc_data); | ||
673 | GNUNET_free (skey); | ||
622 | } | 674 | } |
623 | else | 675 | else |
624 | { | 676 | { |
@@ -629,6 +681,7 @@ checkvec (const char *operation, | |||
629 | return GNUNET_OK; | 681 | return GNUNET_OK; |
630 | } | 682 | } |
631 | 683 | ||
684 | |||
632 | /** | 685 | /** |
633 | * Check test vectors from stdin. | 686 | * Check test vectors from stdin. |
634 | * | 687 | * |
@@ -656,7 +709,7 @@ check_vectors () | |||
656 | return 1; | 709 | return 1; |
657 | } | 710 | } |
658 | vectors = json_object_get (vecfile, "vectors"); | 711 | vectors = json_object_get (vecfile, "vectors"); |
659 | if (!json_is_array (vectors)) | 712 | if (! json_is_array (vectors)) |
660 | { | 713 | { |
661 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "bad vectors\n"); | 714 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "bad vectors\n"); |
662 | json_decref (vecfile); | 715 | json_decref (vecfile); |
@@ -692,6 +745,7 @@ check_vectors () | |||
692 | } | 745 | } |
693 | } | 746 | } |
694 | 747 | ||
748 | |||
695 | /** | 749 | /** |
696 | * Output test vectors. | 750 | * Output test vectors. |
697 | * | 751 | * |
@@ -868,20 +922,20 @@ output_vectors () | |||
868 | GNUNET_CRYPTO_ecdh_eddsa (&priv_ecdhe, &pub_eddsa, &key_material); | 922 | GNUNET_CRYPTO_ecdh_eddsa (&priv_ecdhe, &pub_eddsa, &key_material); |
869 | 923 | ||
870 | d2j (vec, "priv_ecdhe", | 924 | d2j (vec, "priv_ecdhe", |
871 | &priv_ecdhe, | 925 | &priv_ecdhe, |
872 | sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey)); | 926 | sizeof (struct GNUNET_CRYPTO_EcdhePrivateKey)); |
873 | d2j (vec, "pub_ecdhe", | 927 | d2j (vec, "pub_ecdhe", |
874 | &pub_ecdhe, | 928 | &pub_ecdhe, |
875 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); | 929 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); |
876 | d2j (vec, "priv_eddsa", | 930 | d2j (vec, "priv_eddsa", |
877 | &priv_eddsa, | 931 | &priv_eddsa, |
878 | sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)); | 932 | sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)); |
879 | d2j (vec, "pub_eddsa", | 933 | d2j (vec, "pub_eddsa", |
880 | &pub_eddsa, | 934 | &pub_eddsa, |
881 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)); | 935 | sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)); |
882 | d2j (vec, "key_material", | 936 | d2j (vec, "key_material", |
883 | &key_material, | 937 | &key_material, |
884 | sizeof (struct GNUNET_HashCode)); | 938 | sizeof (struct GNUNET_HashCode)); |
885 | } | 939 | } |
886 | 940 | ||
887 | { | 941 | { |
@@ -968,6 +1022,7 @@ output_vectors () | |||
968 | GNUNET_free (blinded_data); | 1022 | GNUNET_free (blinded_data); |
969 | GNUNET_free (sig_enc_data); | 1023 | GNUNET_free (sig_enc_data); |
970 | GNUNET_free (blinded_sig_enc_data); | 1024 | GNUNET_free (blinded_sig_enc_data); |
1025 | GNUNET_free (secret_enc_data); | ||
971 | } | 1026 | } |
972 | 1027 | ||
973 | json_dumpf (vecfile, stdout, JSON_INDENT (2)); | 1028 | json_dumpf (vecfile, stdout, JSON_INDENT (2)); |
@@ -977,6 +1032,7 @@ output_vectors () | |||
977 | return 0; | 1032 | return 0; |
978 | } | 1033 | } |
979 | 1034 | ||
1035 | |||
980 | /** | 1036 | /** |
981 | * Main function that will be run. | 1037 | * Main function that will be run. |
982 | * | 1038 | * |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index d1e5e0da5..02d4d439d 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -736,7 +736,12 @@ GNUNET_OS_get_suid_binary_path (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
736 | "SUID_BINARY_PATH", | 736 | "SUID_BINARY_PATH", |
737 | &path); | 737 | &path); |
738 | if ((NULL == path) || (0 == strlen (path))) | 738 | if ((NULL == path) || (0 == strlen (path))) |
739 | { | ||
740 | if (NULL != path) | ||
741 | GNUNET_free (path); | ||
742 | cache = NULL; | ||
739 | return GNUNET_OS_get_libexec_binary_path (progname); | 743 | return GNUNET_OS_get_libexec_binary_path (progname); |
744 | } | ||
740 | path_len = strlen (path); | 745 | path_len = strlen (path); |
741 | GNUNET_asprintf (&binary, | 746 | GNUNET_asprintf (&binary, |
742 | "%s%s%s", | 747 | "%s%s%s", |