[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13181 - in gnunet/src: block include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13181 - in gnunet/src: block include |
Date: |
Wed, 6 Oct 2010 13:17:16 +0200 |
Author: grothoff
Date: 2010-10-06 13:17:16 +0200 (Wed, 06 Oct 2010)
New Revision: 13181
Modified:
gnunet/src/block/plugin_block_dht.c
gnunet/src/block/plugin_block_fs.c
gnunet/src/include/gnunet_block_lib.h
Log:
indicate malformed blocks
Modified: gnunet/src/block/plugin_block_dht.c
===================================================================
--- gnunet/src/block/plugin_block_dht.c 2010-10-06 11:16:35 UTC (rev 13180)
+++ gnunet/src/block/plugin_block_dht.c 2010-10-06 11:17:16 UTC (rev 13181)
@@ -104,7 +104,7 @@
"block-dht",
_("Block not of type %u\n"),
GNUNET_BLOCK_TYPE_DHT_HELLO);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
msg = block;
if (block_size != ntohs (msg->size))
@@ -113,7 +113,7 @@
"block-dht",
_("Size mismatch for block\n"),
GNUNET_BLOCK_TYPE_DHT_HELLO);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
hello = block;
pid = (struct GNUNET_PeerIdentity*) key;
@@ -125,7 +125,7 @@
"block-dht",
_("Block of type %u is malformed\n"),
GNUNET_BLOCK_TYPE_DHT_HELLO);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
return GNUNET_OK;
}
Modified: gnunet/src/block/plugin_block_fs.c
===================================================================
--- gnunet/src/block/plugin_block_fs.c 2010-10-06 11:16:35 UTC (rev 13180)
+++ gnunet/src/block/plugin_block_fs.c 2010-10-06 11:17:16 UTC (rev 13181)
@@ -194,7 +194,7 @@
if (block_size < sizeof (struct KBlock))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
kb = block;
if (block_size - sizeof (struct KBlock) !=
@@ -203,7 +203,7 @@
- sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) )
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (GNUNET_OK !=
GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_KBLOCK,
@@ -212,7 +212,7 @@
&kb->keyspace))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (key != NULL)
GNUNET_CRYPTO_hash (&kb->keyspace,
@@ -223,14 +223,14 @@
if (block_size < sizeof (struct SBlock))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
sb = block;
if (block_size !=
ntohl (sb->purpose.size) + sizeof (struct GNUNET_CRYPTO_RsaSignature))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (GNUNET_OK !=
GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_SBLOCK,
@@ -239,7 +239,7 @@
&sb->subspace))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (key != NULL)
*key = sb->identifier;
@@ -248,7 +248,7 @@
if (block_size < sizeof (struct NBlock))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
nb = block;
if (block_size - sizeof (struct NBlock) !=
@@ -257,13 +257,13 @@
- sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) )
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (block_size !=
ntohl (nb->ksk_purpose.size) + sizeof (struct
GNUNET_CRYPTO_RsaSignature))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (GNUNET_OK !=
GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_NBLOCK_KSIG,
@@ -272,7 +272,7 @@
&nb->keyspace))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
if (GNUNET_OK !=
GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_FS_NBLOCK,
@@ -281,7 +281,7 @@
&nb->subspace))
{
GNUNET_break_op (0);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
/* FIXME: we used to xor ID with NSID,
why not here? */
Modified: gnunet/src/include/gnunet_block_lib.h
===================================================================
--- gnunet/src/include/gnunet_block_lib.h 2010-10-06 11:16:35 UTC (rev
13180)
+++ gnunet/src/include/gnunet_block_lib.h 2010-10-06 11:17:16 UTC (rev
13181)
@@ -219,7 +219,7 @@
* @param block_size number of bytes in block
* @param key set to the key (query) for the given block
* @return GNUNET_OK on success,
- * GNUNET_NO if the block is malformed, FIXME: cg!
+ * GNUNET_NO if the block is malformed
* GNUNET_SYSERR if type not supported
* (or if extracting a key from a block of this type does not work)
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13181 - in gnunet/src: block include,
gnunet <=