Skip to content

Test cases as requested regarding issue #163 #164

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

Closed
wants to merge 2 commits into from

Conversation

probablynachi
Copy link
Contributor

@probablynachi probablynachi commented Sep 12, 2023

I am bundling the code along with the softhsm portable version which isn't required if softhsm already exists in the system. The Test cases are in src/bin folder.
Please let me know if i need to provide any more info to help recreate the issue. Thank you

wiktor-k added a commit to wiktor-k/rust-cryptoki that referenced this pull request Sep 12, 2023
Handling of empty data specified was broken.

As specified in "2.1.7 PKCS parallaxsecond#1 RSA OAEP mechanism parameters" the
`CKZ_DATA_SPECIFIED` source:

> Array of CK_BYTE containing the value of the encoding parameter.
> If the parameter is empty, pSourceData must be NULL and ulSourceDataLen
> must be zero.

Adjusts by returning `std::ptr::null()` when the source data has not
been specified (`PkcsOaepSource::empty()` was used) and adds a tests
case for this.

One more test case that is ignored is added to handle the case when the
data specified is non-empty. Unfortunately this test fails for unknown
reasons (I haven't been able to find if SoftHSM supports it or not).

Fixes: parallaxsecond#163
Fixes: parallaxsecond#164

Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
Co-authored-by: Nachiketh S Ujjainimath <[email protected]>
@gowthamsk-arm gowthamsk-arm self-requested a review September 12, 2023 15:50
ionut-arm pushed a commit that referenced this pull request Sep 25, 2023
Handling of empty data specified was broken.

As specified in "2.1.7 PKCS #1 RSA OAEP mechanism parameters" the
`CKZ_DATA_SPECIFIED` source:

> Array of CK_BYTE containing the value of the encoding parameter.
> If the parameter is empty, pSourceData must be NULL and ulSourceDataLen
> must be zero.

Adjusts by returning `std::ptr::null()` when the source data has not
been specified (`PkcsOaepSource::empty()` was used) and adds a tests
case for this.

One more test case that is ignored is added to handle the case when the
data specified is non-empty. Unfortunately this test fails for unknown
reasons (I haven't been able to find if SoftHSM supports it or not).

Fixes: #163
Fixes: #164

Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
Co-authored-by: Nachiketh S Ujjainimath <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant