Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the ZSS package will be documented in this file.

## `3.4.0`
- Enhancement: Curve customization support from array 'zowe.network.server.tls.curves' in zowe.yaml, only curves mentioned in https://www.ibm.com/docs/en/zos/3.1.0?topic=programming-cipher-suite-definitions#csdcwh__tttcsd are supported currently (#721).

## `3.3.0`
- Enhancement: Utility "zis-test" is now used to ensure that ZIS is running and accessible by Zowe before starting ZSS. (zowe/zss#764)
- Enhancement: Utility "bind-test" is now available in Zowe and used to validate if each Zowe server can succeed in binding to the user requested TCPIP port at each Zowe startup. (zowe/zss#764)
Expand Down
45 changes: 45 additions & 0 deletions c/zss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@
#define ENV_AGENT_HTTPS_KEY(key) AGENT_HTTPS_PREFIX key

TLS_IANA_CIPHER_MAP(ianaCipherMap)
TLS_IANA_CURVE_MAP(ianaCurveMap)

static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh,
ConfigManager *configmgr,
Expand Down Expand Up @@ -1222,6 +1223,50 @@

}

Json *tlsConfig = NULL;
int tlsGetStatus = cfgGetAnyC(configmgr, ZSS_CFGNAME, &tlsConfig, 4, "zowe", "network", "server", "tls");
if (tlsGetStatus) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "TLS is NOT configured for this ZSS\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a message ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure on that because elsewhere is the code I can see its a similar message without any ID as such.
Thanks

} else {
JsonObject *tlsConfigObject = jsonAsObject(tlsConfig);
Json *curveJson = jsonObjectGetPropertyValue(tlsConfigObject, "curves");
char *curves = NULL;
if (curveJson && jsonIsArray(curveJson)) {
JsonArray *curveArray = jsonObjectGetArray(tlsConfigObject, "curves");
Comment thread
Gautham-coder marked this conversation as resolved.
if (curveArray) {
int count = jsonArrayGetCount(curveArray);
const int curveCharLength = 4;
curves = safeMalloc((sizeof(char) * curveCharLength * count)+1, "curve list");
if (curves == NULL) {

Check failure on line 1240 in c/zss.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this code to not nest more than 3 if|for|do|while|switch statements.

See more on https://sonarcloud.io/project/issues?id=zowe_zss&issues=AZ1ybzFy-yWh82jXe1_q&open=AZ1ybzFy-yWh82jXe1_q&pullRequest=721
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_WARNING, "Failure to allocate memory for Curves\n");
return false;
}
for (int i = 0; i < count; i++) {

Check failure on line 1244 in c/zss.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this code to not nest more than 3 if|for|do|while|switch statements.

See more on https://sonarcloud.io/project/issues?id=zowe_zss&issues=AZ1ybzFy-yWh82jXe1_r&open=AZ1ybzFy-yWh82jXe1_r&pullRequest=721
char *ianaName = jsonArrayGetString(curveArray, i);
if (ianaName) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "curve request=%s\n", ianaName);
CurveMap *curve = (CurveMap *)ianaCurveMap;

Check failure on line 1248 in c/zss.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

cast from 'const struct CurveMap_tag *' to 'struct CurveMap_tag *' drops const qualifier

See more on https://sonarcloud.io/project/issues?id=zowe_zss&issues=AZ1ybzFy-yWh82jXe1_p&open=AZ1ybzFy-yWh82jXe1_p&pullRequest=721
bool found = false;
while (curve->groupId != NULL) {
if (!strcmp(ianaName, curve->name)) {
strcat(curves, curve->groupId);
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Curve match=%s\n", curve->groupId);
found = true;
break;
}
++curve;
}
if (!found) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_WARNING, ZSS_LOG_CURVE_INVALID_MSG, ianaName);
}
}
}
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Curve array is %s\n", curves);
settings->curves = curves;
}
}
}

ECVT *ecvt = getECVT();
/*
2.3 (1020300) no tls 1.3
Expand Down Expand Up @@ -1396,7 +1441,7 @@
return FALSE;
}

/* TODO: No ipv6 resolution in getAddressByName yet, so nothing here either */

Check warning on line 1444 in c/zss.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=zowe_zss&issues=AZ1ybzFy-yWh82jXe1_o&open=AZ1ybzFy-yWh82jXe1_o&pullRequest=721
return TRUE;
}

Expand Down
2 changes: 1 addition & 1 deletion deps/zowe-common-c
6 changes: 6 additions & 0 deletions h/zssLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ bool isLogLevelValid(int level);
#define ZSS_LOG_CIPHER_INVALID_MSG_TEXT "Requested cipher '%s' not available.\n"
#define ZSS_LOG_CIPHER_INVALID_MSG ZSS_LOG_CIPHER_INVALID_MSG_ID" "ZSS_LOG_CIPHER_INVALID_MSG_TEXT

#ifndef ZSS_LOG_CURVE_INVALID_MSG_ID
#define ZSS_LOG_CURVE_INVALID_MSG_ID ZSS_LOG_MSG_PRFX"1067W"
#endif
#define ZSS_LOG_CURVE_INVALID_MSG_TEXT "Requested curve '%s' not supported.\n"
#define ZSS_LOG_CURVE_INVALID_MSG ZSS_LOG_CURVE_INVALID_MSG_ID" "ZSS_LOG_CURVE_INVALID_MSG_TEXT


/* registerProduct */

Expand Down
Loading