-
Notifications
You must be signed in to change notification settings - Fork 199
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
xtest: pkcs11: Add check that CK_TOKEN_INFO outputs correct CK_ULONG's #718
xtest: pkcs11: Add check that CK_TOKEN_INFO outputs correct CK_ULONG's #718
Conversation
8d225a5
to
1cc4565
Compare
Just rebased to master. |
1cc4565
to
9093469
Compare
Just rebased to master. |
@jforissier now that the client part is merged -- could you trigger test run again for this PR? |
@vesajaaskelainen sure. Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to mention pkcs11_1001 in the commit header line, as:
xtest: pkcs11_1001: Test CK_UNAVAILABLE_INFORMATION output value
if (!ADBG_EXPECT_COMPARE_UNSIGNED(c, | ||
token_info.ulMaxSessionCount, ==, | ||
CK_UNAVAILABLE_INFORMATION)) | ||
goto out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation make weird alignments.
prefer:
if (!ADBG_EXPECT_COMPARE_UNSIGNED(c,
token_info.ulMaxSessionCount, ==,
CK_UNAVAILABLE_INFORMATION))
goto out;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
host/xtest/pkcs11_1000.c
Outdated
@@ -309,6 +309,36 @@ static void xtest_pkcs11_test_1001(ADBG_Case_t *c) | |||
if (!ADBG_EXPECT_CK_OK(c, rv)) | |||
goto out; | |||
|
|||
/** | |||
* Verify that fields with CK_UNAVAILABLE_INFORMATION gets | |||
* correct value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to highlight here that the pkcs11 always return CK_UNAVAILABLE_INFORMATION for ulMaxSessionCount
, ulMaxRwSessionCount
, ulTotalPublicMemory
and ulFreePublicMemory
so we can test them safely.
As per ulTotalPrivateMemory
and ulFreePrivateMemory
I think we can implement them one day, so I would not enforce there values in this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
9093469
to
2d80c07
Compare
Sorry for a bit of delay on updates for the PR. But now all review comments are addressed and PR has been re-based and re-tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Etienne Carriere <[email protected]>
OP-TEE's PKCS#11 TA TEE<->REE interface treats CK_ULONG's as 32 bit. In 64 bit machines this creates a problem for CK_ULONG values that are architecture dependent. One of those defines is CK_UNAVAILABLE_INFORMATION. This adds test case to make sure that when OP-TEE's PKCS#11 TA should give CK_UNAVAILABLE_INFORMATION it actually does that. Signed-off-by: Vesa Jääskeläinen <[email protected]> Reviewed-by: Etienne Carriere <[email protected]>
2d80c07
to
4b6baca
Compare
Thanks for the review! Applied tag. |
OP-TEE's PKCS#11 TA TEE<->REE interface treats
CK_ULONG
's as 32 bit.In 64 bit machines this creates a problem for
CK_ULONG
values that are architecture dependent.One of those defines is
CK_UNAVAILABLE_INFORMATION
.This adds test case to make sure that when OP-TEE's PKCS#11 TA should give
CK_UNAVAILABLE_INFORMATION
it actually does that.Depends on: