diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-03-21 14:40:59 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-03-21 14:40:59 +0100 |
commit | 6a80c0bfa2da80a8f1efd600ee3c94f31d31b21d (patch) | |
tree | 42e06c619a46fb11bb602e94cb46707c40a93083 /src/exchange-tools/taler-auditor-sign.c | |
parent | 3cb188e8a7ffa30a6b264355011f45f594725741 (diff) | |
parent | 553d6eb23e3ac1001dd6c4e0523cddb88bc5e723 (diff) |
Merge branch 'master' of git+ssh://git.taler.net/var/git/exchange
Diffstat (limited to 'src/exchange-tools/taler-auditor-sign.c')
-rw-r--r-- | src/exchange-tools/taler-auditor-sign.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/exchange-tools/taler-auditor-sign.c b/src/exchange-tools/taler-auditor-sign.c index e4821f411..bde34b2a3 100644 --- a/src/exchange-tools/taler-auditor-sign.c +++ b/src/exchange-tools/taler-auditor-sign.c @@ -50,6 +50,11 @@ static char *exchange_request_file; static char *output_file; /** + * URL of the auditor (informative for the user). + */ +static char *auditor_url; + +/** * Master public key of the exchange. */ static struct TALER_MasterPublicKeyP master_public_key; @@ -134,6 +139,10 @@ main (int argc, {'m', "exchange-key", "KEY", "public key of the exchange (Crockford base32 encoded)", 1, &GNUNET_GETOPT_set_filename, &exchange_public_key}, + {'u', "auditor-url", "URL", + "URL of the auditor (informative link for the user)", 1, + &GNUNET_GETOPT_set_string, &auditor_url}, + TALER_GETOPT_OPTION_HELP ("Private key of the auditor to use for signing"), {'r', "exchange-request", "FILE", "set of keys the exchange requested the auditor to sign", 1, &GNUNET_GETOPT_set_string, &exchange_request_file}, @@ -168,6 +177,12 @@ main (int argc, "Auditor key file not given\n"); return 1; } + if (NULL == auditor_url) + { + fprintf (stderr, + "Auditor URL not given\n"); + return 1; + } eddsa_priv = GNUNET_CRYPTO_eddsa_key_create_from_file (auditor_key_file); if (NULL == eddsa_priv) { @@ -240,6 +255,9 @@ main (int argc, dks_len = in_size / sizeof (struct TALER_DenominationKeyValidityPS); kv.purpose.purpose = htonl (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS); kv.purpose.size = htonl (sizeof (struct TALER_ExchangeKeyValidityPS)); + GNUNET_CRYPTO_hash (auditor_url, + strlen (auditor_url) + 1, + &kv.auditor_url_hash); kv.master = master_public_key; dks = GNUNET_new_array (dks_len, struct TALER_DenominationKeyValidityPS); @@ -281,8 +299,6 @@ main (int argc, GNUNET_CRYPTO_eddsa_sign (eddsa_priv, &kv.purpose, &sigs[i].eddsa_sig); - - } if (NULL == output_file) @@ -298,11 +314,12 @@ main (int argc, /* write result to disk */ if (GNUNET_OK != TALER_EXCHANGEDB_auditor_write (output_file, - &apub, - sigs, - &master_public_key, - dks_len, - dks)) + &apub, + auditor_url, + sigs, + &master_public_key, + dks_len, + dks)) { fprintf (stderr, "Failed to write to file `%s': %s\n", |