-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DER NULL validation fail after 1.69 #986
Comments
This affects me too. A unit test we have that
and compares the bytes passes at 1.68 and fails at 1.69 |
Here is a recreate of that unit test. Passes with 1.68 and fails with 1.69 |
Hei! I have the same issue. We use BC both on the mobile client and backend side for a system that creates digital signatures.
As we have a lot of mobile clients out in the field and our client libraries are in a code-freeze then for us it seems that we will not be able to update past 1.68 for some while now. |
Hei! I was wondering - did you break the backwards compatibility here on purpose? Eg code that uses this library version to generate messages will not be able to communicate with the same code using an older library. Would it be possible it make this change in a way that would not break backwards compatibility? |
So the value for the parameters field in the AlgorithmIdentifier depends on the DigestAlgorithmIdentifierFinder in use in the CMSSignedDataGenerator/CMSSignedDataStreamGenerator in use. This is dependent on what the digestAlgIdFinder field is set to. It's actually possible to override this already in an extension class - I've pushed a new beta with some additional constructors to make this clearer. Try what's now in https://www.bouncycastle.org/betas and pass an appropriate algorithm finder (I'd suggest just copying the 1.68 for now) and you should find it reproduces the old behavior. |
Hei @dghgit ! Thanks for your fast answer! I think the solution you proposed will work fine for any of our new development. Thanks! I was wondering if there would be some solution also for our library version that is in a code freeze. We can't change this version as it has been certified by TÜViT as a QSCD. |
@harri35 from what you've said it sounds like your libeary is in code freeze, but not the dependencies, is that right? The bcpkix API does not need to be signed to work, only the bcprov jar needs to be (although we do sign it for other reasons). For now you could probably get away with patching the bcpkix API with the old DefaultDigestAlgorithmIdentifier finder if you need to do an update. |
Hei @dghgit ! Thanks for the suggestion, this would be one way to go for sure.
Well, yes, this is a little bit of a grey area for us. We actually do both for different components:
|
@dghgit But if I may ask the reasoning behind the ID change - would it be safer to make the DigestAlgorithmIdentifierFinder to default to older values? So the backwards compatibility would remain by default? And make using the newer ones an explicit choice? At least for some transitional period? Or is there a reason for this immediate change to the new IDs? |
The reason behind the ID change is that most of the standards have now moved on - and for some time, in a sense we've already had a transitional period. Sadly, it doesn't matter what we do, I'll still wind up explaining it to someone on github. On the up side we're now following the latest usage, which should mean this issue will progressively vanish. |
@dghgit Understood, thanks! |
The latest release (1.69) of the library contains the following changes:
After upgrading the library to this version, there is a third party system unable to validate the signature. We think this is due to the change mentioned above. After reading the rfc5754 we believe some implementations could still require this field to be present.
We could benefit from this behaviour being parameterised somehow. What is your opinion on this? Would it be worth it to investigate how feasible is to update library to be compatible with both behaviors?
The text was updated successfully, but these errors were encountered: