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.6 Application Acquisition and Contractual Agreement Protocol<br />

135 System . arraycopy ( this . SPRandomNumber . getValueBytes ( ) , 0 , temp ,<br />

136 this . SPDHChanllenger . getValueLength ( ) ,<br />

137 this . SPRandomNumber . getValueLength ( ) ) ;<br />

138 System . arraycopy ( this . SCIP , 0 , temp , temp . l e n g t h −<br />

139 this . SCIP . length , this . SCIP . l e n g t h ) ;<br />

140 byte [ ] r e s u l t = new byte [ 1 6 ] ;<br />

141 this . myProtocolHelperObject . GenerateMac ( temp , 0 , temp . length ,<br />

142 r e s u l t , 0 , this . myProtocolHelperObject . myLongTermMacKey) ;<br />

143 this . SPCookie . setTlvValues ( r e s u l t ) ;<br />

144 this . MessageHandler . addPTLV( this . SPCookie ) ;<br />

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

146 System . out . p r i n t l n (<br />

147 " Error ProtocolHandler . inMessageProcessing<br />

Option = 2 , : " + cE . g e t C l a s s ( ) . getName ( ) ) ;<br />

148 }<br />

149 } else i f ( Counter == 2) {<br />

150 try {<br />

151 this . EncryptedData . i n i t i a l i s a t i o n C T L V ( this . EncryptedDataTag ) ;<br />

152 this . EncryptedData . addPTLV( this . SPIdentityTLV ) ;<br />

153 this . EncryptedData . addPTLV( this . AppIdentityTLV ) ;<br />

154 this . EncryptedData . addPTLV( this . SPRandomNumber) ;<br />

155 this . EncryptedData . addPTLV( this . SCRandomNumber) ;<br />

156 this . myProtocolHelperObject . GenerateEncryption<br />

157 ( this . EncryptedData . getValueBytes ( ) , 0 ,<br />

158 this . EncryptedData . getValueBytes ( ) . length ,<br />

159 this . EncryptedData . getBytesTlvRepresentation ( ) , 7 ,<br />

160 this . mySessionEncryptionKey ) ;<br />

161 this . MACedData . i n i t i a l i s a t i o n P T L V ( this . MACedDataTag , 16) ;<br />

162 this . myProtocolHelperObject . GenerateMac<br />

163 ( this . EncryptedData . getValueBytes ( ) , 0 ,<br />

164 this . EncryptedData . getTagValueLength ( ) ,<br />

165 this . MACedData . getBytesTlvRepresentation ( ) , 6 ,<br />

166 this . mySessionMacKey ) ;<br />

167 this . MessageHandler . i n i t i a l i s a t i o n C T L V ( this . MessageHandlerTagTwo ) ;<br />

168 this . MessageHandler . addCTLV( EncryptedData ) ;<br />

169 this . MessageHandler . addPTLV( this . MACedData) ;<br />

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

171 System . out . p r i n t l n (<br />

172 " Error ProtocolHandler . inMessageProcessing<br />

Option = 3 , : " + cE . g e t C l a s s ( ) . getName ( ) ) ;<br />

173 }<br />

174 } else i f ( Counter == 3) {<br />

175 try {<br />

176 this . EncryptedData . i n i t i a l i s a t i o n C T L V ( this . EncryptedDataTag ) ;<br />

177 this . EncryptedData . addPTLV( this . SPIdentityTLV ) ;<br />

178 this . EncryptedData . addPTLV( this . SPRandomNumber) ;<br />

179 this . EncryptedData . addPTLV( this . SCRandomNumber) ;<br />

180 this . myProtocolHelperObject . SignatureMethod<br />

181 ( this . EncryptedData . getValueBytes ( ) , 0 ,<br />

182 this . EncryptedData . getValueBytes ( ) . length ,<br />

183 this . SignedData . getBytesTlvRepresentation ( ) , 6 , null ,<br />

353

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

Saved successfully!

Ooh no, something went wrong!