Update dependencies and minimum key size

Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
Jan Tytgat
2025-02-13 16:04:07 +01:00
parent aa785c77a0
commit 44e622fc27
4 changed files with 14 additions and 9 deletions

View File

@ -19,8 +19,8 @@ import (
// CreateHexKey generates a random key which can be used for encryption.
// It generates a RSA Private Key with the supplied bitSize, and converts it to a hex-encoded PEM Block.
func CreateHexKey(bitSize int) (string, error) {
if bitSize < 12 {
return "", errors.New("bit size must be at least 12")
if bitSize < 1024 {
return "", errors.New("bit size must be at least 1024")
}
var err error
var privKey *rsa.PrivateKey

View File

@ -25,14 +25,14 @@ func Test_CreateHexKey(t *testing.T) {
wantErr: true,
},
{
name: "valid_size_12",
name: "invalid_size_12",
bitSize: 12,
wantErr: false,
wantErr: true,
},
{
name: "valid_size_256",
name: "invalid_size_256",
bitSize: 256,
wantErr: false,
wantErr: true,
},
{
name: "valid_size_1024",