06.11.2014 Views

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C.9 Plat<strong>for</strong>m Binding Protocol<br />

350 + ( short ) 1) , ( short ) ( copyPointer −<br />

351 ( short ) ( childPM2 + ( short ) 1) ) ) ;<br />

352 } catch ( Exception ce ) {<br />

353 ISOException . throwIt ( ( short ) ( copyPointer − ( short ) ( childPM2 +<br />

354 ( short ) 1) ) ) ;<br />

355 }<br />

356 this . shortToBytes ( this . r e c e i v i n g B u f f e r , ( short ) ( childPM2 −<br />

357 ( short ) 2) , ( short ) ( copyPointer − childPM2 −<br />

358 ( short ) 1) ) ;<br />

359 this . macGenerate ( this . r e c e i v i n g B u f f e r , ( short ) ( childPM2 +<br />

360 ( short ) 1) , ( short ) ( copyPointer − ( short )<br />

361 ( childPM2 + ( short ) 1) ) , S i g n a t u r e .MODE_SIGN) ;<br />

362 this . r e c e i v i n g B u f f e r [ childPM1 ]++;<br />

363 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCACookieArray ,<br />

364 ( short ) 0 , this . r e c e i v i n g B u f f e r , ( short ) copyPointer , ( short )<br />

365 this . SCACookieArray . l e n g t h ) ;<br />

366 this . r e c e i v i n g B u f f e r [ childPM1 ]++;<br />

367 this . shortToBytes ( this . r e c e i v i n g B u f f e r , ( short ) ( childPM1 −<br />

368 ( short ) 2) , ( short ) ( copyPointer − ( short ) 7) ) ;<br />

369 }<br />

370 }<br />

371 boolean processSecondMsg ( byte [ ] inArray ) {<br />

372 short i n O f f s e t = ( short ) ( this . CTLVDataOffset +<br />

373 this . CTLVDataOffset ) ;<br />

374 short inLength = ( short ) ( ProtocolHandler . bytesToShort ( inArray ,<br />

375 ( short ) ( i n O f f s e t − ( short ) 3) ) ) ;<br />

376 i f ( this . macGenerate ( inArray , i n O f f s e t , inLength ,<br />

377 S i g n a t u r e .MODE_VERIFY) ) {<br />

378 try {<br />

379 this . phDecryption ( inArray , i n O f f s e t , inLength ) ;<br />

380 i n O f f s e t = ( short ) ( this . CTLVDataOffset + this . PTLVDataOffset<br />

381 + ( short ) 168) ;<br />

382 inLength = 3 ;<br />

383 SCAVerificationKey . setExponent ( inArray , i n O f f s e t , inLength ) ;<br />

384 i n O f f s e t += ( short ) ( inLength + this . PTLVDataOffset ) ;<br />

385 inLength = ( short ) 6 4 ;<br />

386 SCAVerificationKey . setModulus ( inArray , i n O f f s e t , inLength ) ;<br />

387 i n O f f s e t = ( short ) ( this . CTLVDataOffset + this . CTLVDataOffset ) ;<br />

388 inLength = ( short ) 8 4 ;<br />

389 i f ( this . signGenerate ( inArray , i n O f f s e t , inLength ,<br />

390 SCAVerificationKey , S i g n a t u r e .MODE_VERIFY) ) {<br />

391 return true ;<br />

392 } else {<br />

393 ISOException . throwIt ( ( short ) 0 x6666 ) ;<br />

394 }<br />

395 } catch ( Exception ce ) {<br />

396 ISOException . throwIt ( ( short ) 0xAB23) ;<br />

397 }<br />

398 return true ;<br />

399 } else {<br />

400 ISOException . throwIt ( ( short ) 0xFA18) ;<br />

425

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!