From 0c9fd64434ecdcce6f5beee0adaba0141b61d5ee Mon Sep 17 00:00:00 2001 From: Gopi Sakshihally Bhuthaiah Date: Thu, 8 Aug 2024 08:45:15 +0000 Subject: [PATCH] DH Key compute check modification for OOB Pairing --- bumble/smp.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bumble/smp.py b/bumble/smp.py index 152f9160..8e92ff6a 100644 --- a/bumble/smp.py +++ b/bumble/smp.py @@ -1739,11 +1739,21 @@ class Session: ra = self.passkey.to_bytes(16, byteorder='little') rb = ra elif self.pairing_method == PairingMethod.OOB: - if self.peer_oob_data: - ra = self.peer_oob_data.r + if self.is_initiator: + if self.peer_oob_data: + rb = self.peer_oob_data.r + ra = self.r + else: + rb = bytes(16) + ra = self.r else: - ra = bytes(16) - rb = self.r + if self.peer_oob_data: + ra = self.peer_oob_data.r + rb = self.r + else: + ra = bytes(16) + rb = self.r + else: return