Skip to content

Commit

Permalink
Go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
J3imip committed Dec 24, 2024
1 parent a24d5da commit 26e52e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
26 changes: 13 additions & 13 deletions internal/service/api/handlers/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,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{
Expand Down Expand Up @@ -388,9 +388,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)

Expand Down Expand Up @@ -428,10 +428,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)
Expand Down
4 changes: 2 additions & 2 deletions internal/utils/asn1_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func TruncateHexPrefix(hexString *string) *string {
}

func BuildSignedData(
contract, verifier *common.Address,
passportHash, dg1Commitment, publicKey [32]byte,
contract, verifier *common.Address,
passportHash, dg1Commitment, publicKey [32]byte,
) ([]byte, error) {
return abiEncodePacked(types.RegistrationSimplePrefix, contract, passportHash[:], dg1Commitment[:], publicKey[:], verifier)
}
Expand Down
1 change: 0 additions & 1 deletion internal/utils/asn1_operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func TestTruncateDg1Hash(t *testing.T) {
return result
}(),
},

}

for _, tt := range tests {
Expand Down

0 comments on commit 26e52e3

Please sign in to comment.