Add RequiredRsaSize configuration option

to both client and server configuration file

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-09-23 18:25:57 +02:00
parent 029754efb3
commit 00f1d6fac2
6 changed files with 42 additions and 3 deletions

View File

@@ -104,6 +104,11 @@ ssh_bind_config_keyword_table[] = {
.opcode = BIND_CFG_HOSTKEY_ALGORITHMS,
.allowed_in_match = true
},
{
.name = "requiredrsasize",
.opcode = BIND_CFG_REQUIRED_RSA_SIZE,
.allowed_in_match = true
},
{
.opcode = BIND_CFG_UNKNOWN,
}
@@ -293,6 +298,7 @@ ssh_bind_config_parse_line(ssh_bind bind,
const char *p = NULL;
char *s = NULL, *x = NULL;
char *keyword = NULL;
long l;
size_t len;
int rc = 0;
@@ -594,6 +600,18 @@ ssh_bind_config_parse_line(ssh_bind bind,
}
}
break;
case BIND_CFG_REQUIRED_RSA_SIZE:
l = ssh_config_get_long(&s, -1);
if (l >= 0 && (*parser_flags & PARSING)) {
rc = ssh_bind_options_set(bind, SSH_BIND_OPTIONS_RSA_MIN_SIZE, &l);
if (rc != 0) {
SSH_LOG(SSH_LOG_TRACE,
"line %d: Failed to set RequiredRSASize value '%ld'",
count,
l);
}
}
break;
case BIND_CFG_NOT_ALLOWED_IN_MATCH:
SSH_LOG(SSH_LOG_DEBUG, "Option not allowed in Match block: %s, line: %d",
keyword, count);