-
Notifications
You must be signed in to change notification settings - Fork 88
Fix handling empty AllowedMechanisms attribute #324
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
Fix handling empty AllowedMechanisms attribute #324
Conversation
03f686d to
a2ac816
Compare
a2ac816 to
32243e0
Compare
|
OTOH this could be considered a softhsm bug (or at least oddness) and as a rust-cryptoki, we might want to shield a users from such pkcs11-module-specific issues. But then we would have to filter this out early in get_attributes, which does not sound great either. |
|
You already pointed out that at least two attributes can definitely be zero length. It thus seems like a bug in |
Validity rules for reads explicitly point out that:
I'm okay with the change here, with a bit of docs around it, since at first sight it looks like a premature optimization 🤔 |
That's not the only relevant thing. From slice::from_raw_parts:
And that's the bug that we are seeing. |
32243e0 to
84339fb
Compare
neverpanic
left a comment
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.
Typo, rest lg2m.
84339fb to
0204b08
Compare
hug-dev
left a comment
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.
Thanks for the fix and the comment ⭐
|
@wiktor-k can you have a look and approve if this looks ok? |
wiktor-k
left a comment
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 this looks good 👌 a couple of small suggestions, if you don't mind.
Btw, thanks for the ping, quite a lot on the plate recently 😅
0204b08 to
780b7a2
Compare
|
oh, no. Something in the ubuntu broke the installation of the 32b arch softhsm ... |
|
Is it this line failing? Might be ok to ignore for now... |
Hard to say. Would have to try that locally or to get more information from the CI. I am also curious about the kryoptic failure that was not there in #328, in CI which ran last week. |
Looks like it comes from the last line: Removing the |
|
I think it should be ok to remove those two failing 32 bits and open an issue to see how we can fix it until then. What about the failing kryoptic test though, do you have any idea of what could be wrong there? |
Looking at the CI configuration, these are not required to pass before merging. So we can probably keep them aronud
I tried to reproduce it locally, but I was not successful (but I have likely slightly different openssl version). Its the ed25519 key. We consider these approved under FIPS so it should not be an issue. I will try to dig into that later today. |
cd3b0b5 to
0dbac8f
Compare
|
The softhsm issue is solved, but the kryoptic issue looks like failing inside of the openssl with debug logging turned on: Note, that this is already the second iteration in the test. The I guess this is some change inside of OpenSSL: And looks like its this one, which landed in openssl 3.5 branch during last two weeks: That said, we will have to skip this signature scheme with fips kryoptic. Let me do that in separate PR so we can merge it irrespective of this PR. |
0dbac8f to
15d7cd8
Compare
As returned by SoftHSM: softhsm/SoftHSMv2#825 Fixes: parallaxsecond#323 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
15d7cd8 to
ad0810a
Compare
|
Rebased. Should be also ready |
As returned by SoftHSM: softhsm/SoftHSMv2#825
Fixes: #323