gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: comment on JSON canonicalization


From: gnunet
Subject: [taler-exchange] branch master updated: comment on JSON canonicalization
Date: Sun, 19 Jan 2020 21:18:05 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new c48e4a8a comment on JSON canonicalization
c48e4a8a is described below

commit c48e4a8a06f5554ff484f1a60c8e5673e70a897a
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 19 21:18:03 2020 +0100

    comment on JSON canonicalization
---
 src/include/taler_json_lib.h | 6 ++++++
 src/json/json.c              | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index be98f2a7..d5f6b0ba 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -107,6 +107,12 @@ TALER_JSON_spec_denomination_signature (const char *field,
 /**
  * Hash a JSON for binary signing.
  *
+ * See 
https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-15
+ * for fun JSON canonicalization problems.  Callers must ensure that
+ * those are avoided in the input. We will use libjanson's "JSON_COMPACT"
+ * encoding for whitespace and "JSON_SORT_KEYS" to canonicalize as best
+ * as we can.
+ *
  * @param[in] json some JSON value to hash
  * @param[out] hc resulting hash code
  * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
diff --git a/src/json/json.c b/src/json/json.c
index 688086a5..807ea0b6 100644
--- a/src/json/json.c
+++ b/src/json/json.c
@@ -25,7 +25,13 @@
 
 
 /**
- * Hash a JSON for binary signing.
+ * Hash a JSON object for binary signing.
+ *
+ * See 
https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-15
+ * for fun JSON canonicalization problems.  Callers must ensure that
+ * those are avoided in the input. We will use libjanson's "JSON_COMPACT"
+ * encoding for whitespace and "JSON_SORT_KEYS" to canonicalize as best
+ * as we can.
  *
  * @param[in] json some JSON value
  * @param[out] hc resulting hash code

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]