diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-08-08 12:46:00 -0400 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-08-08 12:46:00 -0400 |
commit | 673aab5ba24acf91961972b71ae2b92f5ffe4b83 (patch) | |
tree | 0b179efbaf6061156761b83036eb922be9956705 /node/Dictionary.hpp | |
parent | 77457cbff14546a6b6173a46c0486767dab60847 (diff) | |
download | infinitytier-673aab5ba24acf91961972b71ae2b92f5ffe4b83.tar.gz infinitytier-673aab5ba24acf91961972b71ae2b92f5ffe4b83.zip |
Fix an oversight in signed dictionaries: the timestamp and signing identity should themselves be part of the signature. Also include the raw dictionary in addition to the bin2c version in root-topology/
Diffstat (limited to 'node/Dictionary.hpp')
-rw-r--r-- | node/Dictionary.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/node/Dictionary.hpp b/node/Dictionary.hpp index 31930eff..22eb8a7e 100644 --- a/node/Dictionary.hpp +++ b/node/Dictionary.hpp @@ -51,8 +51,7 @@ class Identity; * human-readable if the keys and values in the dictionary are also * human-readable. Otherwise it might contain unprintable characters. * - * Keys beginning with "~!" are reserved for signatures and are ignored - * during the signature process. + * Keys beginning with "~!" are reserved for signature data fields. * * Note: the signature code depends on std::map<> being sorted, but no * other code does. So if the underlying data structure is ever swapped @@ -66,13 +65,14 @@ public: /** * @param s String-serialized dictionary + * @param maxlen Maximum length of buffer */ - Dictionary(const char *s) { fromString(s); } + Dictionary(const char *s,unsigned int maxlen) { fromString(s,maxlen); } /** * @param s String-serialized dictionary */ - Dictionary(const std::string &s) { fromString(s.c_str()); } + Dictionary(const std::string &s) { fromString(s.c_str(),(unsigned int)s.length()); } /** * Get a key, throwing an exception if it is not present @@ -130,9 +130,10 @@ public: * Clear and initialize from a string * * @param s String-serialized dictionary + * @param maxlen Maximum length of string buffer */ - void fromString(const char *s); - inline void fromString(const std::string &s) { fromString(s.c_str()); } + void fromString(const char *s,unsigned int maxlen); + inline void fromString(const std::string &s) { fromString(s.c_str(),(unsigned int)s.length()); } /** * @return True if this dictionary is cryptographically signed |