Skip to content

Commit

Permalink
ndp: switch math/rand for crypto/rand
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Layher <[email protected]>
  • Loading branch information
mdlayher committed Apr 29, 2023
1 parent b6db4aa commit 1651dbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package ndp

import (
"bytes"
"crypto/rand"
"crypto/subtle"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"io"
"math/rand"
"net"
"net/netip"
"net/url"
Expand Down Expand Up @@ -777,7 +777,9 @@ func NewNonce() *Nonce {
// recognizes as of kernel 5.17.
const n = 6
b := make([]byte, n)
_, _ = rand.Read(b)
if _, err := rand.Read(b); err != nil {
panicf("ndp: failed to generate nonce bytes: %v", err)
}

return &Nonce{b: b}
}
Expand Down

0 comments on commit 1651dbe

Please sign in to comment.