Tweak remote_provisioning command line interface
Only print an IRPC's minimum number of keys on versions of the HAL where
it will be meaningful and initialized. Also indicate which options could
not be understood.
Test: atest RemoteProvisioningShellCommandTest
Bug: 265747549
Change-Id: I0dbcd6af5a5de20783b6d57874fb67801a39240d
diff --git a/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java b/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java
index 71eca69..bc39084 100644
--- a/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java
+++ b/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java
@@ -134,7 +134,9 @@
pw.println("supportedEekCurve=" + info.supportedEekCurve);
}
pw.println("uniqueId=" + info.uniqueId);
- pw.println("supportedNumKeysInCsr=" + info.supportedNumKeysInCsr);
+ if (info.versionNumber >= 3) {
+ pw.println("supportedNumKeysInCsr=" + info.supportedNumKeysInCsr);
+ }
}
private int list() throws RemoteException {
@@ -153,7 +155,7 @@
challenge = Base64.getDecoder().decode(getNextArgRequired());
break;
default:
- getErrPrintWriter().println("error: unknown option");
+ getErrPrintWriter().println("error: unknown option " + opt);
return ERROR;
}
}