GTS fail之GtsPackageSignatureTest和GtsApexSignatureVerificationTest

本文主要是介绍GTS fail之GtsPackageSignatureTest和GtsApexSignatureVerificationTest,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目录

1. Fail项具体详情

2. Google为何增加测试项

3. 解决方法


1. Fail项具体详情

run gts -m GtsPackageSignatureTest -t android.security.cts.PackageSignatureTest#testPackageSignatures fail

TestResultDetails
android.security.cts.PackageSignatureTest#testPackageSignaturesfailjunit.framework.AssertionFailedError: These packages should not be signed with a well known key: [com.android.hotspot2.osulogin, com.android.wifi.resources]arm64-v8a GtsPackageSignatureTest

run gts -m GtsApexSignatureVerificationTest -t android.appsecurity.cts.ApexSignatureVerificationTest#testApexPubKeyIsNotWellKnownKey

arm64-v8a GtsApexSignatureVerificationTest
TestResultDetails
android.appsecurity.cts.ApexSignatureVerificationTest#testApexPubKeyIsNotWellKnownKey

fail

3 expectations failed: 1. com.android.vndk.v31 must not use well known pubkey expected to be false at android.appsecurity.cts.ApexSignatureVerificationTest.testApexPubKeyIsNotWellKnownKey(ApexSignatureVerificationTest.java:158) 2. com.android.appsearch must not use well known pubkey expected to be false ... 1 more 3. com.android.wifi must not use well known pubkey expected to be false ... 1 more

从case的名称上来看,两类case都是针对Apex(Android pony express)做的针对性测试,而且从字面上来看都是需要加强对签名Key的强化,而且第二类ApexPubKey其实有点眼熟,之前CTS有处理过类似的问题,具体可参考之前记录的该篇Cts 失败项之CtsAppSecurityHostTestCases-CSDN博客,本文简单梳理下GtsPackageSignatureTest。

2. Google为何增加测试项

为什么Google会增加case来强制让我们更新Apex的sign key呢,不明真相的我们可能会觉得多此一举,个人最初也会有类似的感受,但直到我查了下GTS的release notes,就觉得还是需要重视sign key的,原来是CVE漏洞的需要,这里也没有能力对CVE展开,就贴一下供大家参考,有Google partner账号的,可以继续对漏洞做进一步的了解,这里我就不瞎带路了。

3. 解决方法

因为GtsApexSignatureVerificationTest处理方案就是重新给对用的apex生成相应的avb pub key, 只要参考Cts 失败项之CtsAppSecurityHostTestCases-CSDN博客, 

直接说下GtsPackageSignatureTest的签名问题,打开com.android.hotspot2.osulogin, com.android.wifi.resources对应的bp

以com.android.hotspot2.osulogin为例,Android.bp的内容如下:

android_app {name: "OsuLogin",defaults: ["wifi-module-sdk-version-defaults"],static_libs: ["androidx.legacy_legacy-support-v4"],resource_dirs: ["res"],srcs: ["src/**/*.java"],sdk_version: "system_current",
//把默认的签名修改为platform签名
-   certificate: ":com.android.hotspot2.osulogin.certificate",
+   certificate: ":platform",  apex_available: ["com.android.wifi","test_com.android.wifi",],
}android_app_certificate {name: "com.android.hotspot2.osulogin.certificate",certificate: "certs/com.android.hotspot2.osulogin"
}

这里提一个快速验证是否生效的办法,编译完OS检查OTA target_file的META目录下apexkeys.txt文件中对应的Apex package的签名是否有带platform签名的路径即可,随便举例类似:

name="com.android.cellbroadcast.apex" public_key="packages/apps/CellBroadcastReceiver/apex/com.android.cellbroadcast.avbpubkey" private_key="packages/apps/CellBroadcastReceiver/apex/com.android.cellbroadcast.pem" container_certificate="build/make/xx/xxx/releasekey.x509.pem" container_private_key="build/make/xx/xxx/releasekey.pk8" partition="system_ext"

