commit 48ca0c8a82205187fae238d626c8c103eb2984cf
parent 5ec7c1b2ab65c750c7df90e95ac0b31c42df5bd1
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 10 Apr 2024 13:24:29 +0200
-fix warnings
Diffstat:
3 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c
@@ -1297,8 +1297,8 @@ DH_keys_denomination_batch_sign (
struct DH_DonationUnitKey *du;
struct TALER_CRYPTO_RsaSignRequest rsrs[csds_length];
struct TALER_CRYPTO_CsSignRequest csrs[csds_length];
- struct DONAU_BlindedDonationUnitSignature rs[csds_length];
- struct DONAU_BlindedDonationUnitSignature cs[csds_length];
+ struct TALER_BlindedDenominationSignature rs[csds_length];
+ struct TALER_BlindedDenominationSignature cs[csds_length];
unsigned int rsrs_pos = 0;
unsigned int csrs_pos = 0;
enum TALER_ErrorCode ec;
@@ -1323,7 +1323,10 @@ DH_keys_denomination_batch_sign (
switch (du->donation_unit_pub.bsign_pub_key->cipher)
{
case GNUNET_CRYPTO_BSA_RSA:
- rsrs[rsrs_pos].h_rsa = &du->h_donation_unit_pub.hash;
+ /* See DONAU_donation_unit_pub_hash: we guarantee that these
+ hashes are equivalent! */
+ rsrs[rsrs_pos].h_rsa
+ = (const struct TALER_RsaPubHashP *) &du->h_donation_unit_pub;
rsrs[rsrs_pos].msg
= budi->blinded_message->details.rsa_blinded_message.blinded_msg;
rsrs[rsrs_pos].msg_size
@@ -1331,7 +1334,10 @@ DH_keys_denomination_batch_sign (
rsrs_pos++;
break;
case GNUNET_CRYPTO_BSA_CS:
- csrs[csrs_pos].h_cs = &du->h_donation_unit_pub.hash;
+ /* See DONAU_donation_unit_pub_hash: we guarantee that these
+ hashes are equivalent! */
+ csrs[csrs_pos].h_cs
+ = (const struct TALER_CsPubHashP *) &du->h_donation_unit_pub;
csrs[csrs_pos].blinded_planchet
= &budi->blinded_message->details.cs_blinded_message;
csrs_pos++;
@@ -1359,7 +1365,7 @@ DH_keys_denomination_batch_sign (
csrs_pos,
csrs,
false, // for_melt
- (0 == rsrs_pos) ? bss : cs);
+ cs);
if (TALER_EC_NONE != ec)
{
for (unsigned int i = 0; i<csrs_pos; i++)
@@ -1380,7 +1386,7 @@ DH_keys_denomination_batch_sign (
rsadh,
rsrs_pos,
rsrs,
- (0 == csrs_pos) ? bss : rs);
+ rs);
if (TALER_EC_NONE != ec)
{
for (unsigned int i = 0; i<csrs_pos; i++)
@@ -1404,26 +1410,22 @@ DH_keys_denomination_batch_sign (
// TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_RSA] += rsrs_pos;
}
- if ( (0 != csrs_pos) &&
- (0 != rsrs_pos) )
+ rsrs_pos = 0;
+ csrs_pos = 0;
+ for (unsigned int i = 0; i<csds_length; i++)
{
- rsrs_pos = 0;
- csrs_pos = 0;
- for (unsigned int i = 0; i<csds_length; i++)
- {
- const struct DONAU_BlindedUniqueDonationIdentifier *budi = csds[i].budi;
+ const struct DONAU_BlindedUniqueDonationIdentifier *budi = csds[i].budi;
- switch (budi->blinded_message->cipher)
- {
- case GNUNET_CRYPTO_BSA_RSA:
- bss[i] = rs[rsrs_pos++];
- break;
- case GNUNET_CRYPTO_BSA_CS:
- bss[i] = cs[csrs_pos++];
- break;
- default:
- GNUNET_assert (0);
- }
+ switch (budi->blinded_message->cipher)
+ {
+ case GNUNET_CRYPTO_BSA_RSA:
+ bss[i].blinded_sig = rs[rsrs_pos++].blinded_sig;
+ break;
+ case GNUNET_CRYPTO_BSA_CS:
+ bss[i].blinded_sig = cs[csrs_pos++].blinded_sig;
+ break;
+ default:
+ GNUNET_assert (0);
}
}
return TALER_EC_NONE;
diff --git a/src/donaudb/pg_insert_issued_receipt.c b/src/donaudb/pg_insert_issued_receipt.c
@@ -19,8 +19,8 @@
* @author Johannes Casaburi
* @author Lukas Matyja
*/
-#include <gnunet/gnunet_pq_lib.h>
#include <taler/platform.h>
+#include <gnunet/gnunet_pq_lib.h>
#include <taler/taler_error_codes.h>
#include <taler/taler_dbevents.h>
#include <taler/taler_pq_lib.h>
diff --git a/src/include/donau_crypto_lib.h b/src/include/donau_crypto_lib.h
@@ -112,7 +112,9 @@ struct DONAU_DonationUnitPrivateKey
};
/**
- * Hash of a donation unit public key
+ * Hash of a donation unit public key. MUST match the
+ * `struct TALER_CsPubHashP` and `struct TALER_RsaPubHashP`
+ * of the GNU Taler exchange secmod helpers!
*/
struct DONAU_DonationUnitHashP
{