Skip to content

Commit e303a2b

Browse files
committed
replace math/rand with crypto/rand
1 parent 8bc31d4 commit e303a2b

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

libvirt/utils_net.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package libvirt
22

33
import (
44
"fmt"
5-
"math/rand"
5+
"crypto/rand"
66
"net"
77
)
88

@@ -12,7 +12,6 @@ import (
1212
//nolint:mnd
1313
func randomMACAddress() (string, error) {
1414
buf := make([]byte, 3)
15-
//nolint:gosec // math.rand is enough for this
1615
if _, err := rand.Read(buf); err != nil {
1716
return "", err
1817
}

main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
package main
22

33
import (
4-
"math/rand"
5-
"time"
6-
74
"github.com/dmacvicar/terraform-provider-libvirt/libvirt"
85
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
96
)
107

11-
func init() {
12-
rand.Seed(time.Now().UTC().UnixNano())
13-
}
14-
158
func main() {
169
defer libvirt.CleanupLibvirtConnections()
1710

0 commit comments

Comments
 (0)