Skip to content

refactor(utxo-core): changed toString for proof message to hex #6392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/utxo-core/src/paygo/psbt/payGoAddressProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
* @param psbt - PSBT that we need to encode our paygo address into
* @param outputIndex - the index of the address in our output
* @param sig - the signature that we want to encode
* @param entropy - the arbitrary entropy bytes from our vasp proof
*/
export function addPayGoAddressProof(
psbt: utxolib.bitgo.UtxoPsbt,
Expand All @@ -40,7 +41,7 @@ export function addPayGoAddressProof(
*
* @param psbt - PSBT we want to verify that the paygo address is in
* @param outputIndex - we have the output index that address is in
* @param uuid
* @param verificationPubkey - the pubkey signed by the HSM to verify our message
* @returns
*/
export function verifyPayGoAddressProof(
Expand Down Expand Up @@ -76,7 +77,8 @@ export function verifyPayGoAddressProof(
// We construct our message <ENTROPY><ADDRESS><UUID>
const message = createPayGoAttestationBuffer(addressFromOutput, entropy, psbt.network);

if (!verifyMessage(message.toString(), verificationPubkey, signature, utxolib.networks.bitcoin)) {
// bip32utils.verifyMessage now takes in message as a Buffer
if (!verifyMessage(message, verificationPubkey, signature, utxolib.networks.bitcoin)) {
throw new ErrorPayGoAddressProofFailedVerification();
}
}
Expand Down
Loading