@@ -902,7 +902,8 @@ pub mod pallet {
902902 Self :: verify_authority ( authority_id) ?;
903903
904904 // verify if the signature was originated from the authority_id.
905- if !signature. verify ( psbt. as_ref ( ) , authority_id) {
905+ let message = [ keccak_256 ( "UnsignedPsbt" . as_bytes ( ) ) . as_slice ( ) , psbt] . concat ( ) ;
906+ if !signature. verify ( & * message, authority_id) {
906907 return InvalidTransaction :: BadProof . into ( ) ;
907908 }
908909
@@ -921,7 +922,9 @@ pub mod pallet {
921922 }
922923
923924 // verify if the signature was originated from the authority.
924- if !signature. verify ( signed_psbt. as_ref ( ) , authority_id) {
925+ let message =
926+ [ keccak_256 ( "SignedPsbt" . as_bytes ( ) ) . as_slice ( ) , signed_psbt] . concat ( ) ;
927+ if !signature. verify ( & * message, authority_id) {
925928 return InvalidTransaction :: BadProof . into ( ) ;
926929 }
927930
@@ -936,7 +939,9 @@ pub mod pallet {
936939 Self :: verify_authority ( authority_id) ?;
937940
938941 // verify if the signature was originated from the authority_id.
939- if !signature. verify ( txid. as_ref ( ) , authority_id) {
942+ let message =
943+ [ keccak_256 ( "ExecutedPsbt" . as_bytes ( ) ) . as_slice ( ) , txid. as_ref ( ) ] . concat ( ) ;
944+ if !signature. verify ( & * message, authority_id) {
940945 return InvalidTransaction :: BadProof . into ( ) ;
941946 }
942947
@@ -955,7 +960,9 @@ pub mod pallet {
955960 }
956961
957962 // verify if the signature was originated from the authority_id.
958- if !signature. verify ( txid. as_ref ( ) , authority_id) {
963+ let message =
964+ [ keccak_256 ( "RollbackPoll" . as_bytes ( ) ) . as_slice ( ) , txid. as_ref ( ) ] . concat ( ) ;
965+ if !signature. verify ( & * message, authority_id) {
959966 return InvalidTransaction :: BadProof . into ( ) ;
960967 }
961968
0 commit comments