From 2bb4dc6260298746729ec3f6b8da0f2d597946c6 Mon Sep 17 00:00:00 2001 From: Yoshiaki Naka Date: Fri, 27 May 2016 12:42:01 +0900 Subject: [PATCH] The length of APDU-AR-DO must not be zero If APDU-AR-DO contains a generic access rule indicator, the length of APDU-AR-DO must be 1. If it contains APDU filter(s), the length must be the number of APDU filter * 8 according to Global Platform Secure Element Access Control specification. --- .../service/security/gpac/dataobjects/APDU_AR_DO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/simalliance/openmobileapi/service/security/gpac/dataobjects/APDU_AR_DO.java b/src/org/simalliance/openmobileapi/service/security/gpac/dataobjects/APDU_AR_DO.java index 41f477e..f6d9e1a 100644 --- a/src/org/simalliance/openmobileapi/service/security/gpac/dataobjects/APDU_AR_DO.java +++ b/src/org/simalliance/openmobileapi/service/security/gpac/dataobjects/APDU_AR_DO.java @@ -106,7 +106,7 @@ public void interpret() // it contains APDU filter (APDUHeader | FilterMask) which should have length n*8. if( getValueLength() == 1 ){ mApduAllowed = (data[index] == 0x01); - } else if(getValueLength() % 8 == 0 ) { + } else if ((getValueLength() > 0) && (getValueLength() % 8 == 0)) { mApduAllowed = true; for( int i = index; i < index + getValueLength(); i +=8 ){