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: cms package #181

Closed
wants to merge 32 commits into from
Closed

Conversation

JeyJeyGao
Copy link
Contributor

@JeyJeyGao JeyJeyGao commented Dec 26, 2023

Migrated to: notaryproject/tspclient-go#17

added CMS package

Depends on #176

Signed-off-by: Junjie Gao [email protected]

@JeyJeyGao JeyJeyGao changed the title feat: CMS feat: cms package Dec 26, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2023

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (d9131c7) 89.32% compared to head (4c97c11) 90.66%.

Files Patch % Lines
internal/crypto/cms/signed.go 94.37% 6 Missing and 3 partials ⚠️
internal/crypto/cms/encoding/ber/ber.go 96.38% 4 Missing and 2 partials ⚠️
internal/crypto/hashutil/hash.go 57.14% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   89.32%   90.66%   +1.34%     
==========================================
  Files          21       31      +10     
  Lines        1724     2165     +441     
==========================================
+ Hits         1540     1963     +423     
- Misses        149      161      +12     
- Partials       35       41       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

commit 9240650
Merge: 0c1ec3b 4198690
Author: Junjie Gao <[email protected]>
Date:   Wed Aug 9 17:07:34 2023 +0800

    Merge pull request #1 from JeyJeyGao/feat/ans1

    feat: convert BER to DER

commit 4198690
Author: Junjie Gao <[email protected]>
Date:   Wed Aug 9 09:14:29 2023 +0800

    fix: simplify code

    Signed-off-by: Junjie Gao <[email protected]>

commit 75ce02d
Author: Junjie Gao <[email protected]>
Date:   Mon Aug 7 20:33:08 2023 +0800

    fix: added Conetent method for value interface

    Signed-off-by: Junjie Gao <[email protected]>

commit 7b823a9
Author: Junjie Gao <[email protected]>
Date:   Mon Aug 7 08:54:37 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit 41ecec6
Author: Junjie Gao <[email protected]>
Date:   Sun Aug 6 17:33:19 2023 +0800

    fix: remove recusive call for encode()

    Signed-off-by: Junjie Gao <[email protected]>

commit 8f1a2af
Author: Junjie Gao <[email protected]>
Date:   Fri Aug 4 13:40:09 2023 +0800

    fix: remove unused value

    Signed-off-by: Junjie Gao <[email protected]>

commit 9b6a0c5
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 20:25:22 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit 91a3691
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 20:11:28 2023 +0800

    fix: create pointer instead of value to improve performance

    Signed-off-by: Junjie Gao <[email protected]>

commit 1465e3e
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 20:04:44 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit 6524a9c
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 19:53:27 2023 +0800

    fix: update variable naming

    Signed-off-by: Junjie Gao <[email protected]>

commit 6cfbd9c
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 19:47:39 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit b9c73bd
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 17:56:52 2023 +0800

    fix: update to use rawContent instead of expectedLen

    Signed-off-by: Junjie Gao <[email protected]>

commit 3c99402
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:45:09 2023 +0800

    fix: update comment

    Signed-off-by: Junjie Gao <[email protected]>

commit f4dc95f
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:41:57 2023 +0800

    fix: resolve comment

    Signed-off-by: Junjie Gao <[email protected]>

commit f916316
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:40:37 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit 22afdf8
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:34:34 2023 +0800

    fix: resolve comment

    Signed-off-by: Junjie Gao <[email protected]>

commit edb729c
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:32:47 2023 +0800

    fix: resolve comment

    Signed-off-by: Junjie Gao <[email protected]>

commit a8ba0ff
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:26:29 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit bc18cae
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 16:14:57 2023 +0800

    fix: resolve comments

    Signed-off-by: Junjie Gao <[email protected]>

commit 643f388
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 09:17:39 2023 +0800

    fix: update comment

    Signed-off-by: Junjie Gao <[email protected]>

commit b5d5131
Author: Junjie Gao <[email protected]>
Date:   Thu Aug 3 09:15:23 2023 +0800

    fix: expectedLen == 0 should continue

    Signed-off-by: Junjie Gao <[email protected]>

commit 2345740
Author: Junjie Gao <[email protected]>
Date:   Wed Aug 2 13:01:38 2023 +0800

    fix: added copyright

    Signed-off-by: Junjie Gao <[email protected]>

