Skip to content

Commit 598a3e6

Browse files
committed
check return value of wc_DhGetNamedKeyParamSize
1 parent 040e210 commit 598a3e6

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/tls.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5285,14 +5285,16 @@ static int tlsx_ffdhe_find_group(WOLFSSL* ssl, SupportedCurve* clientGroup,
52855285
if (serverGroup->name != group->name)
52865286
continue;
52875287

5288-
wc_DhGetNamedKeyParamSize(serverGroup->name, &p_len, NULL, NULL);
5289-
if (p_len == 0) {
5290-
ret = BAD_FUNC_ARG;
5291-
break;
5292-
}
5293-
if (p_len >= ssl->options.minDhKeySz &&
5294-
p_len <= ssl->options.maxDhKeySz) {
5295-
break;
5288+
ret = wc_DhGetNamedKeyParamSize(serverGroup->name, &p_len, NULL, NULL);
5289+
if (ret == 0) {
5290+
if (p_len == 0) {
5291+
ret = BAD_FUNC_ARG;
5292+
break;
5293+
}
5294+
if (p_len >= ssl->options.minDhKeySz &&
5295+
p_len <= ssl->options.maxDhKeySz) {
5296+
break;
5297+
}
52965298
}
52975299
}
52985300

0 commit comments

Comments
 (0)