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

Bad check in C_GetTokenInfo #3

Open
mcatanzaro opened this issue May 4, 2021 · 0 comments
Open

Bad check in C_GetTokenInfo #3

mcatanzaro opened this issue May 4, 2021 · 0 comments

Comments

@mcatanzaro
Copy link

Coverity noticed this line in C_GetTokenInfo:

pInfo->ulRwSessionCount = ((CK_TRUE == pkcs11_mock_session_opened) && ((CKS_RO_PUBLIC_SESSION != pkcs11_mock_session_state) || (CKS_RO_USER_FUNCTIONS != pkcs11_mock_session_state))) ? 1 : 0;

That is equivalent to:

pInfo->ulRwSessionCount = (CK_TRUE == pkcs11_mock_session_opened) ? 1 : 0;

Since pkcs11_mock_session_state cannot be equal to both CKS_RO_PUBLIC_SESSION and CKS_RO_USER_FUNCTIONS at the same time.

gnomesysadmins pushed a commit to GNOME/glib-networking that referenced this issue May 4, 2021
Coverity noticed we have some unreachable code in mock-pkcs11.c.

At first I thought that was OK, because we have large portions of this
file intentionally unimplemented, but these are just bugs to be removed.

Reported upstream as:

Pkcs11Interop/pkcs11-mock#2
Pkcs11Interop/pkcs11-mock#3
gnomesysadmins pushed a commit to GNOME/glib-networking that referenced this issue May 4, 2021
Coverity noticed we have some unreachable code in mock-pkcs11.c.

At first I thought that was OK, because we have large portions of this
file intentionally unimplemented, but these are just bugs to be removed.

Reported upstream as:

Pkcs11Interop/pkcs11-mock#2
Pkcs11Interop/pkcs11-mock#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant