diff --git a/data/ipfs.go b/data/ipfs.go index cae978163..db5390ece 100644 --- a/data/ipfs.go +++ b/data/ipfs.go @@ -8,8 +8,8 @@ import ( "time" ipfscid "github.com/ipfs/go-cid" - files "github.com/ipfs/go-ipfs-files" keystore "github.com/ipfs/go-ipfs-keystore" + files "github.com/ipfs/go-libipfs/files" ipfslog "github.com/ipfs/go-log" coreiface "github.com/ipfs/interface-go-ipfs-core" "github.com/ipfs/interface-go-ipfs-core/options" diff --git a/go.mod b/go.mod index 8ba3e1bf2..3fa7edc53 100644 --- a/go.mod +++ b/go.mod @@ -30,8 +30,8 @@ require ( github.com/iden3/go-rapidsnark/verifier v0.0.3 github.com/iden3/go-rapidsnark/witness v0.0.3 github.com/ipfs/go-cid v0.3.2 - github.com/ipfs/go-ipfs-files v0.3.0 github.com/ipfs/go-ipfs-keystore v0.1.0 + github.com/ipfs/go-libipfs v0.6.1-0.20230228004237-36918f45f260 github.com/ipfs/go-log v1.0.5 github.com/ipfs/interface-go-ipfs-core v0.11.0 github.com/ipfs/kubo v0.19.0-rc1 @@ -181,7 +181,6 @@ require ( github.com/ipfs/go-ipld-git v0.1.1 // indirect github.com/ipfs/go-ipld-legacy v0.1.1 // indirect github.com/ipfs/go-ipns v0.3.0 // indirect - github.com/ipfs/go-libipfs v0.6.1-0.20230228004237-36918f45f260 // indirect github.com/ipfs/go-log/v2 v2.5.1 // indirect github.com/ipfs/go-merkledag v0.9.0 // indirect github.com/ipfs/go-metrics-interface v0.0.1 // indirect diff --git a/go.sum b/go.sum index cc1a35f90..2ce824ae7 100644 --- a/go.sum +++ b/go.sum @@ -1095,8 +1095,6 @@ github.com/ipfs/go-ipfs-exchange-offline v0.2.0/go.mod h1:HjwBeW0dvZvfOMwDP0TSKX github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA= github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= -github.com/ipfs/go-ipfs-files v0.3.0 h1:fallckyc5PYjuMEitPNrjRfpwl7YFt69heCOUhsbGxQ= -github.com/ipfs/go-ipfs-files v0.3.0/go.mod h1:xAUtYMwB+iu/dtf6+muHNSFQCJG2dSiStR2P6sn9tIM= github.com/ipfs/go-ipfs-keystore v0.1.0 h1:gfuQUO/cyGZgZIHE6OrJas4OnwuxXCqJG7tI0lrB5Qc= github.com/ipfs/go-ipfs-keystore v0.1.0/go.mod h1:LvLw7Qhnb0RlMOfCzK6OmyWxICip6lQ06CCmdbee75U= github.com/ipfs/go-ipfs-pinner v0.3.0 h1:jwe5ViX3BON3KgOAYrrhav2+1ONB0QzFAWQd7HUlbuM= diff --git a/rpcclient/util.go b/rpcclient/util.go index 6e1bf716a..1378a310e 100644 --- a/rpcclient/util.go +++ b/rpcclient/util.go @@ -1,10 +1,11 @@ package rpcclient import ( + "crypto/rand" "encoding/hex" "encoding/json" "fmt" - "math/rand" + "math/big" "os" "time" @@ -269,7 +270,11 @@ func genVote(encrypted bool, keys []string) ([]byte, error) { return nil, fmt.Errorf("cannot decode encryption key with index %d: (%s)", i, err) } if first { - vp.Nonce = RandomHex(rand.Intn(16) + 16) + randInt, err := rand.Int(rand.Reader, big.NewInt(16)) + if err != nil { + return nil, err + } + vp.Nonce = RandomHex(int(randInt.Int64()) + 16) vpBytes, err = json.Marshal(vp) if err != nil { return nil, err