commit 74fbdea74c12ba820c060ad5e638fef3e7a53860
parent ff4fe2e23b0f82bc4108224072241243802c8d7c
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 8 Apr 2026 03:22:45 +0200
fix ECs/HTTP status codes to match specifications
Diffstat:
3 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/src/donau/donau-httpd_get-donation-statement-YEAR-HASH_DONOR_ID.c b/src/donau/donau-httpd_get-donation-statement-YEAR-HASH_DONOR_ID.c
@@ -107,10 +107,9 @@ DH_handler_get_donation_statement (
if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- ec,
- NULL);
+ return TALER_MHD_reply_with_ec (rc->connection,
+ ec,
+ NULL);
}
break;
}
diff --git a/src/donau/donau-httpd_post-batch-issue-CHARITY_ID.c b/src/donau/donau-httpd_post-batch-issue-CHARITY_ID.c
@@ -118,8 +118,8 @@ signatures_to_json (const size_t num_sig,
MHD_RESULT
DH_handler_post_batch_issue (struct DH_RequestContext *rc,
- const json_t *root,
- const char *const args[1])
+ const json_t *root,
+ const char *const args[1])
{
struct DONAU_CharitySignatureP charity_sig;
uint64_t year;
@@ -369,7 +369,7 @@ start:
bkps);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_NOT_FOUND,
- TALER_EC_DONAU_GENERIC_KEYS_MISSING,
+ TALER_EC_DONAU_GENERIC_DONATION_UNIT_UNKNOWN,
NULL);
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -402,10 +402,9 @@ start:
GNUNET_break_op (0);
free_bkps (num_bkps,
bkps);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- batch_sign_ec,
- NULL);
+ return TALER_MHD_reply_with_ec (rc->connection,
+ batch_sign_ec,
+ NULL);
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"made blind signatures!\n");
diff --git a/src/donau/donau-httpd_post-csr-issue.c b/src/donau/donau-httpd_post-csr-issue.c
@@ -42,8 +42,8 @@
MHD_RESULT
DH_handler_post_csr_issue (struct DH_RequestContext *rc,
- const json_t *root,
- const char *const args[])
+ const json_t *root,
+ const char *const args[])
{
struct GNUNET_CRYPTO_CsSessionNonce nonce;
struct DONAU_DonationUnitHashP du_pub_hash;
@@ -77,8 +77,8 @@ DH_handler_post_csr_issue (struct DH_RequestContext *rc,
GNUNET_break (0);
return TALER_MHD_reply_with_error (
rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_DONAU_GENERIC_KEYS_MISSING,
+ MHD_HTTP_NOT_FOUND,
+ TALER_EC_DONAU_GENERIC_DONATION_UNIT_UNKNOWN,
NULL);
}
if (GNUNET_CRYPTO_BSA_CS !=
@@ -88,8 +88,8 @@ DH_handler_post_csr_issue (struct DH_RequestContext *rc,
GNUNET_break (0);
return TALER_MHD_reply_with_error (
rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_DONAU_GENERIC_KEYS_MISSING,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_DONAU_GENERIC_INVALID_DENOMINATION_CIPHER_FOR_OPERATION,
NULL);
}
}