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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C.8 Application Binding Protocol - Distributed<br />

338 this . phServerAppKeyPair . g e t P r i v a t e ( ) ,<br />

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

340 } catch ( Exception cE ) {<br />

341 ISOException . throwIt ( ( short ) 0 x3141 ) ;<br />

342 }<br />

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

344 copyPointer = U t i l . arrayCopyNonAtomic ( this . S e r v e r A p p C e r t i f i c a t e ,<br />

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

346 this . S e r v e r A p p C e r t i f i c a t e . l e n g t h ) ;<br />

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

348 try {<br />

349 this . messageEncryption ( this . r e c e i v i n g B u f f e r , ( short ) ( childPM2<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 . ClientAppCookieArray ,<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 . ClientAppCookieArray . 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 ClientAppVerificationKey . 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 ClientAppVerificationKey . 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 />

399

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

Saved successfully!

Ooh no, something went wrong!