This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R-Q1: Can a Slave get the passkey a Master is trying to use in order to pairing/bonding with it ?

Part Number: CC2642R-Q1
Other Parts Discussed in Thread: CC2642R

Tool/software:

Hi to everyone,

I'm working with CC2642R, SDK_CC26X2_R2_4_40_00_44 and multi_role example. I'm also using MITM & Pairing with passkey to pairing and bonding with generic Master.

In my scenario I can have SPhone1 and all the other generic SPhone_n. For SPhone_1 I have set Passkey_1, whether for all the other SPhone_n I have set the Passkey_2 

My goal is to aknoledge if the pairing from a Master is coming from SPhone_1 or from all the other SPhone, without know in advance the MAC address of SPhone_1.

 

At the moment I'm working in this (not ideal) way: 

during a connection from a generic Master, multi_role receive MR_EVT_PASSCODE_NEEDED event. So multi_role_processPasscode((mrPasscodeData_t*)(pMsg->pData)); is called.

Inside this function I try at first, to call GAPBondMgr_PasscodeRsp(pData->connHandle, SUCCESS, Passkey_1); 

If the pairing is done with success, it means that the Master connected was SPhoner_1, otherwise after the connection is drop, for the next MR_EVT_PASSCODE_NEEDED  event, the multi_role will ask for GAPBondMgr_PasscodeRsp(pData->connHandle, SUCCESS, Passkey_2); to see if the Master who is trying to Pair is a generic SPhone_n

I've read the GAPBondMgr and LE Secure Connection documents, but I couldn't figure out if is possible to get the passkey received from Master, before the whole pairing and bonding process is done/failed.

May be I can't due to encryption?

Thanks in advance for your support

Federico

  

  • Hello Federico,

    Can you provide more information on why you need to identify the IPhone without knowing the MAC address ahead of time, and why is it necessary to identify a particular Master device? 

    For standard passkey entry, the link must be established before the passkeys are exchanged. Additionally, the MAC address will be known to the peripheral after a link is established.  

    Out of Band Pairing is a feature that allows for the authentication between both devices to be completed on a channel out of the band of the device. I recommend looking into the feature in the Gap Bond Manager section of the user's guide.  

    Thanks, 

    Isaac

  • Hi Isaac and thanks for your time.

    I know that link must be establish before the passkey are exchanged and at this point I can get the MAC Address of the SPhone.

    However, even if I can get the MAC of the SPhone connected, I still not able to recognize if the SPhone connected is SPhone_1 or SPhone_n. This because I don't know (and never will) which MAC has the SPhone_1. I can recognize the SPhone_1 just from the passkey it will send me. So, only when Sphone will send to multi_role the passkey, I can understand, based from the passkey value, if the Sphone is SPhone_1 or others Sphones. The Sphone run with customer APP. Once I recognize if the Sphone connected is SPhone_1 or SPhone_n, multi_role can  react with different behaviours.

    This is a customer's application and SPhone_1 in reality is not a Sphone but a customer device, which the multi_role, as I already explained, doesn't know its MAC at all.

    So, first  multi_role can understand if the connected Master is SPhone_1, first it can react with correct behaviours. I would like to know if there is a way to get the passkey sent from Master (in order to speed up this aknoledgment) before to wait the result of the pairing and bonding process.

    Actually, as I wrote, if the pairing is done successully using passkey_1, I know for sure that the connected SPhone is Sphone_1, otherwise, if the pairing fail, it means that the SPhone that was connected using a different Passkey, must probably was a SPhone different from SPhone_1. So multi_role at the next master connection request, will try to use Passkey_n instead Passke_1

    Hope it's more clear now what I'm trying to speed up

    Thanks, Federico

  • Hello Federico, 

    For this I would again, recommend Out of Band Pairing. This feature allows for the authentication of both devices out of the band of the device. The Peripheral and Central can be authenticated outside of a standard connection. 

    Out of Band Pairing also allows for additional information to be exchanged. This additional information can be a passkey, which is then used in the pairing process. 

    Please reference the Out of Band Pairing section in Gap Bond Manager chapter of the Users Guide. Additionally, please reference the Bluetooth Low Energy Core Specification. You can find more about Out of Band Pairing in sections Vol. 1 - 5.2.4.3, Vol. 3 - 2.3.5.4, 2.3.5.6, 5.2.2.7, and various other sections. 

    Let me know if this help! 

    Thanks,

    Isaac

  • Hi Isaac,

    I can't use out of band pairing due to the customer APP. I can't change the pairing method. Would you like to answer me if there is a way to aknowledge the passkey sent from SPhone before the pairing process is completed?

    Many thanks, Federico    

  • Hello Federico, 

    Can you provide me more information on the use case for this authentication method? 

    The method you are describing will be a security vulnerability, due to the exchange of passkeys over the air before encryption. 

    I can assist in finding an alternative method to verify the first IPhone, but I need to know more about the use case. 

    Let me know!

    Thanks, 
    Isaac

  • Hi Isaac, may be I didn't explain in a good way what I'm looking for, sorry for that.

    With multi_role, I'm asking (to all the Master) a pairing(and bonding) with passkey method. This pairing method If I'm not wrong, use MITM for max security level.

    multi_role is expecting a certain passkey(fixed value). I would like to understand, if there is a way, to get the passkey which the Master has sent to me(multi_role) before multi_role(myself) will validate it or not.

    I can't see any kind of security vulnerability, since its the multi_role itself that need to get the passkey value sent from the master.

    Thanks and regards, Federico 

  • Hello Federico, 

    By use case, I meant more the end use case of the implementation, car access, priority devices, etc.? 

    First, would the passkey for the first device be fixed in the final use case? That would be a security vulnerability. For more information, please read section 2.3.5.3 of the Bluetooth Core Specification.  

    I get that you would like to speed up the acknowledgement, but can you verify that device entering the passkey is device 1 when the key is confirmed by multi-role? Anything sent before the passkey is verified by the multi-role device will not be encrypted. Because of this, the passkeys passed between devices before the normal passkey exchange will be susceptible to man in the middle attacks. Please read section 2.3.5.6.3 in the Bluetooth Core Specification for more information on how the passkeys are exchanged. 

    Can you use an implementation which assigns specific behavior to the first connection, then assigns a different behavior for the successive connections? Please let me know the end use case, and I can help provide some alternative methods. 

    Additionally, is there a specific reason you are using SDK v4.40.00.44?

    Let me know!

    Thanks, 

    Isaac

  • Hello Federico, 

    Additionally, can you provide me what the input/output capabilities for two devices will be? Please refer to the Selection of Pairing Method section of the Gap Bond Manager section of the User's Guide. 

    Regarding the static passkey, and distributing the passkey before encryption, TI does not recommend this, although it can be done. Just be aware that the passkey will not be encrypted if exchanged before pairing, which can lead to a major security vulnerability. 

    Thanks, 
    Isaac