add version to keydata returned by libtalerexchange (#5035)

This commit is contained in:
Christian Grothoff 2017-06-01 23:00:06 +02:00
parent fdec8e482e
commit b217058821
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 14 additions and 0 deletions

View File

@ -503,7 +503,10 @@ decode_keys_json (const json_t *resp_obj,
hash_context = GNUNET_CRYPTO_hash_context_start (); hash_context = GNUNET_CRYPTO_hash_context_start ();
/* parse the master public key and issue date of the response */ /* parse the master public key and issue date of the response */
{ {
const char *ver;
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("version",
&ver),
GNUNET_JSON_spec_fixed_auto ("master_public_key", GNUNET_JSON_spec_fixed_auto ("master_public_key",
&key_data->master_pub), &key_data->master_pub),
GNUNET_JSON_spec_fixed_auto ("eddsa_sig", GNUNET_JSON_spec_fixed_auto ("eddsa_sig",
@ -519,6 +522,7 @@ decode_keys_json (const json_t *resp_obj,
GNUNET_JSON_parse (resp_obj, GNUNET_JSON_parse (resp_obj,
spec, spec,
NULL, NULL)); NULL, NULL));
key_data->version = GNUNET_strdup (ver);
} }
/* parse the signing keys */ /* parse the signing keys */
@ -643,6 +647,8 @@ free_key_data (struct TALER_EXCHANGE_Keys *key_data)
GNUNET_array_grow (key_data->auditors, GNUNET_array_grow (key_data->auditors,
key_data->num_auditors, key_data->num_auditors,
0); 0);
GNUNET_free_non_null (key_data->version);
key_data->version = NULL;
} }

View File

@ -197,6 +197,14 @@ struct TALER_EXCHANGE_Keys
*/ */
struct TALER_EXCHANGE_AuditorInformation *auditors; struct TALER_EXCHANGE_AuditorInformation *auditors;
/**
* Supported Taler protocol version by the exchange.
* String in the format current:revision:age using the
* semantics of GNU libtool. See
* https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning
*/
char *version;
/** /**
* Length of the @e sign_keys array. * Length of the @e sign_keys array.
*/ */