commit 936ba2b
Author: Junjie Gao <[email protected]>
Date:   Wed Aug 2 11:36:02 2023 +0800

    fix: remove recusive decoding

    Signed-off-by: Junjie Gao <[email protected]>

commit 4fd944a
Author: Junjie Gao <[email protected]>
Date:   Tue Aug 1 21:50:10 2023 +0800

    fix: remove readOnlySlice

    Signed-off-by: Junjie Gao <[email protected]>

commit efa7575
Author: Junjie Gao <[email protected]>
Date:   Tue Aug 1 09:38:57 2023 +0800

    fix: update decodeIdentifier function name

    Signed-off-by: Junjie Gao <[email protected]>

commit cbce4c1
Author: Junjie Gao <[email protected]>
Date:   Tue Aug 1 09:25:34 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit 45480e5
Author: Junjie Gao <[email protected]>
Date:   Mon Jul 31 21:22:20 2023 +0800

    fix: update code

    Signed-off-by: Junjie Gao <[email protected]>

commit b3de155
Author: Junjie Gao <[email protected]>
Date:   Mon Jul 31 20:51:48 2023 +0800

    fix: set non-exportable type

    Signed-off-by: Junjie Gao <[email protected]>

commit 5dea9e5
Author: Junjie Gao <[email protected]>
Date:   Mon Jul 31 20:44:50 2023 +0800

    feat: asn.1 first version

    Signed-off-by: Junjie Gao <[email protected]>

Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao JeyJeyGao mentioned this pull request Jan 2, 2024
4 tasks
Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

My first round of review. PTAL @JeyJeyGao

internal/crypto/cms/cms.go Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/pki/pki.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/oid/hash.go Outdated Show resolved Hide resolved
internal/crypto/oid/oid.go Outdated Show resolved Hide resolved
Signed-off-by: Junjie Gao <[email protected]>
Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

second round of review with a question:
In RFC 5652 section 5.3, it says ...version is the syntax version number. If the SignerIdentifier is the CHOICE issuerAndSerialNumber, then the version MUST be 1..., since we only support issuerAndSerialNumber, where are we enforcing the version number check?

internal/crypto/cms/errors.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/oid/hash.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
Two-Hearts
Two-Hearts previously approved these changes Jan 5, 2024
Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

LGTM

commit 0ff9d3c
Author: Junjie Gao <[email protected]>
Date:   Mon Jan 8 16:18:37 2024 +0800

    test: add unit test

    Signed-off-by: Junjie Gao <[email protected]>

commit 43f94bb
Author: Junjie Gao <[email protected]>
Date:   Tue Jan 2 10:10:22 2024 +0800

    fix: test

    Signed-off-by: Junjie Gao <[email protected]>

commit 1b83aa0
Author: Junjie Gao <[email protected]>
Date:   Tue Jan 2 10:08:55 2024 +0800

    fix: resolve comment

    Signed-off-by: Junjie Gao <[email protected]>

commit 5854500
Author: Junjie Gao <[email protected]>
Date:   Tue Dec 26 16:03:54 2023 +0800

    fix: remove cms

    Signed-off-by: Junjie Gao <[email protected]>

commit 5614972
Author: Junjie Gao <[email protected]>
Date:   Tue Dec 26 09:29:22 2023 +0800

    feat: added cms

    Signed-off-by: Junjie Gao <[email protected]>

commit 548c448
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:56:57 2023 +0800

    fix: remove common errors

    Signed-off-by: Junjie Gao <[email protected]>

commit 9e8a32e
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:55:36 2023 +0800

    fix: update

    Signed-off-by: Junjie Gao <[email protected]>

commit bc72eb6
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:54:16 2023 +0800

    fix: update

    Signed-off-by: Junjie Gao <[email protected]>

commit aee8248
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:51:59 2023 +0800

    fix: resolve comments

    Signed-off-by: Junjie Gao <[email protected]>

commit 49dd7a6
Author: Junjie Gao <[email protected]>
Date:   Wed Dec 20 17:38:31 2023 +0800

    fix: resolve comments

    Signed-off-by: Junjie Gao <[email protected]>

commit 148e0a9
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:53:24 2023 +0800

    fix: update comment

    Signed-off-by: Junjie Gao <[email protected]>

commit 9f6e6b0
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:47:10 2023 +0800

    fix: update test

    Signed-off-by: Junjie Gao <[email protected]>

commit 65bc051
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:45:16 2023 +0800

    fix: optimize test

    Signed-off-by: Junjie Gao <[email protected]>

