一.概念
    The Security Manager defines methods of pairing and key distribution, a protocol for those methods and a security toolbox to be used by those methods and other parts of an LE device.

二.pairing过程
    分为3个phase:
• Phase 1: Pairing Feature Exchange
• Phase 2: Short Term Key (STK) Generation
• Phase 3: Transport Specific Key Distribution

  其中,在phase2生成Short Term Key (STK)的过程,可以用到以下三种方法:
• Just Works
• Passkey Entry
• Out Of Band (OOB)
下面是一些chart,可以具体看三个phase实现的一些动作:
1.总的过程如下

可以看到第二个生成STK的过程有三个方法。
 
2.先看第一个phase:Pairing Feature Exchange
分为master主动发起和slave要求发起,多了一个slave发起的Security Request (AuthReq)

3.第二个phase:Authenticating and Encrypting

分别对应上面 Just Works, Passkey Entry 和Out Of Band (OOB)三种方法。
 

我们来比较一下这三种方法,Just Works Pairing Method使用的TK = 0x00,Passkey Entry Pairing Method使用的TK是用户输入的,而OOB Pairing Method使用的TK = OOB TK Value,其余过程都是一样的。我们在phase1中进行Feature Exchange,获得一些参数,通过函数:
c1(TK, Mrand, Pairing Request command, Pairing Response command,initiating device address type, initiating device address, responding device address type, responding device address)
分别在master和slave端计算得到Mconfirm和Sconfirm,通过Pairing Confirm和Pairing Random交换Mconfirm和Sconfirm以及Mrand和Srand,两端再进行Check for confirm value match,通过函数:
STK = s1(TK, Srand, Mrand)
计算出最终的STK。然后用这个STK来对LE link进行encrypted。
 
3.phase3: Transport Specific Key Distribution
生成STK并对link进行加密后,就可以进行这一步了:

然后可能使用LTK来进行re-establish security,举例如下:

三.错误处理
在这三个phase过程中,可能出错。
例如在phase1中可能出现:
Pairing Failed (“Encryption Key Size”)
Pairing Failed (“Encryption Key Size”)
在phase2中:
Pairing Failed (“Passkey Entry Failed”)
Pairing Failed (“Confirm Value Failed”)等等。

最新文章

  1. javascript继承的三种模式
  2. JavaScript数组去重
  3. %格式化和format格式化--python
  4. gulp的使用
  5. Delphi版本顺序
  6. qml 一些知识点
  7. 【英语】Bingo口语笔记(62) - 生气道歉场景的表达
  8. php xml常用函数的集合(比较详细)
  9. 如何让虚拟目录里面的webconfig不继承网站的设置
  10. 三十项调整助力 Ubuntu 13.04 更上一层楼
  11. noi 7221 拯救公主 (状态压缩+bfs)
  12. Web Server (IIS) Administration Cmdlets in Windows PowerShell
  13. php:跨域
  14. java和.net的类比
  15. 个人VIM配置实例
  16. Ubuntu 环境 TensorFlow (最新版1.4) 源码编译、安装
  17. ubuntu批量更改文件权限
  18. AngularJS进阶(十四)AngularJS灵异代码事件
  19. spring-data-redis和jedis版本对应收集总结
  20. 微信小程序 获得用户输入内容

热门文章

  1. Adapter适配器
  2. Android WebView访问SSL证书网页(onReceivedSslError)
  3. Hue中给BI分配的权限
  4. 抓包工具Fiddler的使用
  5. JVM的栈内存
  6. node相关--socket.io
  7. Xamarin.Forms项目无法添加服务引用
  8. POJ1204 Word Puzzles(AC自动机)
  9. Sky数[HDU2097]
  10. robotium 新建 android 测试项目: