-
Notifications
You must be signed in to change notification settings - Fork 29
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
update: validate Tag1 Datetime CBOR object #98
Conversation
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Codecov Report
@@ Coverage Diff @@
## main #98 +/- ##
==========================================
+ Coverage 78.56% 78.86% +0.30%
==========================================
Files 28 28
Lines 2109 2139 +30
==========================================
+ Hits 1657 1687 +30
Misses 344 344
Partials 108 108
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would rely on review from @shizhMSFT for cose related unmarshalling code.
mistakenly approved PR, there is feedback that needs to be addressed
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
signature/cose/envelope.go
Outdated
return time.Time{}, fmt.Errorf("header %q time value does not have a tag", label) | ||
} | ||
if rawTag.Number != 1 { | ||
return time.Time{}, errors.New("only Tag1 Datetime CBOR object is supported") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return time.Time{}, errors.New("only Tag1 Datetime CBOR object is supported") | |
return time.Time{}, errors.New("only Tag `1` Datetime CBOR object is supported") |
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR's purpose is to fix #97. Based on our spec, we will only support Tag1 Datetime in notary v2 COSE.
This PR adds validation of signing time and expiry (if exists) to make sure they are Tag1 Datetime CBOR objects. Objects other than Tag1 including Tag0 Datetime CBOR would trigger an error.
Signed-off-by: Patrick Zheng patrickzheng@microsoft.com