{"action":"created","issue":{"url":"https://api.github.com/repos/drwetter/testssl.sh/issues/1130","repository_url":"https://api.github.com/repos/drwetter/testssl.sh","labels_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/1130/labels{/name}","comments_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/1130/comments","events_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/1130/events","html_url":"https://github.com/drwetter/testssl.sh/issues/1130","id":362761204,"node_id":"MDU6SXNzdWUzNjI3NjEyMDQ=","number":1130,"title":"TCP fragmentation caused by \\x0a sent to socket","user":{"login":"drwetter","id":8036727,"node_id":"MDQ6VXNlcjgwMzY3Mjc=","avatar_url":"https://avatars1.githubusercontent.com/u/8036727?v=4","gravatar_id":"","url":"https://api.github.com/users/drwetter","html_url":"https://github.com/drwetter","followers_url":"https://api.github.com/users/drwetter/followers","following_url":"https://api.github.com/users/drwetter/following{/other_user}","gists_url":"https://api.github.com/users/drwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/drwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drwetter/subscriptions","organizations_url":"https://api.github.com/users/drwetter/orgs","repos_url":"https://api.github.com/users/drwetter/repos","events_url":"https://api.github.com/users/drwetter/events{/privacy}","received_events_url":"https://api.github.com/users/drwetter/received_events","type":"User","site_admin":false},"labels":[{"id":493013790,"node_id":"MDU6TGFiZWw0OTMwMTM3OTA=","url":"https://api.github.com/repos/drwetter/testssl.sh/labels/important","name":"important","color":"FF4500","default":false},{"id":728034434,"node_id":"MDU6TGFiZWw3MjgwMzQ0MzQ=","url":"https://api.github.com/repos/drwetter/testssl.sh/labels/performance","name":"performance","color":"8eedda","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/drwetter/testssl.sh/milestones/4","html_url":"https://github.com/drwetter/testssl.sh/milestone/4","labels_url":"https://api.github.com/repos/drwetter/testssl.sh/milestones/4/labels","id":1475185,"node_id":"MDk6TWlsZXN0b25lMTQ3NTE4NQ==","number":4,"title":"3.0","description":"The upcoming release contains a ROBOT check, full TLS 1.3 support, further socket improvements, proper network connectivity problem treatment, CRL and OCSP checking, OpenSSL 1.1.1 support, exit error code cleanup, JSON findings and IDs are now snappier, \r\na lot more improvements not mentioned and last but not least, lots of fixes.","creator":{"login":"drwetter","id":8036727,"node_id":"MDQ6VXNlcjgwMzY3Mjc=","avatar_url":"https://avatars1.githubusercontent.com/u/8036727?v=4","gravatar_id":"","url":"https://api.github.com/users/drwetter","html_url":"https://github.com/drwetter","followers_url":"https://api.github.com/users/drwetter/followers","following_url":"https://api.github.com/users/drwetter/following{/other_user}","gists_url":"https://api.github.com/users/drwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/drwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drwetter/subscriptions","organizations_url":"https://api.github.com/users/drwetter/orgs","repos_url":"https://api.github.com/users/drwetter/repos","events_url":"https://api.github.com/users/drwetter/events{/privacy}","received_events_url":"https://api.github.com/users/drwetter/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":74,"state":"open","created_at":"2015-12-27T17:31:59Z","updated_at":"2018-09-22T07:47:24Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-09-21T20:20:46Z","updated_at":"2018-09-23T12:07:50Z","closed_at":null,"author_association":"OWNER","body":"\r\nAs noted in the discussion of PR #1113 it seems that ``printf -- \"$data\" >&5 2>/dev/null`` does not do what it is intended. ``$data`` contains a ClientHello, 5 is the fd of a socket. \"$data\" is  a ClientHello like\r\n\r\n``\\x16\\x03\\x01\\x2\\x00\\x01\\x00\\x1\\xfc\\x03\\x03\\x54\\x51\\x1e\\x7a\\xde\\xad\\xbe\\xef\\x31\\x33\\x07\\x00\\x00\\x00\\x00\\x00\\xcf\\xbd\\x39\\x04\\xcc\\x16\\x0a\\...``\r\n\r\nEach \\x0a like the last one causes a new TCP fragment to begin which can be spotted when using wireshark while running e.g.\r\n\r\n``testssl.sh --assume-http -p testssl.sh``\r\n\r\nStarting from the SSLv3 ClientHello the first reassembled packet ends with 0a.\r\n\r\n\r\nThis ticket is for continuing the discussion from https://github.com/drwetter/testssl.sh/pull/1113#issuecomment-423555340 on\r\n"},"comment":{"url":"https://api.github.com/repos/drwetter/testssl.sh/issues/comments/423811750","html_url":"https://github.com/drwetter/testssl.sh/issues/1130#issuecomment-423811750","issue_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/1130","id":423811750,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzgxMTc1MA==","user":{"login":"drwetter","id":8036727,"node_id":"MDQ6VXNlcjgwMzY3Mjc=","avatar_url":"https://avatars1.githubusercontent.com/u/8036727?v=4","gravatar_id":"","url":"https://api.github.com/users/drwetter","html_url":"https://github.com/drwetter","followers_url":"https://api.github.com/users/drwetter/followers","following_url":"https://api.github.com/users/drwetter/following{/other_user}","gists_url":"https://api.github.com/users/drwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/drwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drwetter/subscriptions","organizations_url":"https://api.github.com/users/drwetter/orgs","repos_url":"https://api.github.com/users/drwetter/repos","events_url":"https://api.github.com/users/drwetter/events{/privacy}","received_events_url":"https://api.github.com/users/drwetter/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T12:07:50Z","updated_at":"2018-09-23T12:07:50Z","author_association":"OWNER","body":"It turned out not to be a feature of bash + sockets but of the internal printf:\r\n\r\n```\r\nprompt> strace -ewrite bash -c 'printf \"one\\ntwo\\n\"' >/dev/null\r\nwrite(1, \"one\\n\", 4)                    = 4\r\nwrite(1, \"two\\n\", 4)                    = 4\r\n+++ exited with 0 +++\r\nprompt> strace -etrace=write /usr/bin/printf \"one\\two\\n\" > /dev/null\r\nwrite(1, \"one\\two\\n\", 7)                = 7\r\n+++ exited with 0 +++\r\n```\r\n\r\nWe could also use ``stdbuf`` or ``dd`` (latter either directly for writing into the socket or as a pipe after any printf). : \r\n\r\n```\r\nprompt> strace -etrace=write bash -c 'stdbuf -o1M printf \"one\\ntwo\\n\"  ' > /dev/null\r\nwrite(1, \"one\\ntwo\\n\", 8)               = 8\r\n+++ exited with 0 +++\r\nprompt> bash -c 'printf \"one\\ntwo\\n\" | strace -e write,read -o/tmp/log.txt dd status=none bs=1M' > /dev/null\r\nprompt> cat /tmp/log.txt\r\n[..]\r\nread(0, \"one\\ntwo\\n\", 1048576)          = 8\r\nwrite(1, \"one\\ntwo\\n\", 8)               = 8\r\nread(0, \"\", 1048576)                    = 0\r\n+++ exited with 0 +++\r\n```"}}
{"actor":{"display_login":"drwetter"}}