tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
163 stars 36 forks source link

tpm2-totp: fix segfault for invalid command line arguments #58

Closed diabonas closed 4 years ago

diabonas commented 4 years ago

tcti_context needs to be initialised so that Tss2_TctiLdr_Finalize can be called safely in case of errors. Also add an integration test with an invalid argument to catch this issue in the future.

codecov[bot] commented 4 years ago

Codecov Report

Merging #58 into master will increase coverage by 0.54%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
+ Coverage    83.5%   84.05%   +0.54%     
==========================================
  Files           4        4              
  Lines         758      759       +1     
==========================================
+ Hits          633      638       +5     
+ Misses        125      121       -4
Impacted Files Coverage Δ
src/tpm2-totp.c 84.36% <100%> (+1.97%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b15fac3...1ca5acd. Read the comment docs.