-
Notifications
You must be signed in to change notification settings - Fork 784
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
PKCS#7 signed data and custom authenticatedAttributes / OIDs #400
Comments
BTW: I"m fully willing to implement and submit a PR if I can be given a little direction in what needs to be done :) |
@NuSkooler -- saw this issue come in, just swamped at the moment and can't look into it. If there's no way to add custom attributes, we want to make sure there is ... I can't remember off the top of my head if it's possible but just difficult at the moment. |
@dlongley Thanks for the reply! FWIW, I added a (probably considered hack) way to go about this in
Usage:
This seems to work when I look at |
Update: I can validate that the fix mentioned above functions properly! |
If the above is something you are interested in, I can submit a PR. The only change is actually the else if for the rawValue check above:
|
@NuSkooler -- I have to look into it, I thought we had something similar somewhere else and I'd like to keep the naming consistent. |
Hey @dlongley can I submit a PR for this? I really think it would add a lot of raw value to the node-forge ecosystem if we could add custom attributes :-D Also, I'm running into the same issue as @NuSkooler |
@dlongley is |
Hi @dlongley , any news on this issue ? I need to have custom authenticatedAttributes but they are currently set as empty ... I can create a PR, let me know Thanks ! |
Unfortunately, the suggested solutions won't work, as they will likely lead to generating invalid signature. The problem is that when attributes are put into |
Confirmed that @ovk is leading us on to the right track here. In case anyone else is bothered by this issue |
Is there still no proper workaround to this issue that's been open since 2016? I'm currently copying the entire PKCS7 file just so I can inject a single line into attrbutesToAsn1 to support adding SCEP OIDs to authenticatedAttributes. Can we either get support for custom variables or atleast some kind of overridable prototype so we can specify custom behaviour? |
I needed import node_forge from 'node-forge';
const { asn1, pki, md } = node_forge;
pki.oids['2.5.4.5'] = 'serialNumber';
pki.oids['serialNumber'] = '2.5.4.5';
pki.oids['2.5.4.72'] = 'role';
pki.oids['role'] = '2.5.4.72';
...
cert.setSubject([{name: 'role', value: 'myrole'}, {name: 'serialNumber', value: 'A1234'}]);
... Maybe this works for authenticatedAttributes too? |
Is there a way to add custom (e.g. not known to node-forge) authenticated attributes to a PKCS#7 signed package?
I'm attempting the following, but see "empty" results when I
openssl asn1parse ...
the output:The OIDs in question are related to SCEP (See e.g. http://www.cisco.com/c/en/us/support/docs/security-vpn/public-key-infrastructure-pki/116167-technote-scep-00.html)
Example fragment dump from
openssl asn1parse ...
:The text was updated successfully, but these errors were encountered: