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

Outlook not able to decrypt email - part 2 #3076

Closed
RufusJWB opened this issue Mar 18, 2024 · 6 comments · Fixed by #3077
Closed

Outlook not able to decrypt email - part 2 #3076

RufusJWB opened this issue Mar 18, 2024 · 6 comments · Fixed by #3077

Comments

@RufusJWB
Copy link

Problem Description

When trying to decrypt an email in MS Outlook with OpenSC 0.25 I receive the following error message:

image

This seems to be related to #2925

Proposed Resolution

Email should be decrypted

Steps to reproduce

Decrypting an email

Logs

https://gist.github.com/RufusJWB/c2ec57352395e7c7508dd6375622fb60

@Jakuje
Copy link
Member

Jakuje commented Mar 18, 2024

The log now says we are getting 245 B of data from the PKCS#1.5 padded block instead of 16 we should have from my fast check of the data block.

P:8528; T:13012 2024-03-18 16:06:18.797 [cardmod] decrypted data(245):

We changed in 0.25.0 the depadding function to be constant time, but it looks like it does not handle this case well. @xhanulik can you have a look if this is an issue of the depadding or of the way how the depadding is used in the minidriver?

It might be that the function is now more strict and we might need to inject the missing null byte to the beginning in the cardos driver.

@xhanulik
Copy link
Contributor

The depadding function correctly returns the length of depadded message, but the minidriver uses the function argument to get the length, which is not set correctly. I will create PR with fix.

@RufusJWB
Copy link
Author

I will create PR with fix.

As soon as you have binaries, I'd love to test them.

@RufusJWB
Copy link
Author

We changed in 0.25.0 the depadding function to be constant time, but it looks like it does not handle this case well.

I re-tested with 0.24 and I can confirm, there it is still working.

@Jakuje
Copy link
Member

Jakuje commented Mar 19, 2024

@RufusJWB can you check the #3077?

@jozsefd
Copy link
Contributor

jozsefd commented Mar 22, 2024

See my report #3085 about CardRSADecrypt.

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 a pull request may close this issue.

4 participants