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

Modify Attribute, RelativeDistinguishedName and add AttributeTypeAndValue to match RFCs #84

Merged
merged 2 commits into from
Mar 17, 2022
Merged

Conversation

curtisleefulton
Copy link

Pull request modifies Attribute, RelativeDistinguishedName and adds AttributeTypeAndValue to match RFCs, as detailed below.

1. Update Attribute

Change value to values; use SetOf<AttributeValue> instead of AttributeValue.

Defined in module PKIX1Explicit88 (https://www.itu.int/wftp3/Public/t/fl/ietf/rfc/rfc3280/PKIX1Explicit88.html)

Attribute               ::= SEQUENCE {
      type             AttributeType,
      values    SET OF AttributeValue }
            -- at least one value is required
            
AttributeType           ::= OBJECT IDENTIFIER     

AttributeValue          ::= ANY -- DEFINED BY AttributeType       

Also defined in RFC 5652 (https://www.ietf.org/rfc/rfc5652)

Attribute ::= SEQUENCE {
        attrType OBJECT IDENTIFIER,
        attrValues SET OF AttributeValue }
        
AttributeValue ::= ANY        

Attribute uses in Rasn:

AttributeCertificateInfo from RFC 5755 (https://www.ietf.org/rfc/rfc5755)

   AttributeCertificateInfo ::= SEQUENCE {
          -- clipped
          attributes              SEQUENCE OF Attribute, 
          -- clipped      
        }

ACClearAttrs (AttributeCertificateClearAttributes) from RFC 5755 (https://www.ietf.org/rfc/rfc5755)

 ACClearAttrs ::= SEQUENCE {
     acIssuer  GeneralName,
     acSerial  INTEGER,
     attrs     SEQUENCE OF Attribute
   }

SubjectDirectoryAttributes from RFC 5280 (https://www.ietf.org/rfc/rfc5280)

SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute

Five sets from RFC 5652 (https://www.ietf.org/rfc/rfc5652):

  • SignedAttributes
  • UnsignedAttributes
  • UnprotectedAttributes
  • AuthAttributes
  • UnauthAttributes
SignedAttributes ::= SET SIZE (1..MAX) OF Attribute

UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute

UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute

AuthAttributes ::= SET SIZE (1..MAX) OF Attribute

UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute

2. Add AttributeTypeAndValue

Defined in module PKIX1Explicit88 (https://www.itu.int/wftp3/Public/t/fl/ietf/rfc/rfc3280/PKIX1Explicit88.html).

AttributeTypeAndValue   ::= SEQUENCE {
        type    AttributeType,
        value   AttributeValue }

3. Update RelativeDistinguishedName

Change collection type from Attribute to AttributeTypeAndValue

RelativeDistinguishedName from RFC 5280 (https://www.ietf.org/rfc/rfc5280):

RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue

AttributeTypeAndValue

AttributeTypeAndValue   ::= SEQUENCE {
        type    AttributeType,
        value   AttributeValue }

Used in:

RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue

Change Attribute to:

Attribute               ::= SEQUENCE {
      type             AttributeType,
      values    SET OF AttributeValue }
            -- at least one value is required
@repnop
Copy link
Contributor

repnop commented Mar 17, 2022

(might want to adjust the PR title!)

@curtisleefulton curtisleefulton changed the title Add: Modify Attribute, RelativeDistinguishedName and add AttributeTypeAndValue to match RFCs Mar 17, 2022
@XAMPPRocky
Copy link
Collaborator

Thank you for your PR! This looks good to me, but there are changes mentioned in the post that im not seeing in the code changes, is that intentional?

@curtisleefulton
Copy link
Author

curtisleefulton commented Mar 17, 2022 via email

@XAMPPRocky
Copy link
Collaborator

XAMPPRocky commented Mar 17, 2022

Alright sounds good to me, thanks for being so through. I'll release a minor version within the next day or so. Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit e46410a into librasn:main Mar 17, 2022
@curtisleefulton
Copy link
Author

Thank you!

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.

None yet

3 participants