From af1da5f236e168fb29b9a4440890aea079fc4904 Mon Sep 17 00:00:00 2001 From: Subrahmanyaman Date: Wed, 5 Oct 2022 22:40:07 +0000 Subject: [PATCH] Challenge validation. challenge cannot be more than 64 bytes --- .../javacard/keymaster/RemotelyProvisionedComponentDevice.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Applet/src/com/android/javacard/keymaster/RemotelyProvisionedComponentDevice.java b/Applet/src/com/android/javacard/keymaster/RemotelyProvisionedComponentDevice.java index 8c385e6e..e92f7713 100644 --- a/Applet/src/com/android/javacard/keymaster/RemotelyProvisionedComponentDevice.java +++ b/Applet/src/com/android/javacard/keymaster/RemotelyProvisionedComponentDevice.java @@ -413,7 +413,7 @@ public void processUpdateChallenge(APDU apdu) throws Exception { // Store the challenge in the data table. short challenge = KMArray.cast(arr).get((short) 0); short challengeLen = KMByteBlob.cast(challenge).length(); - if (challengeLen < 32 || challengeLen > 64) { + if (challengeLen > 64) { KMException.throwIt(KMError.INVALID_INPUT_LENGTH); } short dataEntryIndex = createEntry(CHALLENGE, challengeLen);