Skip to content

Commit 833db11

Browse files
committed
logs 2
1 parent 5c536e4 commit 833db11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pair.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ func (cli *Client) handlePair(ctx context.Context, deviceIdentityBytes []byte, r
147147
return &PairProtoError{"failed to parse signed device identity in pair success message", err}
148148
}
149149

150-
if !verifyDeviceIdentityAccountSignature(&deviceIdentity, cli.Store.IdentityKey, isHostedAccount) {
150+
if !VerifyDeviceIdentityAccountSignature(&deviceIdentity, cli.Store.IdentityKey, isHostedAccount) {
151151
cli.sendPairError(reqID, 401, "signature-mismatch")
152152
return ErrPairInvalidDeviceSignature
153153
}
154154

155155
deviceIdentity.DeviceSignature = generateDeviceSignature(&deviceIdentity, cli.Store.IdentityKey, isHostedAccount)[:]
156+
cli.Log.Infof("deviceIdentity.DeviceSignature = %x", deviceIdentity.DeviceSignature)
156157

157158
var deviceIdentityDetails waAdv.ADVDeviceIdentity
158159
err = proto.Unmarshal(deviceIdentity.Details, &deviceIdentityDetails)
@@ -246,7 +247,7 @@ func concatBytes(data ...[]byte) []byte {
246247
return output
247248
}
248249

249-
func verifyDeviceIdentityAccountSignature(deviceIdentity *waAdv.ADVSignedDeviceIdentity, ikp *keys.KeyPair, isHostedAccount bool) bool {
250+
func VerifyDeviceIdentityAccountSignature(deviceIdentity *waAdv.ADVSignedDeviceIdentity, ikp *keys.KeyPair, isHostedAccount bool) bool {
250251
if len(deviceIdentity.AccountSignatureKey) != 32 || len(deviceIdentity.AccountSignature) != 64 {
251252
return false
252253
}

0 commit comments

Comments
 (0)