From 6587776a3cd236da773f392344e108aaadee9b9e Mon Sep 17 00:00:00 2001 From: Andrew Scull Date: Thu, 20 Apr 2023 14:10:25 +0000 Subject: [PATCH] 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 --- .../server/security/rkp/RemoteProvisioningShellCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 71eca691dba78..bc3908452bc1f 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 @@ class RemoteProvisioningShellCommand extends ShellCommand { 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 @@ class RemoteProvisioningShellCommand extends ShellCommand { challenge = Base64.getDecoder().decode(getNextArgRequired()); break; default: - getErrPrintWriter().println("error: unknown option"); + getErrPrintWriter().println("error: unknown option " + opt); return ERROR; } }