Skip to content

Commit

Permalink
fix code resigning in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar committed Oct 1, 2023
1 parent c1dbb8e commit b2df497
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions v2/cmd/integration-test/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"errors"
"log"
"os"
"path/filepath"

osutils "github.com/projectdiscovery/utils/os"
Expand Down Expand Up @@ -31,6 +32,23 @@ var (
)

func init() {
// since re-signing of code protocol templates is not supported
// for testing purposes remove them from template
// to test signing of code protocol templates
for _, v := range codeTestCases {
if v.DisableOn != nil && v.DisableOn() {
continue
}
bin, err := os.ReadFile(v.Path)
if err != nil {
panic(err)
}
updated := signer.RemoveSignatureFromData(bin)
if err := os.WriteFile(v.Path, updated, 0644); err != nil {
panic(err)
}
}

var err error
ecdsaPrivateKeyAbsPath, err = filepath.Abs("protocols/code/ecdsa-priv-key.pem")
if err != nil {
Expand Down

0 comments on commit b2df497

Please sign in to comment.