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 />

424 + ( short ) 1) ) ) ;<br />

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

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

427 ( encryptedChildPointer + ( short ) 1) ) ,<br />

428 S i g n a t u r e .MODE_SIGN) ;<br />

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

430 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCBCookieArray ,<br />

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

432 this . SCBCookieArray . l e n g t h ) ;<br />

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

434 this . shortToBytes ( this . r e c e i v i n g B u f f e r , mainLengthPointer ,<br />

435 ( short ) ( copyPointer − ( short ) 7) ) ;<br />

436 }<br />

437 }<br />

438 void plat<strong>for</strong>mHashGeneration (byte [ ] inArray , short i n O f f s e t ) {}<br />

439 void processSecondMsg ( byte [ ] inArray ) {<br />

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

441 this . CTLVDataOffset ) ;<br />

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

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

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

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

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

447 U t i l . arrayCopyNonAtomic ( inArray , i n O f f s e t , this . SCBIdentity ,<br />

448 ( short ) 0 , ( short )<br />

449 this . SCBIdentity . l e n g t h ) ;<br />

450 i n O f f s e t += ( short ) 1 5 1 ;<br />

451 inLength = ( short ) 3 ;<br />

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

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

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

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

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

457 inLength = ( short ) 6 8 ;<br />

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

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

460 return ;<br />

461 } else {<br />

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

463 }<br />

464 } else {<br />

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

466 }<br />

467 }<br />

468 void parseMessage ( byte [ ] i n B u f f e r ) {<br />

469 byte c h i l d L e f t = i n B u f f e r [ ( short ) ( this . CTLVDataOffset − ( short ) 1)<br />

470 ] ;<br />

471 short p o i n t e r = ( short ) this . CTLVDataOffset ;<br />

472 try {<br />

473 while ( c h i l d L e f t > 0) {<br />

474 i f ( U t i l . arrayCompare ( SCBDHChallengeTag , ( short ) 0 , i n B u f f e r ,<br />

413

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

Saved successfully!

Ooh no, something went wrong!