Skip to content

Commit

Permalink
Merge pull request #629 from liouk/fix-randombits
Browse files Browse the repository at this point in the history
OCPBUGS-17987: generate only >=0 number of random bits
  • Loading branch information
openshift-ci[bot] committed Oct 23, 2023
2 parents 7ae04d4 + 1e7d7b1 commit 89f814e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -146,7 +146,7 @@ func (c *oauthsClientsController) ensureBootstrappedOAuthClients(ctx context.Con
return nil
}

func randomBits(bits int) []byte {
func randomBits(bits uint) []byte {
size := bits / 8
if bits%8 != 0 {
size++
Expand Down
Expand Up @@ -243,7 +243,7 @@ func Test_ensureBootstrappedOAuthClients(t *testing.T) {

func Test_randomBits(t *testing.T) {
tests := []struct {
bits int
bits uint
expectedLen int
}{
{0, 0}, {1, 1}, {8, 1}, {16, 2}, {32, 4}, {64, 8}, {128, 16}, {256, 32}, {512, 64},
Expand Down

0 comments on commit 89f814e

Please sign in to comment.