diff --git a/internal/service/api/handlers/register.go b/internal/service/api/handlers/register.go index 3b0ea5e..5d083b2 100644 --- a/internal/service/api/handlers/register.go +++ b/internal/service/api/handlers/register.go @@ -246,12 +246,12 @@ func Register(w http.ResponseWriter, r *http.Request) { } func verifySod( - signedAttributes []byte, - encapsulatedContent []byte, - signature []byte, - cert *x509.Certificate, - algorithmPair types.AlgorithmPair, - cfg *config.VerifierConfig, + signedAttributes []byte, + encapsulatedContent []byte, + signature []byte, + cert *x509.Certificate, + algorithmPair types.AlgorithmPair, + cfg *config.VerifierConfig, ) error { if err := validateSignedAttributes(signedAttributes, encapsulatedContent, algorithmPair.HashAlgorithm); err != nil { return &types.SodError{ @@ -300,9 +300,9 @@ func parseCertificate(pemFile []byte) (*x509.Certificate, error) { } func validateSignedAttributes( - signedAttributes, - encapsulatedContent []byte, - hashAlgorithm types.HashAlgorithm, + signedAttributes, + encapsulatedContent []byte, + hashAlgorithm types.HashAlgorithm, ) error { signedAttributesASN1 := make([]asn1.RawValue, 0) @@ -340,10 +340,10 @@ func validateSignedAttributes( } func verifySignature( - signature []byte, - cert *x509.Certificate, - signedAttributes []byte, - algorithmPair types.AlgorithmPair, + signature []byte, + cert *x509.Certificate, + signedAttributes []byte, + algorithmPair types.AlgorithmPair, ) error { h := types.GeneralHash(algorithmPair.HashAlgorithm) h.Write(signedAttributes) diff --git a/internal/service/api/requests/register.go b/internal/service/api/requests/register.go index 9d1ba51..4b39b3b 100644 --- a/internal/service/api/requests/register.go +++ b/internal/service/api/requests/register.go @@ -63,6 +63,10 @@ func validateRegister(r resources.RegisterResponse) error { validation.Required, validation.Length(1, 4096), ), + "/data/attributes/document_sod/aa_signature": validation.Validate( + r.Data.Attributes.DocumentSod.AaSignature, + validation.Length(0, 4096), + ), "/data/attributes/document_sod/pem_file": validation.Validate( r.Data.Attributes.DocumentSod.PemFile, validation.Required,