Skip to content

Commit

Permalink
testutil/keystore: use hardcoded password
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed Mar 21, 2022
1 parent dc35136 commit b6da27f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions testutil/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

// Package keystore provides functions to store and load simnet private keys
// to/from EIP 2335 compatible keystore files with empty passwords.
// to/from EIP 2335 compatible keystore files with "simnet" as passwords.
package keystore

import (
Expand All @@ -33,10 +33,12 @@ import (
"github.com/obolnetwork/charon/tbls/tblsconv"
)

const passphrase = "simnet"

// StoreSimnetKeys stores the secrets in dir/keystore-simnet-%d.json files with empty passwords.
func StoreSimnetKeys(secrets []*bls_sig.SecretKey, dir string) error {
for i, secret := range secrets {
store, err := encrypt(secret, "", rand.Reader)
store, err := encrypt(secret, passphrase, rand.Reader)
if err != nil {
return err
}
Expand Down Expand Up @@ -74,7 +76,7 @@ func LoadSimnetKeys(dir string) ([]*bls_sig.SecretKey, error) {
return nil, errors.Wrap(err, "unmarshal keystore")
}

secret, err := decrypt(store, "")
secret, err := decrypt(store, passphrase)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b6da27f

Please sign in to comment.