Skip to content

Commit

Permalink
fix: The notation spec link in annotation is unavailable
Browse files Browse the repository at this point in the history
Signed-off-by: fandu <dufann@hotmail.com>
Signed-off-by: fanndu <dufann@hotmail.com>
  • Loading branch information
fanndu committed Jul 21, 2023
1 parent 02fc54a commit 25fd4da
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 @@ -13,7 +13,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 @@ -20,7 +20,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 @@ -58,7 +58,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 @@ -18,7 +18,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 @@ -113,7 +113,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 @@ -11,7 +11,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 @@ -24,7 +24,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 @@ -40,7 +40,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 @@ -24,15 +24,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 25fd4da

Please sign in to comment.