commit afe0aec
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:03:10 2023 +0800

    fix: add license

    Signed-off-by: Junjie Gao <[email protected]>

commit aebb36d
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 15:41:07 2023 +0800

    test: add unit test

    Signed-off-by: Junjie Gao <[email protected]>

commit 69d5c49
Author: Junjie Gao <[email protected]>
Date:   Wed Nov 29 16:52:49 2023 +0800

    Squashed commit of the following:

    commit 9240650
    Merge: 0c1ec3b 4198690
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 9 17:07:34 2023 +0800

        Merge pull request #1 from JeyJeyGao/feat/ans1

        feat: convert BER to DER

    commit 4198690
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 9 09:14:29 2023 +0800

        fix: simplify code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 75ce02d
    Author: Junjie Gao <[email protected]>
    Date:   Mon Aug 7 20:33:08 2023 +0800

        fix: added Conetent method for value interface

        Signed-off-by: Junjie Gao <[email protected]>

    commit 7b823a9
    Author: Junjie Gao <[email protected]>
    Date:   Mon Aug 7 08:54:37 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 41ecec6
    Author: Junjie Gao <[email protected]>
    Date:   Sun Aug 6 17:33:19 2023 +0800

        fix: remove recusive call for encode()

        Signed-off-by: Junjie Gao <[email protected]>

    commit 8f1a2af
    Author: Junjie Gao <[email protected]>
    Date:   Fri Aug 4 13:40:09 2023 +0800

        fix: remove unused value

        Signed-off-by: Junjie Gao <[email protected]>

    commit 9b6a0c5
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 20:25:22 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 91a3691
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 20:11:28 2023 +0800

        fix: create pointer instead of value to improve performance

        Signed-off-by: Junjie Gao <[email protected]>

    commit 1465e3e
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 20:04:44 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 6524a9c
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 19:53:27 2023 +0800

        fix: update variable naming

        Signed-off-by: Junjie Gao <[email protected]>

    commit 6cfbd9c
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 19:47:39 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit b9c73bd
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 17:56:52 2023 +0800

        fix: update to use rawContent instead of expectedLen

        Signed-off-by: Junjie Gao <[email protected]>

    commit 3c99402
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:45:09 2023 +0800

        fix: update comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit f4dc95f
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:41:57 2023 +0800

        fix: resolve comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit f916316
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:40:37 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 22afdf8
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:34:34 2023 +0800

        fix: resolve comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit edb729c
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:32:47 2023 +0800

        fix: resolve comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit a8ba0ff
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:26:29 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit bc18cae
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:14:57 2023 +0800

        fix: resolve comments

        Signed-off-by: Junjie Gao <[email protected]>

    commit 643f388
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 09:17:39 2023 +0800

        fix: update comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit b5d5131
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 09:15:23 2023 +0800

        fix: expectedLen == 0 should continue

        Signed-off-by: Junjie Gao <[email protected]>

    commit 2345740
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 2 13:01:38 2023 +0800

        fix: added copyright

        Signed-off-by: Junjie Gao <[email protected]>

    commit 936ba2b
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 2 11:36:02 2023 +0800

        fix: remove recusive decoding

        Signed-off-by: Junjie Gao <[email protected]>

    commit 4fd944a
    Author: Junjie Gao <[email protected]>
    Date:   Tue Aug 1 21:50:10 2023 +0800

        fix: remove readOnlySlice

        Signed-off-by: Junjie Gao <[email protected]>

    commit efa7575
    Author: Junjie Gao <[email protected]>
    Date:   Tue Aug 1 09:38:57 2023 +0800

        fix: update decodeIdentifier function name

        Signed-off-by: Junjie Gao <[email protected]>

    commit cbce4c1
    Author: Junjie Gao <[email protected]>
    Date:   Tue Aug 1 09:25:34 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 45480e5
    Author: Junjie Gao <[email protected]>
    Date:   Mon Jul 31 21:22:20 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit b3de155
    Author: Junjie Gao <[email protected]>
    Date:   Mon Jul 31 20:51:48 2023 +0800

        fix: set non-exportable type

        Signed-off-by: Junjie Gao <[email protected]>

    commit 5dea9e5
    Author: Junjie Gao <[email protected]>
    Date:   Mon Jul 31 20:44:50 2023 +0800

        feat: asn.1 first version

        Signed-off-by: Junjie Gao <[email protected]>

    Signed-off-by: Junjie Gao <[email protected]>

