SystemUI 监听用户输入密码,基于Password/PIN/Pattern 生成 credential 转达给 LockSettings 校验并监听校验效果。 authResult = mSpManager.unlockLskfBasedProtector( getGateKeeperService(), protectorId, credential, userId, progressCallback); | ![]() |
LockSettings 基于 gatekeeper 或 weaver 根据 UI 传入的 credential 解密出解锁的关键数据 synthetic password。 response = mSpManager.verifyChallenge(getGateKeeperService(), authResult.syntheticPassword, 0L /* challenge */, userId); | |
上一步成功解密出 synthetic password 后,会调用 gatekeeper 进行认证。认证成功后,调用解锁成功后的各种接口。 onCredentialVerified(authResult.syntheticPassword, PasswordMetrics.computeForCredential(credential), userId); |
LockSettings 从 (sp-handle).pwd 中解析出 pwd,stretchLskf 方法基于 SystemUI传入的 credential 和之前解析出的 pwd 通过 scrypt 方法盘算出 stretchedLskf。 byte[] stretchedLskf = stretchLskf(credential, pwd); | ![]() |
LockSettings 基于上面盘算出来的 stretchedLskf 盘算出 gkPassword,本质上是个 SHA-512 择要算法。 byte[] gkPassword = stretchedLskfToGkPassword(stretchedLskf); | |
GateKeeper 基于 fakeUserId 和 刚刚盘算出来的 gkPassword 进行一次认证(此时还没有解密出 synthetic password,因此无法对真正的 UserId 进行认证)。 response = gatekeeper.verifyChallenge(fakeUserId(userId), 0L, pwd.passwordHandle, gkPassword); | |
fakeUserId 认证成功之后,LockSettings 联合 stretchedLskf 从 (sp-handle).secdis 中解密出 protectorSecret 。 protectorSecret = transformUnderSecdiscardable(stretchedLskf, secdiscardable); |
SystemUI 监听用户输入密码,基于 Password/PIN/Pattern 生成 credential 转达给 LockSettings 校验并监听校验效果。 byte[] stretchedLskf = stretchLskf(credential, pwd); | ![]() |
Locksettings将UI传入的credential下发给weaver,进一步解密出解锁的关键数据synthetic password。 result.gkResponse = weaverVerify(weaverSlot, stretchedLskfToWeaverKey(stretchedLskf)); | |
上一步成功解密出 synthetic password 后,会调用 gatekeeper 进行认证。认证成功后,调用解锁成功后的各种接口。 protectorSecret = transformUnderWeaverSecret(stretchedLskf, result.gkResponse.getGatekeeperHAT()); |
欢迎光临 IT评测·应用市场-qidao123.com技术社区 (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |