diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-04-13 08:52:15 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-04-13 08:53:19 +0200 |
commit | 6516ced3f6bdbedb43a40023f3336097662bfc03 (patch) | |
tree | cdc8a856907bc442b9899fb86c193228c2a1875b /src | |
parent | b0cda372fb2412459e0462c18b4e9f70ca7992ab (diff) | |
download | anastasis-6516ced3f6bdbedb43a40023f3336097662bfc03.tar.gz anastasis-6516ced3f6bdbedb43a40023f3336097662bfc03.tar.bz2 anastasis-6516ced3f6bdbedb43a40023f3336097662bfc03.zip |
-rename fest for #7045
Diffstat (limited to 'src')
36 files changed, 144 insertions, 135 deletions
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c index 4428851..16e2a08 100644 --- a/src/backend/anastasis-httpd.c +++ b/src/backend/anastasis-httpd.c @@ -88,9 +88,9 @@ char *AH_fulfillment_url; char *AH_business_name; /** - * Our server salt. + * Our provider salt. */ -struct ANASTASIS_CRYPTO_ProviderSaltP AH_server_salt; +struct ANASTASIS_CRYPTO_ProviderSaltP AH_provider_salt; /** * Number of policy uploads permitted per annual fee payment. @@ -866,30 +866,30 @@ run (void *cls, return; } { - char *server_salt; + char *provider_salt; if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (config, "anastasis", - "SERVER_SALT", - &server_salt)) + "PROVIDER_SALT", + &provider_salt)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "anastasis", - "SERVER_SALT"); + "PROVIDER_SALT"); GNUNET_SCHEDULER_shutdown (); return; } GNUNET_assert (GNUNET_YES == - GNUNET_CRYPTO_kdf (&AH_server_salt, - sizeof (AH_server_salt), - "anastasis-server-salt", - strlen ("anastasis-server-salt"), - server_salt, - strlen (server_salt), + GNUNET_CRYPTO_kdf (&AH_provider_salt, + sizeof (AH_provider_salt), + "anastasis-provider-salt", + strlen ("anastasis-provider-salt"), + provider_salt, + strlen (provider_salt), NULL, 0)); - GNUNET_free (server_salt); + GNUNET_free (provider_salt); } /* setup HTTP client event loop */ diff --git a/src/backend/anastasis-httpd.h b/src/backend/anastasis-httpd.h index 33e0504..8cc96b2 100644 --- a/src/backend/anastasis-httpd.h +++ b/src/backend/anastasis-httpd.h @@ -205,9 +205,9 @@ extern char *AH_fulfillment_url; extern char *AH_business_name; /** - * Our server salt. + * Our provider salt. */ -extern struct ANASTASIS_CRYPTO_ProviderSaltP AH_server_salt; +extern struct ANASTASIS_CRYPTO_ProviderSaltP AH_provider_salt; /** * Our context for making HTTP requests. diff --git a/src/backend/anastasis-httpd_config.c b/src/backend/anastasis-httpd_config.c index 19c1e7b..adabffb 100644 --- a/src/backend/anastasis-httpd_config.c +++ b/src/backend/anastasis-httpd_config.c @@ -118,8 +118,8 @@ AH_handler_config (struct AH_RequestHandler *rh, &AH_truth_upload_fee), TALER_JSON_pack_amount ("liability_limit", &AH_insurance), - GNUNET_JSON_pack_data_auto ("server_salt", - &AH_server_salt)); + GNUNET_JSON_pack_data_auto ("provider_salt", + &AH_provider_salt)); } diff --git a/src/backend/anastasis.conf b/src/backend/anastasis.conf index ad85be2..4721760 100644 --- a/src/backend/anastasis.conf +++ b/src/backend/anastasis.conf @@ -49,7 +49,7 @@ UPLOAD_LIMIT_MB = 16 FULFILLMENT_URL = taler://fulfillment-success # Server salt 16 Byte -# SERVER_SALT = gUfO1KGOKYIFlFQg +# PROVIDER_SALT = gUfO1KGOKYIFlFQg # Directory with our terms of service. diff --git a/src/cli/resources/00-backup.json b/src/cli/resources/00-backup.json index 6e6c320..6aa0311 100644 --- a/src/cli/resources/00-backup.json +++ b/src/cli/resources/00-backup.json @@ -4,5 +4,6 @@ "North America", "Testcontinent" ], - "backup_state": "CONTINENT_SELECTING" -}
\ No newline at end of file + "backup_state": "CONTINENT_SELECTING", + "reducer_type": "backup" +} diff --git a/src/cli/resources/00-recovery.json b/src/cli/resources/00-recovery.json index acff19a..e9b14f3 100644 --- a/src/cli/resources/00-recovery.json +++ b/src/cli/resources/00-recovery.json @@ -4,5 +4,6 @@ "North America", "Testcontinent" ], + "reducer_type": "recovery", "recovery_state": "CONTINENT_SELECTING" -}
\ No newline at end of file +} diff --git a/src/cli/resources/01-backup.json b/src/cli/resources/01-backup.json index 842d3af..8bd2e93 100644 --- a/src/cli/resources/01-backup.json +++ b/src/cli/resources/01-backup.json @@ -5,6 +5,7 @@ "Testcontinent" ], "backup_state": "COUNTRY_SELECTING", + "reducer_type": "backup", "selected_continent": "Testcontinent", "countries": [ { @@ -38,4 +39,4 @@ "currency": "KUDOS" } ] -}
\ No newline at end of file +} diff --git a/src/cli/resources/01-recovery.json b/src/cli/resources/01-recovery.json index 11aafd3..5489814 100644 --- a/src/cli/resources/01-recovery.json +++ b/src/cli/resources/01-recovery.json @@ -5,6 +5,7 @@ "Testcontinent" ], "recovery_state": "COUNTRY_SELECTING", + "reducer_type": "recovery", "selected_continent": "Testcontinent", "countries": [ { @@ -38,4 +39,4 @@ "currency": "KUDOS" } ] -}
\ No newline at end of file +} diff --git a/src/cli/resources/02-backup.json b/src/cli/resources/02-backup.json index c9bba16..67df7e0 100644 --- a/src/cli/resources/02-backup.json +++ b/src/cli/resources/02-backup.json @@ -5,6 +5,7 @@ "Testcontinent" ], "backup_state": "USER_ATTRIBUTES_COLLECTING", + "reducer_type": "backup", "selected_continent": "Testcontinent", "countries": [ { diff --git a/src/cli/resources/02-recovery.json b/src/cli/resources/02-recovery.json index 79cfd6d..e77ed0c 100644 --- a/src/cli/resources/02-recovery.json +++ b/src/cli/resources/02-recovery.json @@ -5,6 +5,7 @@ "Testcontinent" ], "recovery_state": "USER_ATTRIBUTES_COLLECTING", + "reducer_type": "recovery", "selected_continent": "Testcontinent", "countries": [ { diff --git a/src/cli/resources/03-backup.json b/src/cli/resources/03-backup.json index 4dd5368..ad9d23b 100644 --- a/src/cli/resources/03-backup.json +++ b/src/cli/resources/03-backup.json @@ -5,6 +5,7 @@ "Testcontinent" ], "backup_state": "AUTHENTICATIONS_EDITING", + "reducer_type": "backup", "selected_continent": "Testcontinent", "countries": [ { @@ -55,7 +56,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #1 Inc.", "storage_limit_in_megabytes": 1, - "salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", + "provider_salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", "http_status": 200 }, "http://localhost:8087/": { @@ -74,7 +75,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #2 Inc.", "storage_limit_in_megabytes": 1, - "salt": "D378FWXHJB8JHPQFQRZGGV9PWG", + "provider_salt": "D378FWXHJB8JHPQFQRZGGV9PWG", "http_status": 200 }, "http://localhost:8088/": { @@ -93,7 +94,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #3 Inc.", "storage_limit_in_megabytes": 1, - "salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", + "provider_salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", "http_status": 200 }, "http://localhost:8089/": { @@ -112,7 +113,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #4 Inc.", "storage_limit_in_megabytes": 1, - "salt": "PN0VJF6KDSBYN40SGRCEXPB07M", + "provider_salt": "PN0VJF6KDSBYN40SGRCEXPB07M", "http_status": 200 } }, diff --git a/src/cli/resources/04-backup.json b/src/cli/resources/04-backup.json index db51f5a..34cabfd 100644 --- a/src/cli/resources/04-backup.json +++ b/src/cli/resources/04-backup.json @@ -5,6 +5,7 @@ "Testcontinent" ], "backup_state": "AUTHENTICATIONS_EDITING", + "reducer_type": "backup", "selected_continent": "Testcontinent", "countries": [ { @@ -55,7 +56,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #1 Inc.", "storage_limit_in_megabytes": 1, - "salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", + "provider_salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", "http_status": 200 }, "http://localhost:8087/": { @@ -74,7 +75,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #2 Inc.", "storage_limit_in_megabytes": 1, - "salt": "D378FWXHJB8JHPQFQRZGGV9PWG", + "provider_salt": "D378FWXHJB8JHPQFQRZGGV9PWG", "http_status": 200 }, "http://localhost:8088/": { @@ -93,7 +94,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #3 Inc.", "storage_limit_in_megabytes": 1, - "salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", + "provider_salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", "http_status": 200 }, "http://localhost:8089/": { @@ -112,7 +113,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #4 Inc.", "storage_limit_in_megabytes": 1, - "salt": "PN0VJF6KDSBYN40SGRCEXPB07M", + "provider_salt": "PN0VJF6KDSBYN40SGRCEXPB07M", "http_status": 200 } }, diff --git a/src/cli/resources/05-backup.json b/src/cli/resources/05-backup.json index 143d9e3..bb988be 100644 --- a/src/cli/resources/05-backup.json +++ b/src/cli/resources/05-backup.json @@ -5,6 +5,7 @@ "Testcontinent" ], "backup_state": "POLICIES_REVIEWING", + "reducer_type": "backup", "selected_continent": "Testcontinent", "countries": [ { @@ -55,7 +56,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #1 Inc.", "storage_limit_in_megabytes": 1, - "salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", + "provider_salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", "http_status": 200 }, "http://localhost:8087/": { @@ -74,7 +75,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #2 Inc.", "storage_limit_in_megabytes": 1, - "salt": "D378FWXHJB8JHPQFQRZGGV9PWG", + "provider_salt": "D378FWXHJB8JHPQFQRZGGV9PWG", "http_status": 200 }, "http://localhost:8088/": { @@ -93,7 +94,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #3 Inc.", "storage_limit_in_megabytes": 1, - "salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", + "provider_salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", "http_status": 200 }, "http://localhost:8089/": { @@ -112,7 +113,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #4 Inc.", "storage_limit_in_megabytes": 1, - "salt": "PN0VJF6KDSBYN40SGRCEXPB07M", + "provider_salt": "PN0VJF6KDSBYN40SGRCEXPB07M", "http_status": 200 } }, diff --git a/src/cli/resources/06-backup.json b/src/cli/resources/06-backup.json index 9944a17..23a8927 100644 --- a/src/cli/resources/06-backup.json +++ b/src/cli/resources/06-backup.json @@ -5,6 +5,7 @@ "Testcontinent" ], "backup_state": "SECRET_EDITING", + "reducer_type": "backup", "selected_continent": "Testcontinent", "countries": [ { @@ -55,7 +56,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #1 Inc.", "storage_limit_in_megabytes": 1, - "salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", + "provider_salt": "F0HEYJQW81ZAZ3VYMZHFG8T1Z0", "http_status": 200 }, "http://localhost:8087/": { @@ -74,7 +75,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #2 Inc.", "storage_limit_in_megabytes": 1, - "salt": "D378FWXHJB8JHPQFQRZGGV9PWG", + "provider_salt": "D378FWXHJB8JHPQFQRZGGV9PWG", "http_status": 200 }, "http://localhost:8088/": { @@ -93,7 +94,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #3 Inc.", "storage_limit_in_megabytes": 1, - "salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", + "provider_salt": "7W9W4A4TTWSWRPJ76RNDPJHSPR", "http_status": 200 }, "http://localhost:8089/": { @@ -112,7 +113,7 @@ "currency": "TESTKUDOS", "business_name": "Data loss #4 Inc.", "storage_limit_in_megabytes": 1, - "salt": "PN0VJF6KDSBYN40SGRCEXPB07M", + "provider_salt": "PN0VJF6KDSBYN40SGRCEXPB07M", "http_status": 200 } }, diff --git a/src/cli/test_anastasis_reducer_1.conf b/src/cli/test_anastasis_reducer_1.conf index 3a05690..2a3a0e4 100644 --- a/src/cli/test_anastasis_reducer_1.conf +++ b/src/cli/test_anastasis_reducer_1.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8086 -SERVER_SALT = AUfO1KGOKYIFlFQg +PROVIDER_SALT = AUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #1 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_2.conf b/src/cli/test_anastasis_reducer_2.conf index 4eef5f0..71b133f 100644 --- a/src/cli/test_anastasis_reducer_2.conf +++ b/src/cli/test_anastasis_reducer_2.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8087 -SERVER_SALT = BUfO1KGOKYIFlFQg +PROVIDER_SALT = BUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #2 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_3.conf b/src/cli/test_anastasis_reducer_3.conf index 08f4700..47233ff 100644 --- a/src/cli/test_anastasis_reducer_3.conf +++ b/src/cli/test_anastasis_reducer_3.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8088 -SERVER_SALT = CUfO1KGOKYIFlFQg +PROVIDER_SALT = CUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #3 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_4.conf b/src/cli/test_anastasis_reducer_4.conf index dee90e3..f515a78 100644 --- a/src/cli/test_anastasis_reducer_4.conf +++ b/src/cli/test_anastasis_reducer_4.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8089 -SERVER_SALT = DUfO1KGOKYIFlFQg +PROVIDER_SALT = DUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #4 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_free_1.conf b/src/cli/test_anastasis_reducer_free_1.conf index 344c36a..0e7ad9a 100644 --- a/src/cli/test_anastasis_reducer_free_1.conf +++ b/src/cli/test_anastasis_reducer_free_1.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8086 -SERVER_SALT = AUfO1KGOKYIFlFQg +PROVIDER_SALT = AUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #1 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_free_2.conf b/src/cli/test_anastasis_reducer_free_2.conf index ae65562..a628ff4 100644 --- a/src/cli/test_anastasis_reducer_free_2.conf +++ b/src/cli/test_anastasis_reducer_free_2.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8087 -SERVER_SALT = BUfO1KGOKYIFlFQg +PROVIDER_SALT = BUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #2 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_free_3.conf b/src/cli/test_anastasis_reducer_free_3.conf index eca894f..adbe392 100644 --- a/src/cli/test_anastasis_reducer_free_3.conf +++ b/src/cli/test_anastasis_reducer_free_3.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8088 -SERVER_SALT = CUfO1KGOKYIFlFQg +PROVIDER_SALT = CUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #3 Inc." [stasis-postgres] diff --git a/src/cli/test_anastasis_reducer_free_4.conf b/src/cli/test_anastasis_reducer_free_4.conf index d47e5c0..cd0c701 100644 --- a/src/cli/test_anastasis_reducer_free_4.conf +++ b/src/cli/test_anastasis_reducer_free_4.conf @@ -3,7 +3,7 @@ [anastasis] PORT = 8089 -SERVER_SALT = DUfO1KGOKYIFlFQg +PROVIDER_SALT = DUfO1KGOKYIFlFQg BUSINESS_NAME = "Data loss #4 Inc." [stasis-postgres] diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h index d439ca5..5e01aa5 100644 --- a/src/include/anastasis_service.h +++ b/src/include/anastasis_service.h @@ -98,9 +98,9 @@ struct ANASTASIS_Config struct TALER_Amount liability_limit; /** - * Server salt. + * Provider salt. */ - struct ANASTASIS_CRYPTO_ProviderSaltP salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; }; diff --git a/src/include/anastasis_testing_lib.h b/src/include/anastasis_testing_lib.h index 0066939..b5036ff 100644 --- a/src/include/anastasis_testing_lib.h +++ b/src/include/anastasis_testing_lib.h @@ -129,7 +129,7 @@ op (hash, const struct GNUNET_HashCode) \ op (truth, const struct ANASTASIS_Truth *) \ op (policy, const struct ANASTASIS_Policy *) \ - op (salt, const struct ANASTASIS_CRYPTO_ProviderSaltP) \ + op (provider_salt, const struct ANASTASIS_CRYPTO_ProviderSaltP) \ op (core_secret, const void *) \ op (truth_key, const struct ANASTASIS_CRYPTO_TruthKeyP) \ op (account_pub, const struct ANASTASIS_CRYPTO_AccountPublicKeyP) \ diff --git a/src/lib/anastasis_backup.c b/src/lib/anastasis_backup.c index 466dbe8..24d9643 100644 --- a/src/lib/anastasis_backup.c +++ b/src/lib/anastasis_backup.c @@ -55,7 +55,7 @@ struct ANASTASIS_Truth /** * Server salt used to derive hash from security answer */ - struct ANASTASIS_CRYPTO_QuestionSaltP salt; + struct ANASTASIS_CRYPTO_QuestionSaltP question_salt; /** * Url of the server @@ -107,8 +107,8 @@ ANASTASIS_truth_from_json (const json_t *json) &t->key_share), GNUNET_JSON_spec_fixed_auto ("truth_key", &t->truth_key), - GNUNET_JSON_spec_fixed_auto ("salt", - &t->salt), + GNUNET_JSON_spec_fixed_auto ("question_salt", + &t->question_salt), GNUNET_JSON_spec_fixed_auto ("provider_salt", &t->provider_salt), GNUNET_JSON_spec_end () @@ -142,8 +142,8 @@ ANASTASIS_truth_to_json (const struct ANASTASIS_Truth *t) &t->key_share), GNUNET_JSON_pack_data_auto ("truth_key", &t->truth_key), - GNUNET_JSON_pack_data_auto ("salt", - &t->salt), + GNUNET_JSON_pack_data_auto ("question_salt", + &t->question_salt), GNUNET_JSON_pack_data_auto ("nonce", &t->nonce), GNUNET_JSON_pack_data_auto ("provider_salt", @@ -252,7 +252,7 @@ ANASTASIS_truth_upload3 (struct GNUNET_CURL_Context *ctx, truth_data_size); ANASTASIS_CRYPTO_secure_answer_hash (answer, &t->uuid, - &t->salt, + &t->question_salt, &nt); ANASTASIS_CRYPTO_keyshare_encrypt (&t->key_share, &tu->id, @@ -314,7 +314,7 @@ ANASTASIS_truth_upload2 ( struct GNUNET_TIME_Relative pay_timeout, const struct ANASTASIS_CRYPTO_NonceP *nonce, const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid, - const struct ANASTASIS_CRYPTO_QuestionSaltP *salt, + const struct ANASTASIS_CRYPTO_QuestionSaltP *question_salt, const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key, const struct ANASTASIS_CRYPTO_KeyShareP *key_share, ANASTASIS_TruthCallback tc, @@ -332,7 +332,7 @@ ANASTASIS_truth_upload2 ( ? GNUNET_strdup (mime_type) : NULL; t->provider_salt = *provider_salt; - t->salt = *salt; + t->question_salt = *question_salt; t->nonce = *nonce; t->uuid = *uuid; t->truth_key = *truth_key; @@ -443,7 +443,7 @@ struct ANASTASIS_Policy /** * Salt used to encrypt the master key */ - struct ANASTASIS_CRYPTO_MasterSaltP salt; + struct ANASTASIS_CRYPTO_MasterSaltP master_salt; /** * Array of truths @@ -487,8 +487,8 @@ ANASTASIS_policy_create (const struct ANASTASIS_Truth *truths[], p = GNUNET_new (struct ANASTASIS_Policy); GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, - &p->salt, - sizeof (p->salt)); + &p->master_salt, + sizeof (p->master_salt)); { struct ANASTASIS_CRYPTO_KeyShareP key_shares[truths_len]; @@ -496,7 +496,7 @@ ANASTASIS_policy_create (const struct ANASTASIS_Truth *truths[], key_shares[i] = truths[i]->key_share; ANASTASIS_CRYPTO_policy_key_derive (key_shares, truths_len, - &p->salt, + &p->master_salt, &p->policy_key); } p->truths = GNUNET_new_array (truths_len, @@ -542,7 +542,7 @@ struct PolicyStoreState * Server salt. Points into a truth object from which we got the * salt. */ - struct ANASTASIS_CRYPTO_ProviderSaltP server_salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; /** * The /policy POST operation handle. @@ -785,8 +785,8 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx, [k]), GNUNET_JSON_pack_array_steal ("uuids", uuids), - GNUNET_JSON_pack_data_auto ("salt", - &policy->salt)))); + GNUNET_JSON_pack_data_auto ("master_salt", + &policy->master_salt)))); } esc_methods = json_array (); @@ -830,8 +830,8 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx, pt->instructions), GNUNET_JSON_pack_data_auto ("truth_key", &pt->truth_key), - GNUNET_JSON_pack_data_auto ("truth_salt", - &pt->salt), + GNUNET_JSON_pack_data_auto ("question_salt", + &pt->question_salt), GNUNET_JSON_pack_data_auto ("provider_salt", &pt->provider_salt), GNUNET_JSON_pack_string ("escrow_type", @@ -915,10 +915,10 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx, pss->ss = ss; pss->anastasis_url = GNUNET_strdup (providers[l].provider_url); - pss->server_salt = providers[l].provider_salt; + pss->provider_salt = providers[l].provider_salt; pss->payment_secret = providers[l].payment_secret; ANASTASIS_CRYPTO_user_identifier_derive (id_data, - &pss->server_salt, + &pss->provider_salt, &pss->id); ANASTASIS_CRYPTO_recovery_metadata_encrypt (&pss->id, meta, diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c index c425398..95c131d 100644 --- a/src/lib/anastasis_recovery.c +++ b/src/lib/anastasis_recovery.c @@ -47,7 +47,7 @@ struct ANASTASIS_Challenge /** * Salt; used to derive hash from security question answers. */ - struct ANASTASIS_CRYPTO_QuestionSaltP salt; + struct ANASTASIS_CRYPTO_QuestionSaltP question_salt; /** * Provider salt; used to derive our key material from our identity @@ -146,7 +146,7 @@ struct DecryptionPolicy /** * Salt used to decrypt master key. */ - struct ANASTASIS_CRYPTO_MasterSaltP salt; + struct ANASTASIS_CRYPTO_MasterSaltP master_salt; }; @@ -437,7 +437,7 @@ truth_solve_cb (void *cls, key_shares[l] = recovery->solved_challenges[m]->key_share; ANASTASIS_CRYPTO_policy_key_derive (key_shares, rdps->pub_details.challenges_length, - &rdps->salt, + &rdps->master_salt, &policy_key); GNUNET_assert (NULL != rdps->emk); GNUNET_assert (rdps->emk_size > 0); @@ -552,7 +552,7 @@ ANASTASIS_challenge_answer ( c->answer = GNUNET_strdup (answer_str); ANASTASIS_CRYPTO_secure_answer_hash (answer_str, &c->ci.uuid, - &c->salt, + &c->question_salt, &hashed_answer); return ANASTASIS_challenge_answer3 (c, psp, @@ -824,8 +824,8 @@ policy_lookup_cb (void *cls, &instructions), GNUNET_JSON_spec_fixed_auto ("truth_key", &cs->truth_key), - GNUNET_JSON_spec_fixed_auto ("truth_salt", - &cs->salt), + GNUNET_JSON_spec_fixed_auto ("question_salt", + &cs->question_salt), GNUNET_JSON_spec_fixed_auto ("provider_salt", &cs->provider_salt), GNUNET_JSON_spec_string ("escrow_type", @@ -871,8 +871,8 @@ policy_lookup_cb (void *cls, GNUNET_JSON_spec_varsize ("master_key", &dp->emk, &dp->emk_size), - GNUNET_JSON_spec_fixed_auto ("salt", - &dp->salt), + GNUNET_JSON_spec_fixed_auto ("master_salt", + &dp->master_salt), GNUNET_JSON_spec_json ("uuids", &uuids), GNUNET_JSON_spec_end () @@ -1048,8 +1048,8 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r) GNUNET_JSON_pack_data_varsize ("emk", dp->emk, dp->emk_size), - GNUNET_JSON_pack_data_auto ("salt", - &dp->salt), + GNUNET_JSON_pack_data_auto ("master_salt", + &dp->master_salt), GNUNET_JSON_pack_array_steal ("challenges", c_arr)); GNUNET_assert (0 == @@ -1070,8 +1070,8 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r) ANASTASIS_CRYPTO_uuid2s (&c->ci.uuid)), GNUNET_JSON_pack_data_auto ("truth_key", &c->truth_key), - GNUNET_JSON_pack_data_auto ("salt", - &c->salt), + GNUNET_JSON_pack_data_auto ("question_salt", + &c->question_salt), GNUNET_JSON_pack_data_auto ("provider_salt", &c->provider_salt), GNUNET_JSON_pack_allow_null ( @@ -1159,8 +1159,8 @@ parse_cs_array (struct ANASTASIS_Recovery *r, &instructions), GNUNET_JSON_spec_fixed_auto ("truth_key", &c->truth_key), - GNUNET_JSON_spec_fixed_auto ("salt", - &c->salt), + GNUNET_JSON_spec_fixed_auto ("question_salt", + &c->question_salt), GNUNET_JSON_spec_fixed_auto ("provider_salt", &c->provider_salt), GNUNET_JSON_spec_string ("type", @@ -1235,8 +1235,8 @@ parse_dps_array (struct ANASTASIS_Recovery *r, GNUNET_JSON_spec_varsize ("emk", &dp->emk, &dp->emk_size), - GNUNET_JSON_spec_fixed_auto ("salt", - &dp->salt), + GNUNET_JSON_spec_fixed_auto ("master_salt", + &dp->master_salt), GNUNET_JSON_spec_json ("challenges", &challenges), GNUNET_JSON_spec_end () diff --git a/src/reducer/anastasis_api_recovery_redux.c b/src/reducer/anastasis_api_recovery_redux.c index 21b1f51..d0c3f2d 100644 --- a/src/reducer/anastasis_api_recovery_redux.c +++ b/src/reducer/anastasis_api_recovery_redux.c @@ -2216,7 +2216,7 @@ sync_providers (json_t *state, &provider_url), GNUNET_JSON_spec_end () }; - struct ANASTASIS_CRYPTO_ProviderSaltP salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; struct SyncEntry *se; if (GNUNET_OK != @@ -2235,7 +2235,7 @@ sync_providers (json_t *state, if (GNUNET_OK == ANASTASIS_reducer_lookup_salt (state, provider_url, - &salt)) + &provider_salt)) continue; /* provider already ready */ se = GNUNET_new (struct SyncEntry); se->ms = ms; @@ -2302,13 +2302,13 @@ poll_providers (json_t *state, ms->cb_cls = cb_cls; json_object_foreach (ap, url, obj) { - struct ANASTASIS_CRYPTO_ProviderSaltP salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; struct SyncEntry *se; if (GNUNET_OK == ANASTASIS_reducer_lookup_salt (state, url, - &salt)) + &provider_salt)) continue; se = GNUNET_new (struct SyncEntry); se->ms = ms; @@ -2640,10 +2640,10 @@ done_secret_selecting (json_t *state, &pa), GNUNET_JSON_spec_end () }; - struct ANASTASIS_CRYPTO_ProviderSaltP salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; struct GNUNET_JSON_Specification pspec[] = { - GNUNET_JSON_spec_fixed_auto ("salt", - &salt), + GNUNET_JSON_spec_fixed_auto ("provider_salt", + &provider_salt), GNUNET_JSON_spec_end () }; json_t *p_cfg; @@ -2751,7 +2751,7 @@ done_secret_selecting (json_t *state, id_data, version, pd->backend_url, - &salt, + &provider_salt, &policy_lookup_cb, pd, &core_early_secret_cb, diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c index 58ca0fb..1dba576 100644 --- a/src/reducer/anastasis_api_redux.c +++ b/src/reducer/anastasis_api_redux.c @@ -188,9 +188,9 @@ struct ConfigRequest struct TALER_Amount liability_limit; /** - * Server salt. + * Provider salt. */ - struct ANASTASIS_CRYPTO_ProviderSaltP salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; /** * Task to timeout /config requests. @@ -539,8 +539,8 @@ notify_waiting (struct ConfigRequest *cr) cr->business_name), GNUNET_JSON_pack_uint64 ("storage_limit_in_megabytes", cr->storage_limit_in_megabytes), - GNUNET_JSON_pack_data_auto ("salt", - &cr->salt), + GNUNET_JSON_pack_data_auto ("provider_salt", + &cr->provider_salt), GNUNET_JSON_pack_uint64 ("http_status", cr->http_status)); } @@ -617,7 +617,7 @@ config_cb (void *cls, cr->annual_fee = acfg->annual_fee; cr->truth_upload_fee = acfg->truth_upload_fee; cr->liability_limit = acfg->liability_limit; - cr->salt = acfg->salt; + cr->provider_salt = acfg->provider_salt; } } notify_waiting (cr); @@ -2013,17 +2013,18 @@ ANASTASIS_REDUX_load_continents_ () /** - * Lookup @a salt of @a provider_url in @a state. + * Lookup @a provider_salt of @a provider_url in @a state. * * @param state the state to inspect * @param provider_url provider to look into - * @param[out] salt value to extract + * @param[out] provider_salt value to extract * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue -ANASTASIS_reducer_lookup_salt (const json_t *state, - const char *provider_url, - struct ANASTASIS_CRYPTO_ProviderSaltP *salt) +ANASTASIS_reducer_lookup_salt ( + const json_t *state, + const char *provider_url, + struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt) { const json_t *aps; const json_t *cfg; @@ -2040,8 +2041,8 @@ ANASTASIS_reducer_lookup_salt (const json_t *state, &http_status), NULL), GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_fixed_auto ("salt", - salt), + GNUNET_JSON_spec_fixed_auto ("provider_salt", + provider_salt), &no_salt), GNUNET_JSON_spec_end () }; diff --git a/src/restclient/anastasis_api_config.c b/src/restclient/anastasis_api_config.c index 9cf25c9..08b6952 100644 --- a/src/restclient/anastasis_api_config.c +++ b/src/restclient/anastasis_api_config.c @@ -120,8 +120,8 @@ handle_config_finished (void *cls, &acfg.truth_upload_fee), TALER_JSON_spec_amount_any ("liability_limit", &acfg.liability_limit), - GNUNET_JSON_spec_fixed_auto ("server_salt", - &acfg.salt), + GNUNET_JSON_spec_fixed_auto ("provider_salt", + &acfg.provider_salt), GNUNET_JSON_spec_end () }; diff --git a/src/restclient/anastasis_api_policy_store.c b/src/restclient/anastasis_api_policy_store.c index 7a8925f..5cfcfcb 100644 --- a/src/restclient/anastasis_api_policy_store.c +++ b/src/restclient/anastasis_api_policy_store.c @@ -374,6 +374,11 @@ ANASTASIS_policy_store ( .purpose.size = htonl (sizeof (usp)) }; + if (NULL == recovery_meta_data) + { + GNUNET_break (0); + return NULL; + } tms = (unsigned long long) (payment_timeout.rel_value_us / GNUNET_TIME_UNIT_MILLISECONDS.rel_value_us); GNUNET_CRYPTO_hash (recovery_data, diff --git a/src/testing/test_anastasis_api.conf b/src/testing/test_anastasis_api.conf index 52be592..3dfc6ba 100644 --- a/src/testing/test_anastasis_api.conf +++ b/src/testing/test_anastasis_api.conf @@ -54,7 +54,7 @@ ANNUAL_POLICY_UPLOAD_LIMIT = 64 INSURANCE = EUR:0 -SERVER_SALT = salty +PROVIDER_SALT = salty # Annual fee we charge. diff --git a/src/testing/testing_api_cmd_config.c b/src/testing/testing_api_cmd_config.c index b4cf6e0..92a8ae1 100644 --- a/src/testing/testing_api_cmd_config.c +++ b/src/testing/testing_api_cmd_config.c @@ -53,7 +53,7 @@ struct ConfigState /** * The salt value from server. */ - struct ANASTASIS_CRYPTO_ProviderSaltP salt; + struct ANASTASIS_CRYPTO_ProviderSaltP provider_salt; }; @@ -93,7 +93,7 @@ config_cb (void *cls, TALER_TESTING_interpreter_fail (ss->is); return; } - ss->salt = config->salt; + ss->provider_salt = config->provider_salt; TALER_TESTING_interpreter_next (ss->is); } @@ -168,7 +168,7 @@ config_traits (void *cls, { struct ConfigState *ss = cls; struct TALER_TESTING_Trait traits[] = { - ANASTASIS_TESTING_make_trait_salt (&ss->salt), + ANASTASIS_TESTING_make_trait_provider_salt (&ss->provider_salt), TALER_TESTING_trait_end () }; diff --git a/src/testing/testing_api_cmd_policy_store.c b/src/testing/testing_api_cmd_policy_store.c index 08e567c..f23489d 100644 --- a/src/testing/testing_api_cmd_policy_store.c +++ b/src/testing/testing_api_cmd_policy_store.c @@ -281,7 +281,7 @@ policy_store_run (void *cls, &pss->anastasis_priv, pss->recovery_data, pss->recovery_data_size, - NULL, 0, /* meta-data */ + "metadata", strlen ("metadata"), (0 != (ANASTASIS_TESTING_PSO_REQUEST_PAYMENT & pss->psopt)), pss->payment_secret_set ? &pss->payment_secret_request : NULL, GNUNET_TIME_UNIT_ZERO, diff --git a/src/testing/testing_cmd_recover_secret.c b/src/testing/testing_cmd_recover_secret.c index 153143d..3b12012 100644 --- a/src/testing/testing_cmd_recover_secret.c +++ b/src/testing/testing_cmd_recover_secret.c @@ -67,11 +67,6 @@ struct RecoverSecretState json_t *id_data; /** - * Salt to be used to derive the id - */ - struct ANASTASIS_CRYPTO_ProviderSaltP *salt; - - /** * Recovery information from the lookup */ struct ANASTASIS_RecoveryInformation *ri; @@ -188,7 +183,7 @@ recover_secret_run (void *cls, { struct RecoverSecretState *rss = cls; const struct TALER_TESTING_Command *ref; - const struct ANASTASIS_CRYPTO_ProviderSaltP *salt; + const struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt; rss->is = is; if (NULL != rss->download_reference) @@ -203,8 +198,8 @@ recover_secret_run (void *cls, return; } if (GNUNET_OK != - ANASTASIS_TESTING_get_trait_salt (ref, - &salt)) + ANASTASIS_TESTING_get_trait_provider_salt (ref, + &provider_salt)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (rss->is); @@ -236,7 +231,7 @@ recover_secret_run (void *cls, rss->id_data, rss->version, rss->anastasis_url, - salt, + provider_salt, &policy_lookup_cb, rss, &core_secret_cb, diff --git a/src/testing/testing_cmd_secret_share.c b/src/testing/testing_cmd_secret_share.c index 7a9dbc0..26a237d 100644 --- a/src/testing/testing_cmd_secret_share.c +++ b/src/testing/testing_cmd_secret_share.c @@ -275,7 +275,7 @@ secret_share_run (void *cls, pds.provider_url = sss->anastasis_url; { const struct TALER_TESTING_Command *ref; - const struct ANASTASIS_CRYPTO_ProviderSaltP *salt; + const struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt; ref = TALER_TESTING_interpreter_lookup_command (is, sss->config_ref); @@ -286,14 +286,14 @@ secret_share_run (void *cls, return; } if (GNUNET_OK != - ANASTASIS_TESTING_get_trait_salt (ref, - &salt)) + ANASTASIS_TESTING_get_trait_provider_salt (ref, + &provider_salt)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (sss->is); return; } - pds.provider_salt = *salt; + pds.provider_salt = *provider_salt; } sss->sso = ANASTASIS_secret_share (is->ctx, diff --git a/src/testing/testing_cmd_truth_upload.c b/src/testing/testing_cmd_truth_upload.c index 99c2879..89ba790 100644 --- a/src/testing/testing_cmd_truth_upload.c +++ b/src/testing/testing_cmd_truth_upload.c @@ -181,15 +181,15 @@ truth_upload_run (void *cls, { struct TruthUploadState *tus = cls; const struct TALER_TESTING_Command *ref; - const struct ANASTASIS_CRYPTO_ProviderSaltP *salt; + const struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt; struct ANASTASIS_CRYPTO_UserIdentifierP user_id; tus->is = is; if (NULL != tus->salt_reference) { - ref = TALER_TESTING_interpreter_lookup_command - (is, - tus->salt_reference); + ref = TALER_TESTING_interpreter_lookup_command ( + is, + tus->salt_reference); if (NULL == ref) { GNUNET_break (0); @@ -197,26 +197,24 @@ truth_upload_run (void *cls, return; } if (GNUNET_OK != - ANASTASIS_TESTING_get_trait_salt (ref, - &salt)) + ANASTASIS_TESTING_get_trait_provider_salt (ref, + &provider_salt)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (tus->is); return; } } - ANASTASIS_CRYPTO_user_identifier_derive (tus->id_data, - salt, + provider_salt, &user_id); - tus->tuo = ANASTASIS_truth_upload (is->ctx, &user_id, tus->anastasis_url, tus->method, tus->instructions, tus->mime_type, - salt, + provider_salt, tus->truth_data, tus->truth_data_size, false, /* force payment */ |