Skip to content

Commit

Permalink
fix: resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Sep 21, 2022
1 parent 0af93b2 commit a0f4714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions signature/jws/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ var (
// signedAttributes for signing request
signedAttributes = signature.SignedAttributes{
SigningScheme: "notary.x509",
SigningTime: signingTime.Truncate(time.Second),
Expiry: expiry.Truncate(time.Second).Add(time.Hour * 24),
SigningTime: signingTime,
Expiry: expiry.Add(time.Hour * 24),
ExtendedAttributes: sortAttributes([]signature.Attribute{
{Key: "signedCritKey1", Value: "signedCritValue1", Critical: true},
{Key: "signedKey1", Value: "signedValue1", Critical: false},
Expand Down
4 changes: 2 additions & 2 deletions signature/jws/envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (e *envelope) Verify() (*signature.EnvelopeContent, error) {
}

if len(e.base.Header.CertChain) == 0 {
return nil, &signature.InvalidSignatureError{Msg: "certificate chain is not set"}
return nil, &signature.InvalidSignatureError{Msg: "certificate chain is not present"}
}

cert, err := x509.ParseCertificate(e.base.Header.CertChain[0])
Expand Down Expand Up @@ -169,7 +169,7 @@ func (e *envelope) signerInfo(protected *jwsProtectedHeader) (*signature.SignerI
return nil, &signature.InvalidSignatureError{Msg: err.Error()}
}
if len(sig) == 0 {
return nil, &signature.InvalidSignatureError{Msg: "cose envelope missing signature"}
return nil, &signature.InvalidSignatureError{Msg: "signature missing in jws-json envelope"}
}
signerInfo.Signature = sig

Expand Down

0 comments on commit a0f4714

Please sign in to comment.