Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-friendly error messages #61

Closed
diabonas opened this issue Oct 21, 2019 · 0 comments · Fixed by #70
Closed

User-friendly error messages #61

diabonas opened this issue Oct 21, 2019 · 0 comments · Fixed by #70
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@diabonas
Copy link
Member

Currently running tpm2-totp generate with a secret already stored results in

Calling Esys_GetRandom for 20 bytes
Calling Esys_CreatePrimary
WARNING:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:333:Esys_NV_DefineSpace_Finish() Received TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:122:Esys_NV_DefineSpace() Esys Finish ErrorCode (0x0000014c) 
ERROR in tpm2totp_storeKey_nv (src/libtpm2-totp.c:590): 0x0000014c

ERROR in main (src/tpm2-totp.c:337): 0x0000014c

We should at least use tss2-rc to also return a human-readable error message like "NV Index or persistent object already defined".

Additionally custom error message for common error cases, e.g. "Secret already stored, use tpm2-totp calculate to show the TOTP or tpm2-totp clean to delete the stored secret", would be nice as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant