Skip CSR generation for AVF RKP HAL when it is not supported
Test: Run `adb shell rkp_factory_extraction_tool
--output_format build+csr` on a device AVF RKP HAL is unsupported
Change-Id: I8f1ffa63710be6f566fb6f0800c45f3cfb907d69
diff --git a/provisioner/rkp_factory_extraction_tool.cpp b/provisioner/rkp_factory_extraction_tool.cpp
index 62d62cf..1cb1144 100644
--- a/provisioner/rkp_factory_extraction_tool.cpp
+++ b/provisioner/rkp_factory_extraction_tool.cpp
@@ -78,6 +78,11 @@
}
void getCsrForIRpc(const char* descriptor, const char* name, IRemotelyProvisionedComponent* irpc) {
+ // AVF RKP HAL is not always supported, so we need to check if it is supported before
+ // generating the CSR.
+ if (std::string(name) == "avf" && !isRemoteProvisioningSupported(irpc)) {
+ return;
+ }
auto [request, errMsg] = getCsr(name, irpc, FLAGS_self_test);
auto fullName = getFullServiceName(descriptor, name);
if (!request) {