Skip to content

Add some additional CMS methods #1034

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 9 commits into from
Closed

Add some additional CMS methods #1034

wants to merge 9 commits into from

Conversation

ur0
Copy link
Contributor

@ur0 ur0 commented Jan 6, 2019

This adds the following methods:

  • Asn1Object::from_txt
  • CmsContentInfo::add_signer
  • CmsContentInfo::verify
  • CmsContentInfo::partial

Documentation is still pending and should be addressed in the next commit, but I'd be grateful for a code review.

Copy link
Owner

@sfackler sfackler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some tests using the new functionality.

use x509::{X509Ref, X509};
use {cvt, cvt_n, cvt_p};

pub struct CmsSignerInfoRef(Opaque);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use the macro to create these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I'm unable to figure out the correct macro for this.

}

impl CmsSignerInfo {
pub fn add_attr(&mut self, obj: &Asn1Object, data_type: i32, data: &[u8]) -> i32 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably return a result.

Is data_type an arbitrary integer or actually an enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find any documentation for it, but it seems to be an opaque integer.

@ur0
Copy link
Contributor Author

ur0 commented Feb 10, 2019

@sfackler: Tried to resolve most issues, working on tests now.

@sfackler
Copy link
Owner

sfackler commented Mar 8, 2019

Have you had a chance to add those tests?

@sfackler sfackler mentioned this pull request Mar 12, 2019
@scouten
Copy link

scouten commented Dec 3, 2020

I need to use the APIs cited in https://stackoverflow.com/questions/55654448/using-openssl-api-how-can-i-access-a-signers-certificate-info-from-a-signed-fil, which include some of the APIs in this PR and a few more.

@sfackler would you be open to an alternative PR that uses this work and bridges the additional APIs?

@TommyLike
Copy link

What's the status of this PR?

@ur0 ur0 closed this Jun 4, 2025
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.

4 participants