Skip to content

Commit

Permalink
fix: The notation spec link in annotation is unavailable (#156)
Browse files Browse the repository at this point in the history
This is a fix to
#155.
That only update the specs address in annotation in order to make the
links available.

---------

Signed-off-by: fandu <[email protected]>
Signed-off-by: fanndu <[email protected]>
  • Loading branch information
fanndu authored Jul 21, 2023
1 parent 45cdd4e commit 0c1ec3b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion signature/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Algorithm int

// Signature algorithms supported by this library.
//
// Reference: https://github.com/notaryproject/notaryproject/blob/main/signature-specification.md#algorithm-selection
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/signature-specification.md#algorithm-selection
const (
AlgorithmPS256 Algorithm = 1 + iota // RSASSA-PSS with SHA-256
AlgorithmPS384 // RSASSA-PSS with SHA-384
Expand Down
4 changes: 2 additions & 2 deletions signature/internal/base/envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Envelope struct {

// Sign generates signature in terms of given SignRequest.
//
// Reference: https://github.com/notaryproject/notaryproject/blob/main/signing-and-verification-workflow.md#signing-steps
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/signing-and-verification-workflow.md#signing-steps
func (e *Envelope) Sign(req *signature.SignRequest) ([]byte, error) {
// Canonicalize request.
req.SigningTime = req.SigningTime.Truncate(time.Second)
Expand Down Expand Up @@ -71,7 +71,7 @@ func (e *Envelope) Sign(req *signature.SignRequest) ([]byte, error) {
// It returns envelope content containing the payload to be signed and
// SignerInfo object containing the information about the signature.
//
// Reference: https://github.com/notaryproject/notaryproject/blob/main/trust-store-trust-policy-specification.md#steps
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/trust-store-trust-policy.md#steps
func (e *Envelope) Verify() (*signature.EnvelopeContent, error) {
// validation before the core verify process.
if len(e.Raw) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion signature/jws/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
)

// headerKeys includes all system aware keys for JWS protected header
// [JWS envelope]: https://github.com/notaryproject/notaryproject/blob/main/signature-envelope-jws.md#protected-headers
// [JWS envelope]: https://github.com/notaryproject/notaryproject/blob/main/specs/signature-envelope-jws.md#protected-headers
var headerKeys = []string{
headerKeyAlg,
headerKeyCty,
Expand Down
2 changes: 1 addition & 1 deletion signature/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (s *localSigner) PrivateKey() crypto.PrivateKey {
// with one of the trusted certificates and returns a certificate that matches
// with one of the certificates in the SignerInfo.
//
// Reference: https://github.com/notaryproject/notaryproject/blob/main/trust-store-trust-policy-specification.md#steps
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/trust-store-trust-policy.md#steps
func VerifyAuthenticity(signerInfo *SignerInfo, trustedCerts []*x509.Certificate) (*x509.Certificate, error) {
if len(trustedCerts) == 0 {
return nil, &InvalidArgumentError{Param: "trustedCerts"}
Expand Down
6 changes: 3 additions & 3 deletions signature/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type SignatureMediaType string

// SigningScheme formalizes the feature set (guarantees) provided by
// the signature.
// Reference: https://github.com/notaryproject/notaryproject/blob/main/signing-scheme.md
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/signing-scheme.md
type SigningScheme string

// SigningSchemes supported by notation.
Expand All @@ -37,7 +37,7 @@ const (
)

// SignedAttributes represents signed metadata in the signature envelope.
// Reference: https://github.com/notaryproject/notaryproject/blob/main/signature-specification.md#signed-attributes
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/signature-specification.md#signed-attributes
type SignedAttributes struct {
// SigningScheme defines the Notary Project Signing Scheme used by the signature.
SigningScheme SigningScheme
Expand All @@ -53,7 +53,7 @@ type SignedAttributes struct {
}

// UnsignedAttributes represents unsigned metadata in the Signature envelope.
// Reference: https://github.com/notaryproject/notaryproject/blob/main/signature-specification.md#unsigned-attributes
// Reference: https://github.com/notaryproject/notaryproject/blob/main/specs/signature-specification.md#unsigned-attributes
type UnsignedAttributes struct {
// TimestampSignature is a counter signature providing authentic timestamp.
TimestampSignature []byte
Expand Down
4 changes: 2 additions & 2 deletions x509/cert_validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ var kuLeafCertBlockedString = "ContentCommitment, KeyEncipherment, DataEncipherm
// ValidateCodeSigningCertChain takes an ordered code-signing certificate chain
// and validates issuance from leaf to root
// Validates certificates according to this spec:
// https://github.com/notaryproject/notaryproject/blob/main/signature-specification.md#certificate-requirements
// https://github.com/notaryproject/notaryproject/blob/main/specs/signature-specification.md#certificate-requirements
func ValidateCodeSigningCertChain(certChain []*x509.Certificate, signingTime *time.Time) error {
return validateCertChain(certChain, 0, signingTime)
}

// ValidateTimeStampingCertChain takes an ordered time-stamping certificate
// chain and validates issuance from leaf to root
// Validates certificates according to this spec:
// https://github.com/notaryproject/notaryproject/blob/main/signature-specification.md#certificate-requirements
// https://github.com/notaryproject/notaryproject/blob/main/specs/signature-specification.md#certificate-requirements
func ValidateTimeStampingCertChain(certChain []*x509.Certificate, signingTime *time.Time) error {
return validateCertChain(certChain, x509.ExtKeyUsageTimeStamping, signingTime)
}
Expand Down

0 comments on commit 0c1ec3b

Please sign in to comment.