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

Copy constructor of org.bouncycastle.cms.SignerInfoGenerator #1941

Open
hayarobi opened this issue Dec 13, 2024 · 1 comment
Open

Copy constructor of org.bouncycastle.cms.SignerInfoGenerator #1941

hayarobi opened this issue Dec 13, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hayarobi
Copy link

The class org.bouncycastle.cms.SignerInfoGenerator has a constructor which combine origin generator and additional attribute table generator.
public SignerInfoGenerator(SignerInfoGenerator original, CMSAttributeTableGenerator sAttrGen, CMSAttributeTableGenerator unsAttrGen)
This constructor combines the fields of the original object with the parameters attrGen and unsAttrGen, but it does not retain the certHolder from the original object. I'm unsure whether this is a bug or intended behavior.

Please check the line about 70 in file SignerInfoGenerator.java
https://github.com/bcgit/bc-java/blob/94fadb56f60b55cebf1028ef444362a9e8820bde/pkix/src/main/java/org/bouncycastle/cms/SignerInfoGenerator.java#L70C1-L84C1

    public SignerInfoGenerator(
        SignerInfoGenerator original,
        CMSAttributeTableGenerator sAttrGen,
        CMSAttributeTableGenerator unsAttrGen)
    {
        this.signerIdentifier = original.signerIdentifier;
        this.signer = original.signer;
        this.digestAlgorithm = original.digestAlgorithm;
        this.digester = original.digester;
        this.sigEncAlgFinder = original.sigEncAlgFinder;
        this.sAttrGen = sAttrGen;
        this.unsAttrGen = unsAttrGen;
    }
@dghgit dghgit self-assigned this Dec 15, 2024
@dghgit
Copy link
Contributor

dghgit commented Dec 16, 2024

I think I'd classify that as a bug. Thanks for the report, I've pushed a fix for it which should appear shortly.

@winfriedgerlach winfriedgerlach added the bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants