diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-23 21:39:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-23 21:39:07 +0000 |
commit | 6b1c16cc8dc30d1718d9bb2c8ad262c24dc41073 (patch) | |
tree | f3929377c47a57d4e519cd31c6f1b6aabd21d5e2 /src/core | |
parent | 0853cb6f86c1c5e3c48520089d7a274aadb7fade (diff) | |
download | gnunet-6b1c16cc8dc30d1718d9bb2c8ad262c24dc41073.tar.gz gnunet-6b1c16cc8dc30d1718d9bb2c8ad262c24dc41073.zip |
-fix tiny leak, doxygen
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index f6b64f367..e5e8d54aa 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c | |||
@@ -1274,7 +1274,7 @@ GSC_KX_encrypt_and_transmit (struct GSC_KeyExchangeInfo *kx, | |||
1274 | 1274 | ||
1275 | 1275 | ||
1276 | /** | 1276 | /** |
1277 | * Closure for 'deliver_message' | 1277 | * Closure for #deliver_message() |
1278 | */ | 1278 | */ |
1279 | struct DeliverMessageContext | 1279 | struct DeliverMessageContext |
1280 | { | 1280 | { |
@@ -1320,7 +1320,7 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1320 | return; | 1320 | return; |
1321 | } | 1321 | } |
1322 | m = (const struct EncryptedMessage *) msg; | 1322 | m = (const struct EncryptedMessage *) msg; |
1323 | if (kx->status != KX_STATE_UP) | 1323 | if (KX_STATE_UP != kx->status) |
1324 | { | 1324 | { |
1325 | GNUNET_STATISTICS_update (GSC_stats, | 1325 | GNUNET_STATISTICS_update (GSC_stats, |
1326 | gettext_noop | 1326 | gettext_noop |
@@ -1365,8 +1365,10 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1365 | do_decrypt (kx, &iv, &m->sequence_number, &buf[ENCRYPTED_HEADER_SIZE], | 1365 | do_decrypt (kx, &iv, &m->sequence_number, &buf[ENCRYPTED_HEADER_SIZE], |
1366 | size - ENCRYPTED_HEADER_SIZE)) | 1366 | size - ENCRYPTED_HEADER_SIZE)) |
1367 | return; | 1367 | return; |
1368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decrypted %u bytes from %s\n", | 1368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1369 | size - ENCRYPTED_HEADER_SIZE, GNUNET_i2s (&kx->peer)); | 1369 | "Decrypted %u bytes from %s\n", |
1370 | size - ENCRYPTED_HEADER_SIZE, | ||
1371 | GNUNET_i2s (&kx->peer)); | ||
1370 | pt = (struct EncryptedMessage *) buf; | 1372 | pt = (struct EncryptedMessage *) buf; |
1371 | 1373 | ||
1372 | /* validate sequence number */ | 1374 | /* validate sequence number */ |
@@ -1427,7 +1429,8 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1427 | { | 1429 | { |
1428 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1430 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1429 | "Message received far too old (%s). Content ignored.\n", | 1431 | "Message received far too old (%s). Content ignored.\n", |
1430 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (t), GNUNET_YES)); | 1432 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (t), |
1433 | GNUNET_YES)); | ||
1431 | GNUNET_STATISTICS_update (GSC_stats, | 1434 | GNUNET_STATISTICS_update (GSC_stats, |
1432 | gettext_noop | 1435 | gettext_noop |
1433 | ("# bytes dropped (ancient message)"), size, | 1436 | ("# bytes dropped (ancient message)"), size, |
@@ -1439,14 +1442,16 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1439 | update_timeout (kx); | 1442 | update_timeout (kx); |
1440 | GNUNET_STATISTICS_update (GSC_stats, | 1443 | GNUNET_STATISTICS_update (GSC_stats, |
1441 | gettext_noop ("# bytes of payload decrypted"), | 1444 | gettext_noop ("# bytes of payload decrypted"), |
1442 | size - sizeof (struct EncryptedMessage), GNUNET_NO); | 1445 | size - sizeof (struct EncryptedMessage), |
1446 | GNUNET_NO); | ||
1443 | dmc.kx = kx; | 1447 | dmc.kx = kx; |
1444 | dmc.peer = &kx->peer; | 1448 | dmc.peer = &kx->peer; |
1445 | if (GNUNET_OK != | 1449 | if (GNUNET_OK != |
1446 | GNUNET_SERVER_mst_receive (mst, &dmc, | 1450 | GNUNET_SERVER_mst_receive (mst, &dmc, |
1447 | &buf[sizeof (struct EncryptedMessage)], | 1451 | &buf[sizeof (struct EncryptedMessage)], |
1448 | size - sizeof (struct EncryptedMessage), | 1452 | size - sizeof (struct EncryptedMessage), |
1449 | GNUNET_YES, GNUNET_NO)) | 1453 | GNUNET_YES, |
1454 | GNUNET_NO)) | ||
1450 | GNUNET_break_op (0); | 1455 | GNUNET_break_op (0); |
1451 | } | 1456 | } |
1452 | 1457 | ||
@@ -1461,7 +1466,9 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1461 | * @param m the message | 1466 | * @param m the message |
1462 | */ | 1467 | */ |
1463 | static int | 1468 | static int |
1464 | deliver_message (void *cls, void *client, const struct GNUNET_MessageHeader *m) | 1469 | deliver_message (void *cls, |
1470 | void *client, | ||
1471 | const struct GNUNET_MessageHeader *m) | ||
1465 | { | 1472 | { |
1466 | struct DeliverMessageContext *dmc = client; | 1473 | struct DeliverMessageContext *dmc = client; |
1467 | 1474 | ||
@@ -1568,7 +1575,6 @@ do_rekey (void *cls, | |||
1568 | int | 1575 | int |
1569 | GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk) | 1576 | GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk) |
1570 | { | 1577 | { |
1571 | GNUNET_assert (NULL != pk); | ||
1572 | my_private_key = pk; | 1578 | my_private_key = pk; |
1573 | GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, | 1579 | GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, |
1574 | &GSC_my_identity.public_key); | 1580 | &GSC_my_identity.public_key); |