From 61baa0b20c9a61a1cade80cf4839a4dffc7cc48f Mon Sep 17 00:00:00 2001 From: Jordan Filteau Date: Fri, 13 Oct 2023 16:47:55 -0500 Subject: [PATCH] reverting changes Signed-off-by: Jordan Filteau --- c/zss.c | 16 +++++++++++----- deps/zowe-common-c | 2 +- schemas/zss-config.json | 8 ++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/c/zss.c b/c/zss.c index 00c92d08..bce8aa91 100644 --- a/c/zss.c +++ b/c/zss.c @@ -1160,16 +1160,23 @@ static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, } JsonObject *httpsConfigObject = jsonAsObject(httpsConfig); TlsSettings *settings = (TlsSettings*)SLHAlloc(slh, sizeof(*settings)); - char *ciphers1_3 = jsonObjectGetString(httpsConfigObject, "ciphersTLSv13"); - char *ciphers1_2 = jsonObjectGetString(httpsConfigObject, "ciphersTLSv12"); + settings->maxTls = jsonObjectGetString(httpsConfigObject, "maxTls"); + char *ciphers = jsonObjectGetString(httpsConfigObject, "ciphers"); /* * Takes a string of ciphers. This isn't ideal, but any other methods are * going to be fairly complicated. * * ciphers: 13021303003500380039002F00320033 */ - settings->ciphers1_2 = ciphers1_2 ? ciphers1_2 : DEFAULT_TLS_CIPHERS_V12; - settings->ciphers1_3 = ciphers1_3 ? ciphers1_3 : DEFAULT_TLS_CIPHERS_V13; + ECVT *ecvt = getECVT(); + /* + 2.3 (1020300) no tls 1.3 + */ + if ((ecvt->ecvtpseq > 0x1020300) && (settings->maxTls == NULL || !strcmp(settings->maxTls, "TLSv1.3"))) { + settings->ciphers = ciphers ? ciphers : DEFAULT_TLS_CIPHERS_V13; + } else { + settings->ciphers = ciphers ? ciphers : DEFAULT_TLS_CIPHERS_V12; + } /* * Takes a string of keyshares. This isn't ideal, but any other methods are * going to be fairly complicated. @@ -1178,7 +1185,6 @@ static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, */ char *keyshares = jsonObjectGetString(httpsConfigObject, "keyshares"); settings->keyshares = keyshares ? keyshares : DEFAULT_TLS_KEY_SHARES; - settings->maxTls = jsonObjectGetString(httpsConfigObject, "maxTls"); settings->keyring = jsonObjectGetString(httpsConfigObject, "keyring"); settings->label = jsonObjectGetString(httpsConfigObject, "label"); /* settings->stash = jsonObjectGetString(httpsConfigObject, "stash"); - this is obsolete */ diff --git a/deps/zowe-common-c b/deps/zowe-common-c index e71d1ce5..0d55d472 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit e71d1ce58520b70d627672170a48caa974736e3b +Subproject commit 0d55d47244d37b77bd156fc0376cc0c90e9592a2 diff --git a/schemas/zss-config.json b/schemas/zss-config.json index 7a671f09..aa2091e0 100644 --- a/schemas/zss-config.json +++ b/schemas/zss-config.json @@ -123,13 +123,9 @@ "type": [ "string", "null" ], "description": "The password to the keyring" }, - "ciphers1_2": { + "ciphers": { "type": [ "string", "null" ], - "description": "The list of ciphers for TLSv1.2 in order of priority" - }, - "ciphers1_3": { - "type": [ "string", "null" ], - "description": "The list of ciphers for TLSv1.3 in order of priority" + "description": "The list of ciphers in order of priority" }, "keyshares": { "type": [ "string", "null" ],