Skip to content

Commit 032af05

Browse files
committed
cipher: Restore DisableMTAES capability to resolve FIPS SIGSEGV.
1 parent 783d8b2 commit 032af05

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

readconf.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ typedef enum {
172172
oLocalCommand, oPermitLocalCommand, oRemoteCommand,
173173
oTcpRcvBufPoll, oHPNDisabled,
174174
oNoneEnabled, oNoneMacEnabled, oNoneSwitch,
175+
oDisableMTAES,
175176
oMetrics, oMetricsPath, oMetricsInterval, oFallback, oFallbackPort,
176177
oVisualHostKey,
177178
oKexAlgorithms, oIPQoS, oRequestTTY, oSessionType, oStdinNull,
@@ -310,6 +311,7 @@ static struct {
310311
{ "noneenabled", oNoneEnabled },
311312
{ "nonemacenabled", oNoneMacEnabled },
312313
{ "noneswitch", oNoneSwitch },
314+
{ "disablemtaes", oDisableMTAES },
313315
{ "metrics", oMetrics },
314316
{ "metricspath", oMetricsPath },
315317
{ "metricsinterval", oMetricsInterval },
@@ -1269,6 +1271,10 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host,
12691271
intptr = &options->nonemac_enabled;
12701272
goto parse_flag;
12711273

1274+
case oDisableMTAES:
1275+
intptr = &options->disable_multithreaded;
1276+
goto parse_flag;
1277+
12721278
case oMetrics:
12731279
intptr = &options->metrics;
12741280
goto parse_flag;
@@ -2692,6 +2698,7 @@ initialize_options(Options * options)
26922698
options->none_switch = -1;
26932699
options->none_enabled = -1;
26942700
options->nonemac_enabled = -1;
2701+
options->disable_multithreaded = -1;
26952702
options->metrics = -1;
26962703
options->metrics_path = NULL;
26972704
options->metrics_interval = -1;
@@ -2891,6 +2898,8 @@ fill_default_options(Options * options)
28912898
fprintf(stderr, "None MAC can only be used with the None cipher. None MAC disabled.\n");
28922899
options->nonemac_enabled = 0;
28932900
}
2901+
if (options->disable_multithreaded == -1)
2902+
options->disable_multithreaded = 0;
28942903
if (options->metrics == -1)
28952904
options->metrics = 0;
28962905
if (options->metrics_interval == -1)

readconf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ typedef struct {
125125
int none_switch; /* Use none cipher */
126126
int none_enabled; /* Allow none to be used */
127127
int nonemac_enabled; /* Allow none to be used */
128+
int disable_multithreaded; /* Disable multithreaded aes-ctr */
128129
int metrics; /* enable metrics */
129130
int metrics_interval; /* time in seconds between polls */
130131
char *metrics_path; /* path for the metrics files */

servconf.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ initialize_server_options(ServerOptions *options)
192192
options->hpn_disabled = -1;
193193
options->none_enabled = -1;
194194
options->nonemac_enabled = -1;
195+
options->disable_multithreaded = -1;
195196
options->ip_qos_interactive = -1;
196197
options->ip_qos_bulk = -1;
197198
options->version_addendum = NULL;
@@ -438,6 +439,8 @@ fill_default_server_options(ServerOptions *options)
438439
debug ("Attempted to enabled None MAC without setting None Enabled to true. None MAC disabled.");
439440
options->nonemac_enabled = 0;
440441
}
442+
if (options->disable_multithreaded == -1)
443+
options->disable_multithreaded = 0;
441444
if (options->hpn_disabled == -1)
442445
options->hpn_disabled = 0;
443446
if (options->ip_qos_interactive == -1)
@@ -522,6 +525,7 @@ typedef enum {
522525
sKbdInteractiveAuthentication, sListenAddress, sAddressFamily,
523526
sPrintMotd, sPrintLastLog, sIgnoreRhosts,
524527
sNoneEnabled, sNoneMacEnabled, sTcpRcvBufPoll, sHPNDisabled,
528+
sDisableMTAES,
525529
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost,
526530
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive,
527531
sPermitUserEnvironment, sAllowTcpForwarding, sCompression,
@@ -692,6 +696,7 @@ static struct {
692696
{ "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL },
693697
{ "noneenabled", sNoneEnabled, SSHCFG_ALL },
694698
{ "nonemacenabled", sNoneMacEnabled, SSHCFG_ALL },
699+
{ "disableMTAES", sDisableMTAES, SSHCFG_ALL },
695700
{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
696701
{ "include", sInclude, SSHCFG_ALL },
697702
{ "ipqos", sIPQoS, SSHCFG_ALL },
@@ -1571,6 +1576,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
15711576
intptr = &options->nonemac_enabled;
15721577
goto parse_flag;
15731578

1579+
case sDisableMTAES:
1580+
intptr = &options->disable_multithreaded;
1581+
goto parse_flag;
1582+
15741583
case sHostbasedAuthentication:
15751584
intptr = &options->hostbased_authentication;
15761585
goto parse_flag;

servconf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ typedef struct {
202202
int hpn_disabled; /* disable hpn functionality. false by default */
203203
int none_enabled; /* Enable NONE cipher switch */
204204
int nonemac_enabled; /* Enable NONE MAC switch */
205+
int disable_multithreaded; /* Disable multithreaded aes-ctr cipher */
205206

206207
int permit_tun;
207208

session.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ do_exec_no_pty(struct ssh *ssh, Session *s, const char *command)
547547
s->is_subsystem, 0);
548548
#endif
549549
/* switch to the parallel ciphers if necessary */
550-
cipher_switch(ssh);
550+
if (options.disable_multithreaded == 0)
551+
cipher_switch(ssh);
551552
return 0;
552553
}
553554

@@ -651,7 +652,8 @@ do_exec_pty(struct ssh *ssh, Session *s, const char *command)
651652
options.ip_qos_interactive, options.ip_qos_bulk);
652653
session_set_fds(ssh, s, ptyfd, fdout, -1, 1, 1);
653654
/* switch to the parallel cipher if appropriate */
654-
cipher_switch(ssh);
655+
if (options.disable_multithreaded == 0)
656+
cipher_switch(ssh);
655657
return 0;
656658
}
657659

ssh.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,8 @@ fork_postauth(struct ssh *ssh)
18871887
error_f("stdfd_devnull failed");
18881888
/* we do the cipher switch here in the event that the client
18891889
is forking or has a delayed fork */
1890-
cipher_switch(ssh);
1890+
if (options.disable_multithreaded == 0)
1891+
cipher_switch(ssh);
18911892
}
18921893

18931894
static void
@@ -2365,7 +2366,8 @@ ssh_session2(struct ssh *ssh, const struct ssh_conn_info *cinfo)
23652366
* one of our parallel versions. If the client is
23662367
* forking then we handle it in fork_postauth()
23672368
*/
2368-
cipher_switch(ssh);
2369+
if (options.disable_multithreaded == 0)
2370+
cipher_switch(ssh);
23692371
}
23702372
return client_loop(ssh, tty_flag, tty_flag ?
23712373
options.escape_char : SSH_ESCAPECHAR_NONE, id);

0 commit comments

Comments
 (0)