Skip to content

Commit

Permalink
Use io.ReadFull to ensure that generated jwk match the expected keysi…
Browse files Browse the repository at this point in the history
…ze (#1064)

Signed-off-by: Vihang Mehta <vihang@gimletlabs.ai>
  • Loading branch information
vihangm committed Jan 25, 2024
1 parent 8994b4b commit d86010a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/jwx/jwk.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func makeJwkGenerateCmd() *cli.Command {
rawkey = v
case jwa.OctetSeq:
octets := make([]byte, c.Int("keysize"))
rand.Reader.Read(octets)
io.ReadFull(rand.Reader, octets)

rawkey = octets
case jwa.OKP:
Expand Down

0 comments on commit d86010a

Please sign in to comment.