This commit is contained in:
parent
77d10ee93c
commit
9679e856b4
2 changed files with 29 additions and 34 deletions
|
|
@ -51,7 +51,7 @@ module Keys_post = struct
|
|||
denom_hash;
|
||||
}
|
||||
in
|
||||
verify Keys.master_pub master_sig r
|
||||
verify master_sig r
|
||||
|
||||
let verify_denom_sigs (module Keys : Keys.S) denom_sigs =
|
||||
let* fdn_l = Keys.future_denominations () in
|
||||
|
|
@ -86,7 +86,7 @@ module Keys_post = struct
|
|||
signkey_pub= key;
|
||||
}
|
||||
in
|
||||
verify Keys.master_pub master_sig r
|
||||
verify master_sig r
|
||||
|
||||
let verify_signkey_sigs (module Keys : Keys.S) signkey_sigs =
|
||||
let* fsk_l = Keys.future_signkeys () in
|
||||
|
|
@ -137,7 +137,7 @@ module Denom_revoke = struct
|
|||
let verify (module Keys : Keys.S) h_denom_pub
|
||||
DenomRevocationSignature.{ master_sig } =
|
||||
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
|
||||
DenomRevocationSignature.{ master_sig } =
|
||||
|
|
@ -163,7 +163,7 @@ module Signkey_revoke = struct
|
|||
let verify (module Keys : Keys.S) exchange_pub
|
||||
SignkeyRevocationSignature.{ master_sig } =
|
||||
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
|
||||
SignkeyRevocationSignature.{ master_sig } =
|
||||
|
|
@ -196,7 +196,7 @@ module Auditors = struct
|
|||
validity_start;
|
||||
} =
|
||||
let open Signatures.MasterAddAuditor in
|
||||
verify Keys.master_pub master_sig
|
||||
verify master_sig
|
||||
{
|
||||
start_date= validity_start;
|
||||
auditor_pub;
|
||||
|
|
@ -243,7 +243,7 @@ module Auditors_disable = struct
|
|||
let verify (module Keys : Keys.S) auditor_pub
|
||||
AuditorTeardownMessage.{ master_sig; validity_end } =
|
||||
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
|
||||
AuditorTeardownMessage.{ master_sig= _; validity_end } =
|
||||
|
|
@ -291,7 +291,7 @@ module Wire_fee = struct
|
|||
wire_fee;
|
||||
} =
|
||||
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;
|
||||
start_date= fee_start;
|
||||
|
|
@ -353,7 +353,7 @@ module Global_fees = struct
|
|||
master_sig;
|
||||
} =
|
||||
let open Signatures.GlobalFees in
|
||||
verify Keys.master_pub master_sig
|
||||
verify master_sig
|
||||
{
|
||||
start_date;
|
||||
end_date;
|
||||
|
|
@ -426,7 +426,7 @@ module Wire = struct
|
|||
let debit_restrictions = "" in
|
||||
let* () =
|
||||
let open Signatures.MasterWireDetails in
|
||||
verify Keys.master_pub master_sig_wire
|
||||
verify master_sig_wire
|
||||
{
|
||||
h_wire_details= FullPaytoHash.hash payto_uri;
|
||||
h_conversion_url= Hash.Cstring.H64.hash conversion_url;
|
||||
|
|
@ -436,7 +436,7 @@ module Wire = struct
|
|||
in
|
||||
let* () =
|
||||
let open Signatures.MasterAddWire in
|
||||
verify Keys.master_pub master_sig_add
|
||||
verify master_sig_add
|
||||
{
|
||||
start_date= validity_start;
|
||||
h_wire= FullPaytoHash.hash payto_uri;
|
||||
|
|
@ -492,7 +492,7 @@ module Wire_disable = struct
|
|||
let verify (module Keys : Keys.S)
|
||||
WireTeardownMessage.{ payto_uri; master_sig_del; validity_end } =
|
||||
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 }
|
||||
|
||||
let do_ ~db_conn
|
||||
|
|
@ -535,7 +535,7 @@ module Drain = struct
|
|||
amount;
|
||||
} =
|
||||
let open Signatures.MasterDrainProfit in
|
||||
verify Keys.master_pub master_sig
|
||||
verify master_sig
|
||||
{
|
||||
wtid;
|
||||
date;
|
||||
|
|
@ -576,7 +576,7 @@ module AmlOfficer = struct
|
|||
} =
|
||||
let open Signatures.MasterAmlOfficerStatus 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;
|
||||
officer_pub;
|
||||
|
|
@ -616,7 +616,7 @@ module Partners = struct
|
|||
wad_fee;
|
||||
} =
|
||||
let open Signatures.PartnerConfiguration in
|
||||
verify Keys.master_pub master_sig
|
||||
verify master_sig
|
||||
{
|
||||
partner_pub;
|
||||
start_date;
|
||||
|
|
|
|||
|
|
@ -184,14 +184,9 @@ module MK (R : R) : SIGNATURE with type r := R.r = struct
|
|||
end
|
||||
|
||||
module MK_master_sig (R : R) = struct
|
||||
open Crypto
|
||||
include MK (R)
|
||||
|
||||
let to_string = Bin.to_string R.bin
|
||||
|
||||
let verify t r =
|
||||
EddsaSignature.verify ~key:Config.Exchange.master_public_key t
|
||||
~msg:(to_string r)
|
||||
let verify = verify Config.Exchange.master_public_key
|
||||
end
|
||||
|
||||
(* ---- *)
|
||||
|
|
@ -315,7 +310,7 @@ module DenominationKeyValidity = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module ExchangeSigningKeyValidity = struct
|
||||
|
|
@ -342,7 +337,7 @@ module ExchangeSigningKeyValidity = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDenominationKeyRevocation = struct
|
||||
|
|
@ -360,7 +355,7 @@ module MasterDenominationKeyRevocation = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterSigningKeyRevocation = struct
|
||||
|
|
@ -378,7 +373,7 @@ module MasterSigningKeyRevocation = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterAddAuditor = struct
|
||||
|
|
@ -402,7 +397,7 @@ module MasterAddAuditor = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDelAuditor = struct
|
||||
|
|
@ -423,7 +418,7 @@ module MasterDelAuditor = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module GlobalFees = struct
|
||||
|
|
@ -478,7 +473,7 @@ module GlobalFees = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterWireDetails = struct
|
||||
|
|
@ -516,7 +511,7 @@ module MasterWireDetails = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterAddWire = struct
|
||||
|
|
@ -558,7 +553,7 @@ module MasterAddWire = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDelWire = struct
|
||||
|
|
@ -579,7 +574,7 @@ module MasterDelWire = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDrainProfit = struct
|
||||
|
|
@ -607,7 +602,7 @@ module MasterDrainProfit = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterAmlOfficerStatus = struct
|
||||
|
|
@ -633,7 +628,7 @@ module MasterAmlOfficerStatus = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module PartnerConfiguration = struct
|
||||
|
|
@ -672,7 +667,7 @@ module PartnerConfiguration = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module WadPartnerSignature = struct
|
||||
|
|
@ -748,7 +743,7 @@ module MasterWireFee = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module ExchangeKeyValidity = struct
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue