Skip to content

Commit

Permalink
Set min value for the --ssh-rsa-bits flag
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Aug 21, 2023
1 parent a9e09b8 commit 045bb4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/flags/rsa_key_bits.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func (b *RSAKeyBits) Set(str string) error {
if err != nil {
return err
}
if bits < 1024 {
return fmt.Errorf("RSA key bit size must be at least 1024")
}
if bits == 0 || bits%8 != 0 {
return fmt.Errorf("RSA key bit size must be a multiples of 8")
}
Expand Down

0 comments on commit 045bb4e

Please sign in to comment.