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

feat(rust/c509-certificate): Update to version 11 #22

Merged
merged 28 commits into from
Oct 7, 2024
Merged

Conversation

bkioshn
Copy link
Contributor

@bkioshn bkioshn commented Sep 12, 2024

Description

Currently c509-certificate crate follows draft 9, update it to draft 11.
Version 11: https://datatracker.ietf.org/doc/draft-ietf-cose-cbor-encoded-cert/11/
Version 9: https://datatracker.ietf.org/doc/draft-ietf-cose-cbor-encoded-cert/09/

Related Issue(s)

Closes #19
Blocks #49

Description of Changes

Differences between 9 and 11 for the current implementation

  • OID PEN is removed
  • Fix type time, should be unsigned integer
  • Msg field version - the type can be a natively signed C509 certificate following X.509 v3 (c509CertificateType = 2) or a CBOR re-encoded X.509 v3 DER certificate (c509CertificateType = 3)
  • issuer -> if issuer same as subject, issuer is set to null
  • subject shouldn’t be null
  • Relative distinguished name is removed
  • Update documents
  • New TBSCertificate
 TBSCertificate = (
       c509CertificateType: int,
       certificateSerialNumber: CertificateSerialNumber,
        issuerSignatureAlgorithm: AlgorithmIdentifier,
       issuer: Name / null,
       validityNotBefore: ~time,
       validityNotAfter: ~time / null,
       subject: Name,
       subjectPublicKeyAlgorithm: AlgorithmIdentifier,
       subjectPublicKey: any,
       extensions: Extensions,
    )

Breaking Changes

  • New CBOR sequence of TBSCertificate
  • OID PEN is not supported
  • Relative Distinguished Name is removed and use Attributes instead
  • Message field version change

Please confirm the following checks

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream module

@bkioshn bkioshn added the enhancement New feature or request label Sep 12, 2024
@bkioshn bkioshn self-assigned this Sep 12, 2024
@bkioshn bkioshn changed the title feat(rust/c509-certificate): **DO NOT MERGE YET** Update to version 11 feat(rust/c509-certificate): DO NOT MERGE YET - Update to version 11 Sep 12, 2024
@bkioshn bkioshn added the review me PR is ready for review label Sep 12, 2024
stevenj
stevenj previously approved these changes Sep 12, 2024
Copy link
Collaborator

@stevenj stevenj left a comment

Choose a reason for hiding this comment

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

LGTM

stevenj and others added 2 commits September 17, 2024 15:41
#26)

* fix: naming + add neccesary function

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): cleanup

---------

Co-authored-by: Steven Johnson <[email protected]>
bkioshn and others added 11 commits September 19, 2024 20:15
* fix: naming + add neccesary function

* fix(rust/c509-certificate): add encode + decode helper functions

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): remove unnecessary allow(dead_code)

* fix(rust/c509-certificate): generic encode and decode functions
* fix: naming + add neccesary function

* fix(rust/c509-certificate): add encode + decode helper functions

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): cleanup

* fix(rust/c509-certificate): remove unnecessary allow(dead_code)

* fix(rust/c509-certificate): fix encode decode Name

* chore(rust/c509-certificate): fix comment

* fix(rust/c509-certificate): add + rewrite test cases

* chore(rust/c509-certificate): earthly no cache

* chore(rust/c509-certificate): earthly no cache

* chore(rust/c509-certificate): earthly no cache

* chore(rust/c509-certificate): remove earthly no-cache

* fix(rust/c509-certificate): add more test comments

* fix(rust/c509-certificate): clippy lints

---------

Co-authored-by: Steven Johnson <[email protected]>
Co-authored-by: Steven Johnson <[email protected]>
bkioshn and others added 5 commits September 30, 2024 10:46
Signed-off-by: bkioshn <[email protected]>
* fix(rust/c509-certificate): docs

Signed-off-by: bkioshn <[email protected]>

* fix(rust/c509-certificate): spelling

Signed-off-by: bkioshn <[email protected]>

* fix(rust/c509-certificate): anyhow format

Signed-off-by: bkioshn <[email protected]>

* docs(rust/c509-certificate): make doc clearer

Signed-off-by: bkioshn <[email protected]>

---------

Signed-off-by: bkioshn <[email protected]>
@stevenj stevenj mentioned this pull request Oct 6, 2024
8 tasks
Copy link
Contributor

github-actions bot commented Oct 6, 2024

Test Report | ${\color{lightgreen}Pass: 199/199}$ | ${\color{red}Fail: 0/199}$ |

@bkioshn bkioshn changed the title feat(rust/c509-certificate): DO NOT MERGE YET - Update to version 11 feat(rust/c509-certificate): Update to version 11 Oct 6, 2024
Copy link
Collaborator

@stevenj stevenj left a comment

Choose a reason for hiding this comment

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

LGTM

@stevenj stevenj merged commit d323073 into main Oct 7, 2024
20 checks passed
@stevenj stevenj deleted the feat/c509-v11 branch October 7, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🛠️ [TASK] : rust/c509-certificate updates to the latest RFC Draft (11)
2 participants