-
Notifications
You must be signed in to change notification settings - Fork 104
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
C_Login: test for segfault when user pin not setup #573
Closed
williamcroberts
wants to merge
1
commit into
tpm2-software:master
from
williamcroberts:fix-C_Login-segfault
Closed
C_Login: test for segfault when user pin not setup #573
williamcroberts
wants to merge
1
commit into
tpm2-software:master
from
williamcroberts:fix-C_Login-segfault
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
williamcroberts
force-pushed
the
fix-C_Login-segfault
branch
from
July 31, 2020 16:46
c26f5f4
to
bc763bf
Compare
A command like: pkcs11-tool --module /usr/lib/libtpm2_pkcs11.so --init-token --label tpmhsm --so-pin foo --pin bar Will cause a C_Login event becuase --pin is specified. However, C_InitPIN has not been called to initialize the userpin. This causes an NPD when trying to load the user sealobjects public and private blobs. Relates-to: tpm2-software#563 Signed-off-by: William Roberts <william.c.roberts@intel.com>
williamcroberts
force-pushed
the
fix-C_Login-segfault
branch
from
July 31, 2020 16:47
bc763bf
to
43898f2
Compare
Codecov Report
@@ Coverage Diff @@
## master #573 +/- ##
==========================================
+ Coverage 70.30% 70.31% +0.01%
==========================================
Files 33 33
Lines 8573 8573
==========================================
+ Hits 6027 6028 +1
+ Misses 2546 2545 -1
Continue to review full report at Codecov.
|
This test gets skipped, we need to add C code test... |
williamcroberts
pushed a commit
to williamcroberts/tpm2-pkcs11
that referenced
this pull request
Jul 31, 2020
When the db code fails at a certain point, it can delete the token freein'g the in-use mutex. Detect this condition and keep the mutex as it's still in use and held. Fixes: tpm2-software#573 Signed-off-by: William Roberts <william.c.roberts@intel.com>
williamcroberts
pushed a commit
to williamcroberts/tpm2-pkcs11
that referenced
this pull request
Jul 31, 2020
When the db code fails at a certain point, it can delete the token freein'g the in-use mutex. Detect this condition and keep the mutex as it's still in use and held. Fixes: tpm2-software#573 Signed-off-by: William Roberts <william.c.roberts@intel.com>
williamcroberts
pushed a commit
to williamcroberts/tpm2-pkcs11
that referenced
this pull request
Jul 31, 2020
Rather than trying to free the token when we have failure in C_InitToken, just reset the state that matters. This prevents us from free'ing a mutex currently being held by a lock, as well as free'ing and reallocating structures needlessly. Fixes: tpm2-software#573 Signed-off-by: William Roberts <william.c.roberts@intel.com>
williamcroberts
pushed a commit
to williamcroberts/tpm2-pkcs11
that referenced
this pull request
Aug 3, 2020
Rather than trying to free the token when we have failure in C_InitToken, just reset the state that matters. This prevents us from free'ing a mutex currently being held by a lock, as well as free'ing and reallocating structures needlessly. Fixes: tpm2-software#573 Signed-off-by: William Roberts <william.c.roberts@intel.com>
williamcroberts
pushed a commit
that referenced
this pull request
Aug 3, 2020
Rather than trying to free the token when we have failure in C_InitToken, just reset the state that matters. This prevents us from free'ing a mutex currently being held by a lock, as well as free'ing and reallocating structures needlessly. Fixes: #573 Signed-off-by: William Roberts <william.c.roberts@intel.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A command like:
pkcs11-tool --module /usr/lib/libtpm2_pkcs11.so --init-token --label tpmhsm --so-pin foo --pin bar
Will cause a C_Login even because --pin is specified. However, C_InitPIN
has not been called to initialize the userpin. This causes a NPD when
trying to load the user sealobjects public and private blobs.
Related-to: #563
Signed-off-by: William Roberts william.c.roberts@intel.com