anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit 7869fda07fd3ccd810ed5c1494ae817df323a846
parent 107ad6eb2a94d9623f325cfd87ebff8bc9a76148
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 13 Dec 2024 15:04:22 +0100

-remove silly, impossible case

Diffstat:
Msrc/reducer/anastasis_api_redux.c | 51+++++++++++++++++++++------------------------------
1 file changed, 21 insertions(+), 30 deletions(-)

diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c @@ -622,42 +622,33 @@ config_cb (void *cls, else cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED; } - if ( (MHD_HTTP_OK == acfg->http_status) && - (NULL == acfg) ) + if (0 == acfg->details.ok.storage_limit_in_megabytes) { - cr->http_status = MHD_HTTP_NOT_FOUND; - cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED; + cr->http_status = 0; + cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG; } else { - if (0 == acfg->details.ok.storage_limit_in_megabytes) + cr->ec = TALER_EC_NONE; + GNUNET_free (cr->business_name); + cr->business_name = GNUNET_strdup (acfg->details.ok.business_name); + for (unsigned int i = 0; i<cr->methods_length; i++) + GNUNET_free (cr->methods[i].type); + GNUNET_free (cr->methods); + cr->methods = GNUNET_new_array (acfg->details.ok.methods_length, + struct AuthorizationMethodConfig); + for (unsigned int i = 0; i<acfg->details.ok.methods_length; i++) { - cr->http_status = 0; - cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG; - } - else - { - cr->ec = TALER_EC_NONE; - GNUNET_free (cr->business_name); - cr->business_name = GNUNET_strdup (acfg->details.ok.business_name); - for (unsigned int i = 0; i<cr->methods_length; i++) - GNUNET_free (cr->methods[i].type); - GNUNET_free (cr->methods); - cr->methods = GNUNET_new_array (acfg->details.ok.methods_length, - struct AuthorizationMethodConfig); - for (unsigned int i = 0; i<acfg->details.ok.methods_length; i++) - { - cr->methods[i].type = GNUNET_strdup (acfg->details.ok.methods[i].type); - cr->methods[i].usage_fee = acfg->details.ok.methods[i].usage_fee; - } - cr->methods_length = acfg->details.ok.methods_length; - cr->storage_limit_in_megabytes = - acfg->details.ok.storage_limit_in_megabytes; - cr->annual_fee = acfg->details.ok.annual_fee; - cr->truth_upload_fee = acfg->details.ok.truth_upload_fee; - cr->liability_limit = acfg->details.ok.liability_limit; - cr->provider_salt = acfg->details.ok.provider_salt; + cr->methods[i].type = GNUNET_strdup (acfg->details.ok.methods[i].type); + cr->methods[i].usage_fee = acfg->details.ok.methods[i].usage_fee; } + cr->methods_length = acfg->details.ok.methods_length; + cr->storage_limit_in_megabytes = + acfg->details.ok.storage_limit_in_megabytes; + cr->annual_fee = acfg->details.ok.annual_fee; + cr->truth_upload_fee = acfg->details.ok.truth_upload_fee; + cr->liability_limit = acfg->details.ok.liability_limit; + cr->provider_salt = acfg->details.ok.provider_salt; } notify_waiting (cr); if (MHD_HTTP_OK != acfg->http_status)