@@ -77,6 +77,7 @@ func (s *platformSuite) TestRecoverKeysIntegrated(c *C) {
7777 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
7878 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
7979 Role : "foo" ,
80+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
8081 }
8182
8283 k , primaryKey , unlockKey , err := NewTPMProtectedKey (s .TPM (), params )
@@ -95,6 +96,7 @@ func (s *platformSuite) TestRecoverKeysWithPassphraseIntegrated(c *C) {
9596 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
9697 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
9798 Role : "bar" ,
99+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
98100 }
99101
100102 passphraseParams := & PassphraseProtectKeyParams {
@@ -117,6 +119,7 @@ func (s *platformSuite) TestRecoverKeysWithPassphraseIntegratedPBKDF2(c *C) {
117119 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
118120 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
119121 Role : "foo" ,
122+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
120123 }
121124
122125 passphraseParams := & PassphraseProtectKeyParams {
@@ -143,6 +146,7 @@ func (s *platformSuite) TestRecoverKeysWithBadPassphraseIntegrated(c *C) {
143146 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
144147 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
145148 Role : "foo" ,
149+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
146150 }
147151
148152 passphraseParams := & PassphraseProtectKeyParams {
@@ -163,6 +167,7 @@ func (s *platformSuite) TestChangePassphraseIntegrated(c *C) {
163167 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
164168 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
165169 Role : "foo" ,
170+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
166171 }
167172
168173 passphraseParams := & PassphraseProtectKeyParams {
@@ -187,6 +192,7 @@ func (s *platformSuite) TestChangePassphraseWithBadPassphraseIntegrated(c *C) {
187192 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
188193 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
189194 Role : "foo" ,
195+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
190196 }
191197
192198 passphraseParams := & PassphraseProtectKeyParams {
@@ -255,13 +261,15 @@ func (s *platformSuite) TestRecoverKeysSimplePCRProfile(c *C) {
255261 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
256262 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
257263 Role : "foo" ,
264+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
258265 })
259266}
260267
261268func (s * platformSuite ) TestRecoverKeysNilPCRProfile (c * C ) {
262269 s .testRecoverKeys (c , & ProtectKeyParams {
263270 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
264271 Role : "foo" ,
272+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
265273 })
266274}
267275
@@ -270,6 +278,7 @@ func (s *platformSuite) TestRecoverKeysNoPCRPolicyCounter(c *C) {
270278 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
271279 PCRPolicyCounterHandle : tpm2 .HandleNull ,
272280 Role : "foo" ,
281+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
273282 })
274283}
275284
@@ -278,6 +287,7 @@ func (s *platformSuite) TestRecoverKeysDifferentRole(c *C) {
278287 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
279288 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
280289 Role : "bar" ,
290+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
281291 })
282292}
283293
@@ -289,6 +299,7 @@ func (s *platformSuite) TestRecoverKeysTPMLockout(c *C) {
289299 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
290300 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
291301 Role : "" ,
302+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
292303 })
293304}
294305
@@ -297,6 +308,7 @@ func (s *platformSuite) testRecoverKeysNoValidSRK(c *C, prepareSrk func()) {
297308 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
298309 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
299310 Role : "foo" ,
311+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
300312 }
301313
302314 k , primaryKey , unlockKey , err := NewTPMProtectedKey (s .TPM (), params )
@@ -387,13 +399,15 @@ func (s *platformSuite) testRecoverKeysImportable(c *C, params *ProtectKeyParams
387399func (s * platformSuite ) TestRecoverKeysImportableSimplePCRProfile (c * C ) {
388400 s .testRecoverKeysImportable (c , & ProtectKeyParams {
389401 PCRProfile : tpm2test .NewResolvedPCRProfileFromCurrentValues (c , s .TPM ().TPMContext , tpm2 .HashAlgorithmSHA256 , []int {7 }),
390- PCRPolicyCounterHandle : tpm2 .HandleNull })
402+ PCRPolicyCounterHandle : tpm2 .HandleNull ,
403+ NameAlg : tpm2 .HashAlgorithmSHA256 })
391404}
392405
393406func (s * platformSuite ) TestRecoverKeysImportableNilPCRProfile (c * C ) {
394407 s .testRecoverKeysImportable (c , & ProtectKeyParams {
395408 PCRPolicyCounterHandle : tpm2 .HandleNull ,
396- Role : "" })
409+ Role : "" ,
410+ NameAlg : tpm2 .HashAlgorithmSHA256 })
397411}
398412
399413func (s * platformSuite ) TestRecoverKeysNoTPMConnection (c * C ) {
@@ -404,6 +418,7 @@ func (s *platformSuite) TestRecoverKeysNoTPMConnection(c *C) {
404418 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
405419 PCRPolicyCounterHandle : tpm2 .HandleNull ,
406420 Role : "" ,
421+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
407422 })
408423 c .Check (err , IsNil )
409424
@@ -431,7 +446,8 @@ func (s *platformSuite) testRecoverKeysUnsealErrorHandling(c *C, prepare func(*s
431446 params := & ProtectKeyParams {
432447 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 , 23 }),
433448 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
434- Role : "foo" }
449+ Role : "foo" ,
450+ NameAlg : tpm2 .HashAlgorithmSHA256 }
435451
436452 k , primaryKey , _ , err := NewTPMProtectedKey (s .TPM (), params )
437453 c .Assert (err , IsNil )
@@ -581,6 +597,7 @@ func (s *platformSuite) TestRecoverKeysWithAuthKey(c *C) {
581597 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
582598 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
583599 Role : "foo" ,
600+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
584601 }
585602
586603 k , primaryKey , unlockKey , err := NewTPMProtectedKey (s .TPM (), params )
@@ -671,6 +688,7 @@ func (s *platformSuite) TestRecoverKeysWithIncorrectAuthKey(c *C) {
671688 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
672689 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
673690 Role : "" ,
691+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
674692 }
675693
676694 k , _ , _ , err := NewTPMProtectedKey (s .TPM (), params )
@@ -754,6 +772,7 @@ func (s *platformSuite) TestChangeAuthKeyWithIncorrectAuthKey(c *C) {
754772 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
755773 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
756774 Role : "" ,
775+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
757776 }
758777
759778 k , _ , _ , err := NewTPMProtectedKey (s .TPM (), params )
@@ -839,6 +858,7 @@ func (s *platformSuite) TestRecoverKeysWithAuthKeyTPMLockout(c *C) {
839858 PCRProfile : tpm2test .NewPCRProfileFromCurrentValues (tpm2 .HashAlgorithmSHA256 , []int {7 }),
840859 PCRPolicyCounterHandle : s .NextAvailableHandle (c , 0x0181fff0 ),
841860 Role : "" ,
861+ NameAlg : tpm2 .HashAlgorithmSHA256 ,
842862 }
843863
844864 k , _ , _ , err := NewTPMProtectedKey (s .TPM (), params )
0 commit comments