@@ -691,8 +691,6 @@ private void processGetHmacSharingParamCmd(APDU apdu) {
691691 short seed = KMByteBlob .instance ((short ) 0 );
692692 KMHmacSharingParameters .cast (params ).setNonce (nonce );
693693 KMHmacSharingParameters .cast (params ).setSeed (seed );
694- print (KMByteBlob .cast (nonce ).getBuffer (), KMByteBlob .cast (nonce ).getStartOff (),
695- KMByteBlob .cast (nonce ).length ());
696694 // prepare the response
697695 short resp = KMArray .instance ((short ) 2 );
698696 KMArray .cast (resp ).add ((short ) 0 , KMInteger .uint_16 (KMError .OK ));
@@ -771,9 +769,6 @@ private void processComputeSharedHmacCmd(APDU apdu) {
771769 short found = 0 ;
772770 //tmpVariables[9]
773771 short nonce = repository .getHmacNonce ();
774- print (KMByteBlob .cast (nonce ).getBuffer (),
775- KMByteBlob .cast (nonce ).getStartOff (),
776- KMByteBlob .cast (nonce ).length ());
777772
778773 while (paramIndex < paramsLen ) {
779774 // read HmacSharingParam
@@ -816,11 +811,6 @@ private void processComputeSharedHmacCmd(APDU apdu) {
816811 // Check if the nonce generated here is present in the hmacSharingParameters array.
817812 // Otherwise throw INVALID_ARGUMENT error.
818813 if (found == 1 ) {
819- print (repository .getHeap (),
820- (short ) (concateBuffer + bufferIndex ),nonceLen );
821- print (KMByteBlob .cast (nonce ).getBuffer (),
822- KMByteBlob .cast (nonce ).getStartOff (),
823- nonceLen );
824814 if (0
825815 == Util .arrayCompare (
826816 repository .getHeap (),
@@ -1347,7 +1337,7 @@ protected short getBootKey(byte[] scratchPad){
13471337 }
13481338 return KMByteBlob .instance (scratchPad ,(short )0 , VERIFIED_BOOT_KEY_SIZE );
13491339 }
1350-
1340+
13511341 protected short getVerifiedBootHash (byte [] scratchPad ){
13521342 Util .arrayFillNonAtomic (scratchPad , (short )0 , VERIFIED_BOOT_HASH_SIZE , (byte )0 );
13531343 short len = seProvider .getVerifiedBootHash (scratchPad ,(short )0 );
@@ -3042,14 +3032,14 @@ protected void setOsVersion(short version){
30423032 KMInteger .cast (version ).length ());
30433033 }
30443034
3045- protected void setVendorPatchLevel (short patch ){
3035+ protected void setOsPatchLevel (short patch ){
30463036 repository .setOsPatch (
30473037 KMInteger .cast (patch ).getBuffer (),
30483038 KMInteger .cast (patch ).getStartOff (),
30493039 KMInteger .cast (patch ).length ());
30503040 }
30513041
3052- protected void setOsPatchLevel (short patch ){
3042+ protected void setVendorPatchLevel (short patch ){
30533043 repository .setVendorPatchLevel (
30543044 KMInteger .cast (patch ).getBuffer (),
30553045 KMInteger .cast (patch ).getStartOff (),
@@ -3106,6 +3096,7 @@ private void processGenerateKey(APDU apdu) {
31063096 KMException .throwIt (KMError .UNSUPPORTED_ALGORITHM );
31073097 break ;
31083098 }
3099+
31093100 // create key blob and associated attestation.
31103101 data [ORIGIN ] = KMType .GENERATED ;
31113102 makeKeyCharacteristics (scratchPad );
@@ -3120,20 +3111,13 @@ private void processGenerateKey(APDU apdu) {
31203111 sendOutgoing (apdu , resp );
31213112 }
31223113
3123- private static void print (byte [] buf , short start , short length ){
3124- StringBuilder sb = new StringBuilder (length * 2 );
3125- for (short i = start ; i < (start +length ); i ++){
3126- sb .append (String .format ("%02x" , buf [i ]));
3127- }
3128- System .out .println ( sb .toString ());
3129- }
3130-
31313114 private void generateAttestation (byte [] scratchPad ){
31323115 KMAttestationCert cert = makeCert (scratchPad );
31333116 if (cert == null ) {// No certificate
31343117 data [CERTIFICATE ] = KMArray .instance ((short )0 );
31353118 return ;
31363119 }
3120+
31373121 // Allocate memory
31383122 short certData = KMByteBlob .instance (MAX_CERT_SIZE );
31393123 cert .buffer (KMByteBlob .cast (certData ).getBuffer (),
@@ -3145,9 +3129,6 @@ private void generateAttestation(byte[] scratchPad){
31453129 KMByteBlob .cast (certData ).setStartOff (cert .getCertStart ());
31463130 KMByteBlob .cast (certData ).setLength (cert .getCertLength ());
31473131
3148- print (KMByteBlob .cast (certData ).getBuffer (),
3149- KMByteBlob .cast (certData ).getStartOff (),
3150- KMByteBlob .cast (certData ).length ());
31513132 // Initialize the certificate as array of blob
31523133 data [CERTIFICATE ] = KMArray .instance ((short )1 );
31533134 KMArray .cast (data [CERTIFICATE ]).add ((short )0 , certData );
0 commit comments