Signed-off-by: Junjie Gao <[email protected]>
commit 7698ae3
Author: Junjie Gao <[email protected]>
Date:   Mon Jan 8 16:33:40 2024 +0800

    test: add error case for encodeLength()

    Signed-off-by: Junjie Gao <[email protected]>

commit 0ff9d3c
Author: Junjie Gao <[email protected]>
Date:   Mon Jan 8 16:18:37 2024 +0800

    test: add unit test

    Signed-off-by: Junjie Gao <[email protected]>

commit 43f94bb
Author: Junjie Gao <[email protected]>
Date:   Tue Jan 2 10:10:22 2024 +0800

    fix: test

    Signed-off-by: Junjie Gao <[email protected]>

commit 1b83aa0
Author: Junjie Gao <[email protected]>
Date:   Tue Jan 2 10:08:55 2024 +0800

    fix: resolve comment

    Signed-off-by: Junjie Gao <[email protected]>

commit 5854500
Author: Junjie Gao <[email protected]>
Date:   Tue Dec 26 16:03:54 2023 +0800

    fix: remove cms

    Signed-off-by: Junjie Gao <[email protected]>

commit 5614972
Author: Junjie Gao <[email protected]>
Date:   Tue Dec 26 09:29:22 2023 +0800

    feat: added cms

    Signed-off-by: Junjie Gao <[email protected]>

commit 548c448
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:56:57 2023 +0800

    fix: remove common errors

    Signed-off-by: Junjie Gao <[email protected]>

commit 9e8a32e
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:55:36 2023 +0800

    fix: update

    Signed-off-by: Junjie Gao <[email protected]>

commit bc72eb6
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:54:16 2023 +0800

    fix: update

    Signed-off-by: Junjie Gao <[email protected]>

commit aee8248
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 25 09:51:59 2023 +0800

    fix: resolve comments

    Signed-off-by: Junjie Gao <[email protected]>

commit 49dd7a6
Author: Junjie Gao <[email protected]>
Date:   Wed Dec 20 17:38:31 2023 +0800

    fix: resolve comments

    Signed-off-by: Junjie Gao <[email protected]>

commit 148e0a9
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:53:24 2023 +0800

    fix: update comment

    Signed-off-by: Junjie Gao <[email protected]>

commit 9f6e6b0
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:47:10 2023 +0800

    fix: update test

    Signed-off-by: Junjie Gao <[email protected]>

commit 65bc051
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:45:16 2023 +0800

    fix: optimize test

    Signed-off-by: Junjie Gao <[email protected]>

commit afe0aec
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 16:03:10 2023 +0800

    fix: add license

    Signed-off-by: Junjie Gao <[email protected]>

commit aebb36d
Author: Junjie Gao <[email protected]>
Date:   Thu Dec 7 15:41:07 2023 +0800

    test: add unit test

    Signed-off-by: Junjie Gao <[email protected]>

