LCOV - code coverage report
Current view: top level - util - offline_signatures.c (source / functions) Hit Total Coverage
Test: GNU Taler exchange coverage report Lines: 143 154 92.9 %
Date: 2021-08-30 06:43:37 Functions: 16 18 88.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   This file is part of TALER
       3             :   Copyright (C) 2020 Taler Systems SA
       4             : 
       5             :   TALER is free software; you can redistribute it and/or modify it under the
       6             :   terms of the GNU General Public License as published by the Free Software
       7             :   Foundation; either version 3, or (at your option) any later version.
       8             : 
       9             :   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
      10             :   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
      11             :   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
      12             : 
      13             :   You should have received a copy of the GNU General Public License along with
      14             :   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
      15             : */
      16             : /**
      17             :  * @file offline_signatures.c
      18             :  * @brief Utility functions for Taler exchange offline signatures
      19             :  * @author Christian Grothoff
      20             :  */
      21             : #include "platform.h"
      22             : #include "taler_util.h"
      23             : #include "taler_signatures.h"
      24             : 
      25             : 
      26             : void
      27           8 : TALER_exchange_offline_auditor_add_sign (
      28             :   const struct TALER_AuditorPublicKeyP *auditor_pub,
      29             :   const char *auditor_url,
      30             :   struct GNUNET_TIME_Absolute start_date,
      31             :   const struct TALER_MasterPrivateKeyP *master_priv,
      32             :   struct TALER_MasterSignatureP *master_sig)
      33             : {
      34          16 :   struct TALER_MasterAddAuditorPS kv = {
      35           8 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_ADD_AUDITOR),
      36           8 :     .purpose.size = htonl (sizeof (kv)),
      37           8 :     .start_date = GNUNET_TIME_absolute_hton (start_date),
      38             :     .auditor_pub = *auditor_pub,
      39             :   };
      40             : 
      41           8 :   GNUNET_CRYPTO_hash (auditor_url,
      42           8 :                       strlen (auditor_url) + 1,
      43             :                       &kv.h_auditor_url);
      44           8 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
      45             :                             &kv,
      46             :                             &master_sig->eddsa_signature);
      47           8 : }
      48             : 
      49             : 
      50             : enum GNUNET_GenericReturnValue
      51           9 : TALER_exchange_offline_auditor_add_verify (
      52             :   const struct TALER_AuditorPublicKeyP *auditor_pub,
      53             :   const char *auditor_url,
      54             :   struct GNUNET_TIME_Absolute start_date,
      55             :   const struct TALER_MasterPublicKeyP *master_pub,
      56             :   const struct TALER_MasterSignatureP *master_sig)
      57             : {
      58          18 :   struct TALER_MasterAddAuditorPS aa = {
      59           9 :     .purpose.purpose = htonl (
      60             :       TALER_SIGNATURE_MASTER_ADD_AUDITOR),
      61           9 :     .purpose.size = htonl (sizeof (aa)),
      62           9 :     .start_date = GNUNET_TIME_absolute_hton (start_date),
      63             :     .auditor_pub = *auditor_pub
      64             :   };
      65             : 
      66           9 :   GNUNET_CRYPTO_hash (auditor_url,
      67           9 :                       strlen (auditor_url) + 1,
      68             :                       &aa.h_auditor_url);
      69           9 :   return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_ADD_AUDITOR,
      70             :                                      &aa,
      71             :                                      &master_sig->eddsa_signature,
      72             :                                      &master_pub->eddsa_pub);
      73             : }
      74             : 
      75             : 
      76             : void
      77           3 : TALER_exchange_offline_auditor_del_sign (
      78             :   const struct TALER_AuditorPublicKeyP *auditor_pub,
      79             :   struct GNUNET_TIME_Absolute end_date,
      80             :   const struct TALER_MasterPrivateKeyP *master_priv,
      81             :   struct TALER_MasterSignatureP *master_sig)
      82             : {
      83           6 :   struct TALER_MasterDelAuditorPS kv = {
      84           3 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DEL_AUDITOR),
      85           3 :     .purpose.size = htonl (sizeof (kv)),
      86           3 :     .end_date = GNUNET_TIME_absolute_hton (end_date),
      87             :     .auditor_pub = *auditor_pub,
      88             :   };
      89             : 
      90           3 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
      91             :                             &kv,
      92             :                             &master_sig->eddsa_signature);
      93           3 : }
      94             : 
      95             : 
      96             : enum GNUNET_GenericReturnValue
      97           4 : TALER_exchange_offline_auditor_del_verify (
      98             :   const struct TALER_AuditorPublicKeyP *auditor_pub,
      99             :   struct GNUNET_TIME_Absolute end_date,
     100             :   const struct TALER_MasterPublicKeyP *master_pub,
     101             :   const struct TALER_MasterSignatureP *master_sig)
     102             : {
     103           8 :   struct TALER_MasterDelAuditorPS da = {
     104           4 :     .purpose.purpose = htonl (
     105             :       TALER_SIGNATURE_MASTER_DEL_AUDITOR),
     106           4 :     .purpose.size = htonl (sizeof (da)),
     107           4 :     .end_date = GNUNET_TIME_absolute_hton (end_date),
     108             :     .auditor_pub = *auditor_pub
     109             :   };
     110             : 
     111           4 :   return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_DEL_AUDITOR,
     112             :                                      &da,
     113             :                                      &master_sig->eddsa_signature,
     114             :                                      &master_pub->eddsa_pub);
     115             : }
     116             : 
     117             : 
     118             : void
     119           8 : TALER_exchange_offline_denomination_revoke_sign (
     120             :   const struct GNUNET_HashCode *h_denom_pub,
     121             :   const struct TALER_MasterPrivateKeyP *master_priv,
     122             :   struct TALER_MasterSignatureP *master_sig)
     123             : {
     124           8 :   struct TALER_MasterDenominationKeyRevocationPS rm = {
     125           8 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED),
     126           8 :     .purpose.size = htonl (sizeof (rm)),
     127             :     .h_denom_pub = *h_denom_pub
     128             :   };
     129             : 
     130           8 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     131             :                             &rm,
     132             :                             &master_sig->eddsa_signature);
     133           8 : }
     134             : 
     135             : 
     136             : enum GNUNET_GenericReturnValue
     137          24 : TALER_exchange_offline_denomination_revoke_verify (
     138             :   const struct GNUNET_HashCode *h_denom_pub,
     139             :   const struct TALER_MasterPublicKeyP *master_pub,
     140             :   const struct TALER_MasterSignatureP *master_sig)
     141             : {
     142          24 :   struct TALER_MasterDenominationKeyRevocationPS kr = {
     143          24 :     .purpose.purpose = htonl (
     144             :       TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED),
     145          24 :     .purpose.size = htonl (sizeof (kr)),
     146             :     .h_denom_pub = *h_denom_pub
     147             :   };
     148             : 
     149          24 :   return GNUNET_CRYPTO_eddsa_verify (
     150             :     TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
     151             :     &kr,
     152             :     &master_sig->eddsa_signature,
     153             :     &master_pub->eddsa_pub);
     154             : }
     155             : 
     156             : 
     157             : void
     158           0 : TALER_exchange_offline_signkey_revoke_sign (
     159             :   const struct TALER_ExchangePublicKeyP *exchange_pub,
     160             :   const struct TALER_MasterPrivateKeyP *master_priv,
     161             :   struct TALER_MasterSignatureP *master_sig)
     162             : {
     163           0 :   struct TALER_MasterSigningKeyRevocationPS kv = {
     164           0 :     .purpose.purpose = htonl (
     165             :       TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED),
     166           0 :     .purpose.size = htonl (sizeof (kv)),
     167             :     .exchange_pub = *exchange_pub
     168             :   };
     169             : 
     170           0 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     171             :                             &kv,
     172             :                             &master_sig->eddsa_signature);
     173           0 : }
     174             : 
     175             : 
     176             : enum GNUNET_GenericReturnValue
     177           0 : TALER_exchange_offline_signkey_revoke_verify (
     178             :   const struct TALER_ExchangePublicKeyP *exchange_pub,
     179             :   const struct TALER_MasterPublicKeyP *master_pub,
     180             :   const struct TALER_MasterSignatureP *master_sig)
     181             : {
     182           0 :   struct TALER_MasterSigningKeyRevocationPS rm = {
     183           0 :     .purpose.purpose = htonl (
     184             :       TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED),
     185           0 :     .purpose.size = htonl (sizeof (rm)),
     186             :     .exchange_pub = *exchange_pub
     187             :   };
     188             : 
     189           0 :   return GNUNET_CRYPTO_eddsa_verify (
     190             :     TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED,
     191             :     &rm,
     192             :     &master_sig->eddsa_signature,
     193             :     &master_pub->eddsa_pub);
     194             : }
     195             : 
     196             : 
     197             : void
     198          14 : TALER_exchange_offline_signkey_validity_sign (
     199             :   const struct TALER_ExchangePublicKeyP *exchange_pub,
     200             :   struct GNUNET_TIME_Absolute start_sign,
     201             :   struct GNUNET_TIME_Absolute end_sign,
     202             :   struct GNUNET_TIME_Absolute end_legal,
     203             :   const struct TALER_MasterPrivateKeyP *master_priv,
     204             :   struct TALER_MasterSignatureP *master_sig)
     205             : {
     206          28 :   struct TALER_ExchangeSigningKeyValidityPS skv = {
     207          14 :     .purpose.purpose = htonl (
     208             :       TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY),
     209          14 :     .purpose.size = htonl (sizeof (skv)),
     210          14 :     .start = GNUNET_TIME_absolute_hton (start_sign),
     211          14 :     .expire = GNUNET_TIME_absolute_hton (end_sign),
     212          14 :     .end = GNUNET_TIME_absolute_hton (end_legal),
     213             :     .signkey_pub = *exchange_pub
     214             :   };
     215             : 
     216          14 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     217             :                             &skv,
     218             :                             &master_sig->eddsa_signature);
     219          14 : }
     220             : 
     221             : 
     222             : enum GNUNET_GenericReturnValue
     223          41 : TALER_exchange_offline_signkey_validity_verify (
     224             :   const struct TALER_ExchangePublicKeyP *exchange_pub,
     225             :   struct GNUNET_TIME_Absolute start_sign,
     226             :   struct GNUNET_TIME_Absolute end_sign,
     227             :   struct GNUNET_TIME_Absolute end_legal,
     228             :   const struct TALER_MasterPublicKeyP *master_pub,
     229             :   const struct TALER_MasterSignatureP *master_sig)
     230             : {
     231          82 :   struct TALER_ExchangeSigningKeyValidityPS skv = {
     232          41 :     .purpose.purpose = htonl (
     233             :       TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY),
     234          41 :     .purpose.size = htonl (sizeof (skv)),
     235          41 :     .start = GNUNET_TIME_absolute_hton (start_sign),
     236          41 :     .expire = GNUNET_TIME_absolute_hton (end_sign),
     237          41 :     .end = GNUNET_TIME_absolute_hton (end_legal),
     238             :     .signkey_pub = *exchange_pub
     239             :   };
     240             : 
     241             :   return
     242          41 :     GNUNET_CRYPTO_eddsa_verify (
     243             :     TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY,
     244             :     &skv,
     245             :     &master_sig->eddsa_signature,
     246             :     &master_pub->eddsa_pub);
     247             : }
     248             : 
     249             : 
     250             : void
     251         116 : TALER_exchange_offline_denom_validity_sign (
     252             :   const struct GNUNET_HashCode *h_denom_pub,
     253             :   struct GNUNET_TIME_Absolute stamp_start,
     254             :   struct GNUNET_TIME_Absolute stamp_expire_withdraw,
     255             :   struct GNUNET_TIME_Absolute stamp_expire_deposit,
     256             :   struct GNUNET_TIME_Absolute stamp_expire_legal,
     257             :   const struct TALER_Amount *coin_value,
     258             :   const struct TALER_Amount *fee_withdraw,
     259             :   const struct TALER_Amount *fee_deposit,
     260             :   const struct TALER_Amount *fee_refresh,
     261             :   const struct TALER_Amount *fee_refund,
     262             :   const struct TALER_MasterPrivateKeyP *master_priv,
     263             :   struct TALER_MasterSignatureP *master_sig)
     264             : {
     265         232 :   struct TALER_DenominationKeyValidityPS issue = {
     266             :     .purpose.purpose
     267         116 :       = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY),
     268             :     .purpose.size
     269         116 :       = htonl (sizeof (issue)),
     270         116 :     .start = GNUNET_TIME_absolute_hton (stamp_start),
     271         116 :     .expire_withdraw = GNUNET_TIME_absolute_hton (stamp_expire_withdraw),
     272         116 :     .expire_deposit = GNUNET_TIME_absolute_hton (stamp_expire_deposit),
     273         116 :     .expire_legal = GNUNET_TIME_absolute_hton (stamp_expire_legal),
     274             :     .denom_hash = *h_denom_pub
     275             :   };
     276             : 
     277         116 :   GNUNET_CRYPTO_eddsa_key_get_public (&master_priv->eddsa_priv,
     278             :                                       &issue.master.eddsa_pub);
     279         116 :   TALER_amount_hton (&issue.value,
     280             :                      coin_value);
     281         116 :   TALER_amount_hton (&issue.fee_withdraw,
     282             :                      fee_withdraw);
     283         116 :   TALER_amount_hton (&issue.fee_deposit,
     284             :                      fee_deposit);
     285         116 :   TALER_amount_hton (&issue.fee_refresh,
     286             :                      fee_refresh);
     287         116 :   TALER_amount_hton (&issue.fee_refund,
     288             :                      fee_refund);
     289         116 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     290             :                             &issue,
     291             :                             &master_sig->eddsa_signature);
     292         116 : }
     293             : 
     294             : 
     295             : enum GNUNET_GenericReturnValue
     296         285 : TALER_exchange_offline_denom_validity_verify (
     297             :   const struct GNUNET_HashCode *h_denom_pub,
     298             :   struct GNUNET_TIME_Absolute stamp_start,
     299             :   struct GNUNET_TIME_Absolute stamp_expire_withdraw,
     300             :   struct GNUNET_TIME_Absolute stamp_expire_deposit,
     301             :   struct GNUNET_TIME_Absolute stamp_expire_legal,
     302             :   const struct TALER_Amount *coin_value,
     303             :   const struct TALER_Amount *fee_withdraw,
     304             :   const struct TALER_Amount *fee_deposit,
     305             :   const struct TALER_Amount *fee_refresh,
     306             :   const struct TALER_Amount *fee_refund,
     307             :   const struct TALER_MasterPublicKeyP *master_pub,
     308             :   const struct TALER_MasterSignatureP *master_sig)
     309             : {
     310         570 :   struct TALER_DenominationKeyValidityPS dkv = {
     311         285 :     .purpose.purpose = htonl (
     312             :       TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY),
     313         285 :     .purpose.size = htonl (sizeof (dkv)),
     314             :     .master = *master_pub,
     315         285 :     .start = GNUNET_TIME_absolute_hton (stamp_start),
     316         285 :     .expire_withdraw = GNUNET_TIME_absolute_hton (stamp_expire_withdraw),
     317         285 :     .expire_deposit = GNUNET_TIME_absolute_hton (stamp_expire_deposit),
     318         285 :     .expire_legal = GNUNET_TIME_absolute_hton (stamp_expire_legal),
     319             :     .denom_hash = *h_denom_pub
     320             :   };
     321             : 
     322         285 :   TALER_amount_hton (&dkv.value,
     323             :                      coin_value);
     324         285 :   TALER_amount_hton (&dkv.fee_withdraw,
     325             :                      fee_withdraw);
     326         285 :   TALER_amount_hton (&dkv.fee_deposit,
     327             :                      fee_deposit);
     328         285 :   TALER_amount_hton (&dkv.fee_refresh,
     329             :                      fee_refresh);
     330         285 :   TALER_amount_hton (&dkv.fee_refund,
     331             :                      fee_refund);
     332             :   return
     333         285 :     GNUNET_CRYPTO_eddsa_verify (
     334             :     TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
     335             :     &dkv,
     336             :     &master_sig->eddsa_signature,
     337             :     &master_pub->eddsa_pub);
     338             : }
     339             : 
     340             : 
     341             : void
     342          10 : TALER_exchange_offline_wire_add_sign (
     343             :   const char *payto_uri,
     344             :   struct GNUNET_TIME_Absolute now,
     345             :   const struct TALER_MasterPrivateKeyP *master_priv,
     346             :   struct TALER_MasterSignatureP *master_sig)
     347             : {
     348          10 :   struct TALER_MasterAddWirePS kv = {
     349          10 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_ADD_WIRE),
     350          10 :     .purpose.size = htonl (sizeof (kv)),
     351          10 :     .start_date = GNUNET_TIME_absolute_hton (now),
     352             :   };
     353             : 
     354          10 :   GNUNET_assert (GNUNET_OK ==
     355             :                  GNUNET_TIME_round_abs (&now));
     356          10 :   TALER_exchange_wire_signature_hash (payto_uri,
     357             :                                       &kv.h_wire);
     358          10 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     359             :                             &kv,
     360             :                             &master_sig->eddsa_signature);
     361          10 : }
     362             : 
     363             : 
     364             : enum GNUNET_GenericReturnValue
     365          11 : TALER_exchange_offline_wire_add_verify (
     366             :   const char *payto_uri,
     367             :   struct GNUNET_TIME_Absolute sign_time,
     368             :   const struct TALER_MasterPublicKeyP *master_pub,
     369             :   const struct TALER_MasterSignatureP *master_sig)
     370             : {
     371          11 :   struct TALER_MasterAddWirePS aw = {
     372          11 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_ADD_WIRE),
     373          11 :     .purpose.size = htonl (sizeof (aw)),
     374          11 :     .start_date = GNUNET_TIME_absolute_hton (sign_time),
     375             :   };
     376             : 
     377          11 :   TALER_exchange_wire_signature_hash (payto_uri,
     378             :                                       &aw.h_wire);
     379             :   return
     380          11 :     GNUNET_CRYPTO_eddsa_verify (
     381             :     TALER_SIGNATURE_MASTER_ADD_WIRE,
     382             :     &aw,
     383             :     &master_sig->eddsa_signature,
     384             :     &master_pub->eddsa_pub);
     385             : }
     386             : 
     387             : 
     388             : void
     389           2 : TALER_exchange_offline_wire_del_sign (
     390             :   const char *payto_uri,
     391             :   struct GNUNET_TIME_Absolute now,
     392             :   const struct TALER_MasterPrivateKeyP *master_priv,
     393             :   struct TALER_MasterSignatureP *master_sig)
     394             : {
     395           2 :   struct TALER_MasterDelWirePS kv = {
     396           2 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DEL_WIRE),
     397           2 :     .purpose.size = htonl (sizeof (kv)),
     398           2 :     .end_date = GNUNET_TIME_absolute_hton (now),
     399             :   };
     400             : 
     401           2 :   GNUNET_assert (GNUNET_OK ==
     402             :                  GNUNET_TIME_round_abs (&now));
     403           2 :   TALER_exchange_wire_signature_hash (payto_uri,
     404             :                                       &kv.h_wire);
     405           2 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     406             :                             &kv,
     407             :                             &master_sig->eddsa_signature);
     408           2 : }
     409             : 
     410             : 
     411             : enum GNUNET_GenericReturnValue
     412           3 : TALER_exchange_offline_wire_del_verify (
     413             :   const char *payto_uri,
     414             :   struct GNUNET_TIME_Absolute sign_time,
     415             :   const struct TALER_MasterPublicKeyP *master_pub,
     416             :   const struct TALER_MasterSignatureP *master_sig)
     417             : {
     418           3 :   struct TALER_MasterDelWirePS aw = {
     419           3 :     .purpose.purpose = htonl (
     420             :       TALER_SIGNATURE_MASTER_DEL_WIRE),
     421           3 :     .purpose.size = htonl (sizeof (aw)),
     422           3 :     .end_date = GNUNET_TIME_absolute_hton (sign_time),
     423             :   };
     424             : 
     425           3 :   TALER_exchange_wire_signature_hash (payto_uri,
     426             :                                       &aw.h_wire);
     427           3 :   return GNUNET_CRYPTO_eddsa_verify (
     428             :     TALER_SIGNATURE_MASTER_DEL_WIRE,
     429             :     &aw,
     430             :     &master_sig->eddsa_signature,
     431             :     &master_pub->eddsa_pub);
     432             : }
     433             : 
     434             : 
     435             : void
     436           9 : TALER_exchange_offline_wire_fee_sign (
     437             :   const char *payment_method,
     438             :   struct GNUNET_TIME_Absolute start_time,
     439             :   struct GNUNET_TIME_Absolute end_time,
     440             :   const struct TALER_Amount *wire_fee,
     441             :   const struct TALER_Amount *closing_fee,
     442             :   const struct TALER_MasterPrivateKeyP *master_priv,
     443             :   struct TALER_MasterSignatureP *master_sig)
     444             : {
     445           9 :   struct TALER_MasterWireFeePS kv = {
     446           9 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_FEES),
     447           9 :     .purpose.size = htonl (sizeof (kv)),
     448           9 :     .start_date = GNUNET_TIME_absolute_hton (start_time),
     449           9 :     .end_date = GNUNET_TIME_absolute_hton (end_time),
     450             :   };
     451             : 
     452           9 :   GNUNET_CRYPTO_hash (payment_method,
     453           9 :                       strlen (payment_method) + 1,
     454             :                       &kv.h_wire_method);
     455           9 :   TALER_amount_hton (&kv.wire_fee,
     456             :                      wire_fee);
     457           9 :   TALER_amount_hton (&kv.closing_fee,
     458             :                      closing_fee);
     459           9 :   GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
     460             :                             &kv,
     461             :                             &master_sig->eddsa_signature);
     462           9 : }
     463             : 
     464             : 
     465             : enum GNUNET_GenericReturnValue
     466          27 : TALER_exchange_offline_wire_fee_verify (
     467             :   const char *payment_method,
     468             :   struct GNUNET_TIME_Absolute start_time,
     469             :   struct GNUNET_TIME_Absolute end_time,
     470             :   const struct TALER_Amount *wire_fee,
     471             :   const struct TALER_Amount *closing_fee,
     472             :   const struct TALER_MasterPublicKeyP *master_pub,
     473             :   const struct TALER_MasterSignatureP *master_sig)
     474             : {
     475          27 :   struct TALER_MasterWireFeePS wf = {
     476          27 :     .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_FEES),
     477          27 :     .purpose.size = htonl (sizeof (wf)),
     478          27 :     .start_date = GNUNET_TIME_absolute_hton (start_time),
     479          27 :     .end_date = GNUNET_TIME_absolute_hton (end_time)
     480             :   };
     481             : 
     482          27 :   GNUNET_CRYPTO_hash (payment_method,
     483          27 :                       strlen (payment_method) + 1,
     484             :                       &wf.h_wire_method);
     485          27 :   TALER_amount_hton (&wf.wire_fee,
     486             :                      wire_fee);
     487          27 :   TALER_amount_hton (&wf.closing_fee,
     488             :                      closing_fee);
     489             :   return
     490          27 :     GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_FEES,
     491             :                                 &wf,
     492             :                                 &master_sig->eddsa_signature,
     493             :                                 &master_pub->eddsa_pub);
     494             : }
     495             : 
     496             : 
     497             : /* end of offline_signatures.c */

Generated by: LCOV version 1.14