This commit is contained in:
swrup 2026-02-21 22:11:13 +01:00
parent 77d10ee93c
commit 9679e856b4
2 changed files with 29 additions and 34 deletions

View file

@ -51,7 +51,7 @@ module Keys_post = struct
denom_hash; denom_hash;
} }
in in
verify Keys.master_pub master_sig r verify master_sig r
let verify_denom_sigs (module Keys : Keys.S) denom_sigs = let verify_denom_sigs (module Keys : Keys.S) denom_sigs =
let* fdn_l = Keys.future_denominations () in let* fdn_l = Keys.future_denominations () in
@ -86,7 +86,7 @@ module Keys_post = struct
signkey_pub= key; signkey_pub= key;
} }
in in
verify Keys.master_pub master_sig r verify master_sig r
let verify_signkey_sigs (module Keys : Keys.S) signkey_sigs = let verify_signkey_sigs (module Keys : Keys.S) signkey_sigs =
let* fsk_l = Keys.future_signkeys () in let* fsk_l = Keys.future_signkeys () in
@ -137,7 +137,7 @@ module Denom_revoke = struct
let verify (module Keys : Keys.S) h_denom_pub let verify (module Keys : Keys.S) h_denom_pub
DenomRevocationSignature.{ master_sig } = DenomRevocationSignature.{ master_sig } =
let open Signatures.MasterDenominationKeyRevocation in let open Signatures.MasterDenominationKeyRevocation in
verify Keys.master_pub master_sig { h_denom_pub } verify master_sig { h_denom_pub }
let do_ (module Keys : Keys.S) h_denom_pub let do_ (module Keys : Keys.S) h_denom_pub
DenomRevocationSignature.{ master_sig } = DenomRevocationSignature.{ master_sig } =
@ -163,7 +163,7 @@ module Signkey_revoke = struct
let verify (module Keys : Keys.S) exchange_pub let verify (module Keys : Keys.S) exchange_pub
SignkeyRevocationSignature.{ master_sig } = SignkeyRevocationSignature.{ master_sig } =
let open Signatures.MasterSigningKeyRevocation in let open Signatures.MasterSigningKeyRevocation in
verify Keys.master_pub master_sig { exchange_pub } verify master_sig { exchange_pub }
let do_ (module Keys : Keys.S) exchange_pub let do_ (module Keys : Keys.S) exchange_pub
SignkeyRevocationSignature.{ master_sig } = SignkeyRevocationSignature.{ master_sig } =
@ -196,7 +196,7 @@ module Auditors = struct
validity_start; validity_start;
} = } =
let open Signatures.MasterAddAuditor in let open Signatures.MasterAddAuditor in
verify Keys.master_pub master_sig verify master_sig
{ {
start_date= validity_start; start_date= validity_start;
auditor_pub; auditor_pub;
@ -243,7 +243,7 @@ module Auditors_disable = struct
let verify (module Keys : Keys.S) auditor_pub let verify (module Keys : Keys.S) auditor_pub
AuditorTeardownMessage.{ master_sig; validity_end } = AuditorTeardownMessage.{ master_sig; validity_end } =
let open Signatures.MasterDelAuditor in let open Signatures.MasterDelAuditor in
verify Keys.master_pub master_sig { end_date= validity_end; auditor_pub } verify master_sig { end_date= validity_end; auditor_pub }
let do_ ~db_conn auditor_pub let do_ ~db_conn auditor_pub
AuditorTeardownMessage.{ master_sig= _; validity_end } = AuditorTeardownMessage.{ master_sig= _; validity_end } =
@ -291,7 +291,7 @@ module Wire_fee = struct
wire_fee; wire_fee;
} = } =
let open Signatures.MasterWireFee in let open Signatures.MasterWireFee in
verify Keys.master_pub master_sig_wire verify master_sig_wire
{ {
h_wire_method= Hash.Cstring.H64.hash wire_method; h_wire_method= Hash.Cstring.H64.hash wire_method;
start_date= fee_start; start_date= fee_start;
@ -353,7 +353,7 @@ module Global_fees = struct
master_sig; master_sig;
} = } =
let open Signatures.GlobalFees in let open Signatures.GlobalFees in
verify Keys.master_pub master_sig verify master_sig
{ {
start_date; start_date;
end_date; end_date;
@ -426,7 +426,7 @@ module Wire = struct
let debit_restrictions = "" in let debit_restrictions = "" in
let* () = let* () =
let open Signatures.MasterWireDetails in let open Signatures.MasterWireDetails in
verify Keys.master_pub master_sig_wire verify master_sig_wire
{ {
h_wire_details= FullPaytoHash.hash payto_uri; h_wire_details= FullPaytoHash.hash payto_uri;
h_conversion_url= Hash.Cstring.H64.hash conversion_url; h_conversion_url= Hash.Cstring.H64.hash conversion_url;
@ -436,7 +436,7 @@ module Wire = struct
in in
let* () = let* () =
let open Signatures.MasterAddWire in let open Signatures.MasterAddWire in
verify Keys.master_pub master_sig_add verify master_sig_add
{ {
start_date= validity_start; start_date= validity_start;
h_wire= FullPaytoHash.hash payto_uri; h_wire= FullPaytoHash.hash payto_uri;
@ -492,7 +492,7 @@ module Wire_disable = struct
let verify (module Keys : Keys.S) let verify (module Keys : Keys.S)
WireTeardownMessage.{ payto_uri; master_sig_del; validity_end } = WireTeardownMessage.{ payto_uri; master_sig_del; validity_end } =
let open Signatures.MasterDelWire in let open Signatures.MasterDelWire in
verify Keys.master_pub master_sig_del verify master_sig_del
{ end_date= validity_end; h_wire= FullPaytoHash.hash payto_uri } { end_date= validity_end; h_wire= FullPaytoHash.hash payto_uri }
let do_ ~db_conn let do_ ~db_conn
@ -535,7 +535,7 @@ module Drain = struct
amount; amount;
} = } =
let open Signatures.MasterDrainProfit in let open Signatures.MasterDrainProfit in
verify Keys.master_pub master_sig verify master_sig
{ {
wtid; wtid;
date; date;
@ -576,7 +576,7 @@ module AmlOfficer = struct
} = } =
let open Signatures.MasterAmlOfficerStatus in let open Signatures.MasterAmlOfficerStatus in
let is_active = match is_active with true -> 1_l | false -> 0_l in let is_active = match is_active with true -> 1_l | false -> 0_l in
verify Keys.master_pub master_sig verify master_sig
{ {
change_date; change_date;
officer_pub; officer_pub;
@ -616,7 +616,7 @@ module Partners = struct
wad_fee; wad_fee;
} = } =
let open Signatures.PartnerConfiguration in let open Signatures.PartnerConfiguration in
verify Keys.master_pub master_sig verify master_sig
{ {
partner_pub; partner_pub;
start_date; start_date;

View file

@ -184,14 +184,9 @@ module MK (R : R) : SIGNATURE with type r := R.r = struct
end end
module MK_master_sig (R : R) = struct module MK_master_sig (R : R) = struct
open Crypto
include MK (R) include MK (R)
let to_string = Bin.to_string R.bin let verify = verify Config.Exchange.master_public_key
let verify t r =
EddsaSignature.verify ~key:Config.Exchange.master_public_key t
~msg:(to_string r)
end end
(* ---- *) (* ---- *)
@ -315,7 +310,7 @@ module DenominationKeyValidity = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module ExchangeSigningKeyValidity = struct module ExchangeSigningKeyValidity = struct
@ -342,7 +337,7 @@ module ExchangeSigningKeyValidity = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterDenominationKeyRevocation = struct module MasterDenominationKeyRevocation = struct
@ -360,7 +355,7 @@ module MasterDenominationKeyRevocation = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterSigningKeyRevocation = struct module MasterSigningKeyRevocation = struct
@ -378,7 +373,7 @@ module MasterSigningKeyRevocation = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterAddAuditor = struct module MasterAddAuditor = struct
@ -402,7 +397,7 @@ module MasterAddAuditor = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterDelAuditor = struct module MasterDelAuditor = struct
@ -423,7 +418,7 @@ module MasterDelAuditor = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module GlobalFees = struct module GlobalFees = struct
@ -478,7 +473,7 @@ module GlobalFees = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterWireDetails = struct module MasterWireDetails = struct
@ -516,7 +511,7 @@ module MasterWireDetails = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterAddWire = struct module MasterAddWire = struct
@ -558,7 +553,7 @@ module MasterAddWire = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterDelWire = struct module MasterDelWire = struct
@ -579,7 +574,7 @@ module MasterDelWire = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterDrainProfit = struct module MasterDrainProfit = struct
@ -607,7 +602,7 @@ module MasterDrainProfit = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module MasterAmlOfficerStatus = struct module MasterAmlOfficerStatus = struct
@ -633,7 +628,7 @@ module MasterAmlOfficerStatus = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module PartnerConfiguration = struct module PartnerConfiguration = struct
@ -672,7 +667,7 @@ module PartnerConfiguration = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module WadPartnerSignature = struct module WadPartnerSignature = struct
@ -748,7 +743,7 @@ module MasterWireFee = struct
|> sealr |> sealr
end end
include MK (R) include MK_master_sig (R)
end end
module ExchangeKeyValidity = struct module ExchangeKeyValidity = struct