commit 69d5c49
Author: Junjie Gao <[email protected]>
Date:   Wed Nov 29 16:52:49 2023 +0800

    Squashed commit of the following:

    commit 9240650
    Merge: 0c1ec3b 4198690
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 9 17:07:34 2023 +0800

        Merge pull request #1 from JeyJeyGao/feat/ans1

        feat: convert BER to DER

    commit 4198690
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 9 09:14:29 2023 +0800

        fix: simplify code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 75ce02d
    Author: Junjie Gao <[email protected]>
    Date:   Mon Aug 7 20:33:08 2023 +0800

        fix: added Conetent method for value interface

        Signed-off-by: Junjie Gao <[email protected]>

    commit 7b823a9
    Author: Junjie Gao <[email protected]>
    Date:   Mon Aug 7 08:54:37 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 41ecec6
    Author: Junjie Gao <[email protected]>
    Date:   Sun Aug 6 17:33:19 2023 +0800

        fix: remove recusive call for encode()

        Signed-off-by: Junjie Gao <[email protected]>

    commit 8f1a2af
    Author: Junjie Gao <[email protected]>
    Date:   Fri Aug 4 13:40:09 2023 +0800

        fix: remove unused value

        Signed-off-by: Junjie Gao <[email protected]>

    commit 9b6a0c5
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 20:25:22 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 91a3691
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 20:11:28 2023 +0800

        fix: create pointer instead of value to improve performance

        Signed-off-by: Junjie Gao <[email protected]>

    commit 1465e3e
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 20:04:44 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 6524a9c
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 19:53:27 2023 +0800

        fix: update variable naming

        Signed-off-by: Junjie Gao <[email protected]>

    commit 6cfbd9c
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 19:47:39 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit b9c73bd
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 17:56:52 2023 +0800

        fix: update to use rawContent instead of expectedLen

        Signed-off-by: Junjie Gao <[email protected]>

    commit 3c99402
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:45:09 2023 +0800

        fix: update comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit f4dc95f
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:41:57 2023 +0800

        fix: resolve comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit f916316
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:40:37 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 22afdf8
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:34:34 2023 +0800

        fix: resolve comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit edb729c
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:32:47 2023 +0800

        fix: resolve comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit a8ba0ff
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:26:29 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit bc18cae
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 16:14:57 2023 +0800

        fix: resolve comments

        Signed-off-by: Junjie Gao <[email protected]>

    commit 643f388
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 09:17:39 2023 +0800

        fix: update comment

        Signed-off-by: Junjie Gao <[email protected]>

    commit b5d5131
    Author: Junjie Gao <[email protected]>
    Date:   Thu Aug 3 09:15:23 2023 +0800

        fix: expectedLen == 0 should continue

        Signed-off-by: Junjie Gao <[email protected]>

    commit 2345740
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 2 13:01:38 2023 +0800

        fix: added copyright

        Signed-off-by: Junjie Gao <[email protected]>

    commit 936ba2b
    Author: Junjie Gao <[email protected]>
    Date:   Wed Aug 2 11:36:02 2023 +0800

        fix: remove recusive decoding

        Signed-off-by: Junjie Gao <[email protected]>

    commit 4fd944a
    Author: Junjie Gao <[email protected]>
    Date:   Tue Aug 1 21:50:10 2023 +0800

        fix: remove readOnlySlice

        Signed-off-by: Junjie Gao <[email protected]>

    commit efa7575
    Author: Junjie Gao <[email protected]>
    Date:   Tue Aug 1 09:38:57 2023 +0800

        fix: update decodeIdentifier function name

        Signed-off-by: Junjie Gao <[email protected]>

    commit cbce4c1
    Author: Junjie Gao <[email protected]>
    Date:   Tue Aug 1 09:25:34 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit 45480e5
    Author: Junjie Gao <[email protected]>
    Date:   Mon Jul 31 21:22:20 2023 +0800

        fix: update code

        Signed-off-by: Junjie Gao <[email protected]>

    commit b3de155
    Author: Junjie Gao <[email protected]>
    Date:   Mon Jul 31 20:51:48 2023 +0800

        fix: set non-exportable type

        Signed-off-by: Junjie Gao <[email protected]>

    commit 5dea9e5
    Author: Junjie Gao <[email protected]>
    Date:   Mon Jul 31 20:44:50 2023 +0800

        feat: asn.1 first version

        Signed-off-by: Junjie Gao <[email protected]>

    Signed-off-by: Junjie Gao <[email protected]>

Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao
Copy link
Contributor Author

The unit tests for this PR will be added later, following a few rounds of review.

Unit test has added.

Two-Hearts
Two-Hearts previously approved these changes Jan 10, 2024
Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

And as we discussed, we will have another CMS API func (*parsedSignedData) VerifySigner(signerInfo, certifcate) which verifies a specific signer in a Signed-data against user passed in signing certificate (the certificate MUST match signerInfo's sid). This logic is required by Timestamp RFC 3161. @JeyJeyGao

Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao
Copy link
Contributor Author

And as we discussed, we will have another CMS API func (*parsedSignedData) VerifySigner(signerInfo, certifcate) which verifies a specific signer in a Signed-data against user passed in signing certificate (the certificate MUST match signerInfo's sid). This logic is required by Timestamp RFC 3161. @JeyJeyGao

added func (d *ParsedSignedData) VerifySigner(signerInfo *SignerInfo, signingCertificate *x509.Certificate, opts x509.VerifyOptions) (*x509.Certificate, error) {

Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao JeyJeyGao requested a review from toddysm as a code owner January 15, 2024 03:31
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
internal/crypto/cms/signed.go Outdated Show resolved Hide resolved
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Junjie Gao <[email protected]>
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.

3 participants