以上自己做个记录,也分享给遇到这个问题朋友。

这篇关于GTS fail之GtsPackageSignatureTest和GtsApexSignatureVerificationTest的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/871898

相关文章

每天一道面试题(2):fail-safe 机制与 fail-fast 机制分别有什么作用?

当谈论Java集合的 fail-fast 和 fail-safe 机制时,涉及的是在集合被并发修改时的行为和处理方式。这些机制对保证程序的正确性和稳定性非常重要,尤其是在多线程环境中。 1. Fail-Fast 机制 定义: Fail-fast 机制的核心是在检测到集合在遍历过程中被修改时,立即抛出 ConcurrentModificationException 异常,从而中断迭代操作。这种

getLocation:fail, the permission value is offline verifying

getLocation:fail, the permission value is offline verifying 后端会根据appid和secret生成 签名,前端wx配置时一定用appid来验证签名的正确 本次错误为配置初始化失败:前端与后端的appId不一致,我的失误也

Cannot run program aapt: error=2. No such file or directory Fail to run aapt on *.apk apk instal

配置aapt 路径 将/home/user/android-sdk-linux/build-tools/21.1.2 中的aapt 拷贝至/home/user/android-sdk-linux/platform-tools 与adb 同级目录

拷贝别人编译好的的aosp后自己编译报错FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks

在使用scp -r拷贝别人的sdk后编译无法通过pathtools测试,原因是拷贝时把链接也当成了真实的文件或者目录,尤其是拷贝build目录时会残留之前别人编译的文件夹。 FAILED: out/soong/.bootstrap/blueprint-pathtools/test/test.passedout/soong/.bootstrap/bin/gotestrunner -p ./bui

rv1126--Create RKNN model fail, error=-13,rknn_init error ret=-13

在rv1126板子上加载rknn模型时报错,   ./run_rv1109_rv1126.shpost process config: box_conf_threshold = 0.50, nms_threshold = 0.60Loading mode...Create RKNN model fail, error=-13rknn_init error ret=-13 这时候当然是去

20. Java中的fail-fast机制是什么?它是如何在集合中实现的?

Fail-Fast 机制是指在迭代器遍历集合的过程中,如果集合结构被修改(如添加、删除元素),迭代器会立即抛出 ConcurrentModificationException,从而快速失败(fail-fast),以防止出现不确定的行为或数据不一致的问题。 Fail-Fast 机制的目的是尽早检测并发修改错误(即在一个线程中遍历集合的同时,另一个线程修改了集合),从而帮助开发者发现和修复潜在的

启动redis提醒WARNING overcommit_memory is set to 0!Background save may fail under low memory condition.

前言 本人在Centos7服务器上启动redis,报如下问题: WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and the

zabbix出现active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to

出现active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to [[127.0.0.1]:10051]: [111] Connection refused),直接编辑zabbix_agentd.conf(vi /usr/local/zabbix/etc/zabbix_agen

[28期] Nothing 的项目感想(success and fail )

项目感想 从开始的设计来说吧,自己的问题主要出现在设计阶段,开始设计的时候对这个项目还不熟悉,因为很少用商城,对商城的具体流程不清楚,就看了很多开源的商城,还有网上大型的商城,但是在数据库设计过程中还是出现了几个问题。 后台设计 1. 订单模块是自己需求设计中最失败的地方,当时想的是把用户购买的商品用一个字符串存储起来,n件商品就需要一个字符串,一条记录就能搞定,不用想常规方法用几条记录

如何定位报错: indexSelectLargeIndex:... Assertion `srcIndex < srcSelectDimSize` fail

文章目录 1. 背景2. 准备工作2.1 debug工具2.2 设置准备工作 3. 开启 debug 1. 背景 在使用 cuda 在 gpu 计算的过程中,出现索引超过最大长度。 indexSelectLargeIndex:... Assertion `srcIndex < srcSelectDimSize` fail 通常这种时候堆栈底部还伴随以下报错: Runt