451 if (link->HasRemoteOobData()) |
451 if (link->HasRemoteOobData()) |
452 { |
452 { |
453 oobPresence = EOOBDataPresent; |
453 oobPresence = EOOBDataPresent; |
454 } |
454 } |
455 THCIAuthenticationRequirement authReq = link->AuthenticationRequirement(); |
455 THCIAuthenticationRequirement authReq = link->AuthenticationRequirement(); |
456 if(ConnectionsManager().IsAcceptPairedOnlyMode()) |
456 switch(authReq) |
457 { |
457 { |
458 // in paired only mode, only MITM pairings are acceptable. |
|
459 switch(authReq) |
|
460 { |
|
461 case EMitmNotReqNoBonding: |
458 case EMitmNotReqNoBonding: |
|
459 case EMitmNotReqDedicatedBonding: |
|
460 case EMitmNotReqGeneralBonding: |
|
461 link->SetLocalMITM(EFalse); |
|
462 break; |
462 case EMitmReqNoBonding: |
463 case EMitmReqNoBonding: |
463 authReq = EMitmReqNoBonding; |
464 case EMitmReqDedicatedBonding: |
|
465 case EMitmReqGeneralBonding: |
|
466 link->SetLocalMITM(ETrue); |
464 break; |
467 break; |
465 case EMitmNotReqDedicatedBonding: |
468 default: |
466 case EMitmReqDedicatedBonding: |
469 PANIC(KBTSecPanic, EBTSecUnexpectedIoCapability); |
467 authReq = EMitmReqDedicatedBonding; |
470 break; |
468 break; |
|
469 case EMitmNotReqGeneralBonding: |
|
470 case EMitmReqGeneralBonding: |
|
471 authReq = EMitmReqGeneralBonding; |
|
472 break; |
|
473 default: |
|
474 PANIC(KBTSecPanic, EBTSecUnexpectedIoCapability); |
|
475 break; |
|
476 } |
|
477 link->SetLocalMITM(ETrue); |
|
478 } |
471 } |
479 else |
|
480 { |
|
481 link->SetLocalMITM(EFalse); |
|
482 } |
|
483 |
|
484 TRAP_IGNORE(iCommandController->IOCapabilityRequestReplyL(aAddr, EIOCapsDisplayYesNo, oobPresence, authReq)); |
472 TRAP_IGNORE(iCommandController->IOCapabilityRequestReplyL(aAddr, EIOCapsDisplayYesNo, oobPresence, authReq)); |
485 } |
473 } |
486 else |
474 else |
487 { |
475 { |
488 TRAP_IGNORE(iCommandController->IOCapabilityRequestNegativeReplyL(aAddr, EPairingNotAllowed)); |
476 TRAP_IGNORE(iCommandController->IOCapabilityRequestNegativeReplyL(aAddr, EPairingNotAllowed)); |