Skip to content

Commit

Permalink
Fix "tpm2_ptool verify --sopin" without "--userpin"
Browse files Browse the repository at this point in the history
When using option `--sopin` in `tpm2_ptool verify`, `usersealauth` is
not initialized but is being used. In practise, the value in
`verify_output['wrappingkey']['auth']` is the same as the one in
`verify_output['pin']['user']`, so make sure this is set only when the
user PIN is really used.

Fixes: tpm2-software#624
Signed-off-by: Nicolas Iooss <nicolas.iooss@ledger.fr>
  • Loading branch information
niooss-ledger committed Dec 28, 2020
1 parent 39f1e0b commit 2a82d32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/tpm2_pkcs11/commandlets_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ def verify(db, args):

verify_output['wrappingkey'] = {
'hex' : bytes.hex(wrappingkeyauth),
'auth' : usersealauth['hash']
}
if userpin != None:
verify_output['wrappingkey']['auth'] = usersealauth['hash']
if sopin != None:
verify_output['wrappingkey']['soauth'] = sosealauth['hash']

wrapper = AESAuthUnwrapper(wrappingkeyauth)

Expand Down

0 comments on commit 2a82d32

Please sign in to comment.