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.4 Secure and Trusted Channel Protocol Service Provider<br />

372 ( MessageDigest .ALG_SHA_256, f a l s e ) ;<br />

373 tempLength = ( short )myHashGen . doFinal ( this . ClassDH . dhModulus ,<br />

( short ) 0 ,<br />

374 ( short ) this . ClassDH . dhModulus . length , r e c e i v i n g B u f f e r ,<br />

375 copyPointer ) ;<br />

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

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

378 ( short ) ( tempLength ) ) ;<br />

379 copyPointer += tempLength ;<br />

380 copyPointer = U t i l . arrayCopyNonAtomic ( this . U s e r I d e n t i t y , ( short )<br />

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

382 this . U s e r I d e n t i t y . l e n g t h ) ;<br />

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

384 copyPointer = U t i l . arrayCopyNonAtomic ( this . SPIdentity , ( short ) 0 ,<br />

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

386 this . SPIdentity . l e n g t h ) ;<br />

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

388 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCRandomNumberArray ,<br />

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

390 this . SCRandomNumberArray . l e n g t h ) ;<br />

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

392 copyPointer = U t i l . arrayCopyNonAtomic ( this . SPRandomNumberArray ,<br />

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

394 this . SPRandomNumberArray . l e n g t h ) ;<br />

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

396 try {<br />

397 this . signGenerate ( r e c e i v i n g B u f f e r , ( short ) ( e n c r y p t i o n O f f s e t ) ,<br />

398 ( short ) ( copyPointer − e n c r y p t i o n O f f s e t ) ,<br />

399 phSCKeyPair . g e t P r i v a t e ( ) ,<br />

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

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

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

403 ISOException . throwIt ( ( short ) 0xFA17) ;<br />

404 }<br />

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

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

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

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

409 try {<br />

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

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

412 ( short ) ( copyPointer −<br />

413 ( encryptedChildPointer + ( short ) 1) ) ) ;<br />

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

415 ISOException . throwIt ( ( short ) ( copyPointer −<br />

416 encryptedChildPointer + ( short ) 1) ) ;<br />

417 }<br />

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

419 ( encryptedChildPointer − ( short ) 2) , ( short )<br />

420 ( copyPointer − ( short ) ( encryptedChildPointer<br />

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

298

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

Saved successfully!

Ooh no, something went wrong!