diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2019-05-10 22:43:10 +0200 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2019-05-10 22:50:16 +0200 |
commit | e095b67857f4bad35a366659d3d0f428f2747afb (patch) | |
tree | 412518f6261d28198422e85a91a91afb3568a3a1 | |
parent | 743ad0551bb67c8cf7b9d37effbf03c25444c8e2 (diff) |
Don't treat error reply as a proper JDWP handshake
As it turned out thanks to Yan Yang some ONAP services tend to
return a propr JDWP handshake as a part of their error message.
Let's filter out those services by checking number of lines returned
by the server. We expect that proper JDWP handshake won't be longer
than a single line.
Issue-ID: SECCOM-231
Change-Id: I4b8950ebdf5fe118ec5f2dd5f4de583211784fb2
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
-rwxr-xr-x | test/security/check_for_jdwp.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/security/check_for_jdwp.sh b/test/security/check_for_jdwp.sh index 0facbff69..e79f712bf 100755 --- a/test/security/check_for_jdwp.sh +++ b/test/security/check_for_jdwp.sh @@ -49,7 +49,8 @@ do_jdwp_handshake() { # 10s timeout to avoid hangs when service doesn't answer at all local response=`nc -w 10 $ip $port <<<$jdwp_challenge | tr '\0' '\n'` - if [[ $response == *"$jdwp_response"* ]]; then + local n_response_lines=`echo "$response" | wc -l` + if [[ "$n_response_lines" -le 1 ]] && [[ $response == *"$jdwp_response"* ]]; then return 0 fi |