-
Notifications
You must be signed in to change notification settings - Fork 6
Meyer9/mainnet tx generator #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🟡 Heimdall Review Status
|
runner/payload/simulator/worker.go
Outdated
|
||
src := rand.New(rand.NewSource(100)) | ||
for i := 0; i < maxAccounts; i++ { | ||
key, err := ecdsa.GenerateKey(crypto.S256(), src) |
Check failure
Code scanning / CodeQL
Use of insufficient randomness as the key of a cryptographic algorithm
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 14 days ago
To fix the issue, replace the use of math/rand
with crypto/rand
, which provides a cryptographically secure random number generator. Specifically:
- Replace
rand.New(rand.NewSource(100))
withcrypto/rand.Reader
to ensure the random source is cryptographically secure. - Update the
ecdsa.GenerateKey
function to usecrypto/rand.Reader
as the random source.
This change ensures that the generated private keys are unpredictable and secure for cryptographic purposes.
-
Copy modified line R11 -
Copy modified line R213
@@ -10,3 +10,3 @@ | ||
|
||
"math/rand" | ||
"crypto/rand" | ||
|
||
@@ -211,5 +211,4 @@ | ||
|
||
src := rand.New(rand.NewSource(100)) | ||
for i := 0; i < maxAccounts; i++ { | ||
key, err := ecdsa.GenerateKey(crypto.S256(), src) | ||
key, err := ecdsa.GenerateKey(crypto.S256(), cryptoRand.Reader) | ||
if err != nil { |
3960fd4
to
e5a6e3d
Compare
18a814e
to
a0bf306
Compare
e5a6e3d
to
8c054c6
Compare
a0bf306
to
e6209c1
Compare
8c054c6
to
ae23636
Compare
2bc82f2
to
4c858f6
Compare
ae23636
to
7f709cc
Compare
4c858f6
to
42d5487
Compare
5a56a68
to
39c8cf0
Compare
7f709cc
to
e4b4a2a
Compare
691e9d0
to
5a972df
Compare
5a972df
to
309a10f
Compare
Description
Testing