aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_hash.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-23 16:41:30 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-23 16:41:30 +0000
commit151acb7d8657724bcb2334b636aa3aefc8273ddf (patch)
tree6c1b0edc0ce822528a6691925046bed56b979cb0 /src/util/crypto_hash.c
parentf3771e363a6ef1e580ea1a67c2498f36ba2ce83e (diff)
downloadgnunet-151acb7d8657724bcb2334b636aa3aefc8273ddf.tar.gz
gnunet-151acb7d8657724bcb2334b636aa3aefc8273ddf.zip
TG: attached are the following patches for GNUnet:
- 1: added GNUNET_i2s_full - full variant of GNUNET_i2s - 2: GNUNET_CRYPTO_hash_from_string2 with additional length parameter, useful to prevent an additional strlen call when the caller already knows the length - 3: custom mst callbacks for the server, enables using the server with a custom parser - 4: added GNUNET_SERVER_client_set_finish_pending_write - enables changing the server behavior to finish pending writes when closing the connection Best regards, Gabor Adam Toth
Diffstat (limited to 'src/util/crypto_hash.c')
-rw-r--r--src/util/crypto_hash.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 0350df545..976c59992 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -322,7 +322,8 @@ GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
322 * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding 322 * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding
323 */ 323 */
324int 324int
325GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result) 325GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen,
326 GNUNET_HashCode * result)
326{ 327{
327 unsigned int rpos; 328 unsigned int rpos;
328 unsigned int wpos; 329 unsigned int wpos;
@@ -330,7 +331,7 @@ GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result)
330 unsigned int vbit; 331 unsigned int vbit;
331 int ret; 332 int ret;
332 333
333 if (strlen (enc) != sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1) 334 if (enclen != sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1)
334 return GNUNET_SYSERR; 335 return GNUNET_SYSERR;
335 336
336 vbit = 2; /* padding! */ 337 vbit = 2; /* padding! */