Skip to content

Commit d648a08

Browse files
committed
Fix error when early data empty
This PR fixes an error when early data was empty which caused testssl.sh to exit instead of marking that there was no file returned. Also it changes HEAD to GET as the latter is probably more often supported. There needs to be a unit test for 0-RTT / early data!
1 parent 86700db commit d648a08

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

testssl.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7176,12 +7176,11 @@ sub_early_data() {
71767176
else
71777177
return 5
71787178
fi
7179-
7180-
safe_echo "HEAD / HTTP/1.1\r\nHost: $NODE\r\nConnection: close\r\nEarly-Data: 1\r\n\r\n" > $early_data
7179+
safe_echo "GET / HTTP/1.1\r\nHost: $NODE\r\nEarly-Data: 1\r\nConnection: close\r\n\r\n" > $early_data
71817180
$openssl_bin s_client $(s_client_options "$STARTTLS $BUGS -tls1_3 -connect $NODEIP:$PORT $PROXY $SNI") -sess_out $sess_data -ign_eof \
71827181
< $early_data >/dev/null 2>$ERRFILE
71837182
if [[ ! -s "$sess_data" ]]; then
7184-
exit 7
7183+
return 7
71857184
fi
71867185

71877186
$openssl_bin s_client $(s_client_options "$STARTTLS $BUGS -tls1_3 -connect $NODEIP:$PORT $PROXY $SNI") -sess_in $sess_data \
@@ -10804,7 +10803,7 @@ run_server_defaults() {
1080410803
6) prln_warning "Client Auth: early data check not supported"
1080510804
fileout "$jsonID" "WARN" "check couldn't be performed because of client authentication"
1080610805
;;
10807-
7) prln_warning "check failed (no session data"
10806+
7) prln_warning "check failed (no session data received)"
1080810807
fileout "$jsonID" "WARN" "check failed (no session data)"
1080910808
((ret++))
1081010809
;;

0 commit comments

Comments
 (0)