{"action":"created","issue":{"url":"https://api.github.com/repos/drwetter/testssl.sh/issues/144","labels_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/144/comments","events_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/144/events","html_url":"https://github.com/drwetter/testssl.sh/pull/144","id":96261330,"number":144,"title":"Public key pinning check code causes invalid arithmetic operator (OSX)","user":{"login":"jonorossi","id":126297,"avatar_url":"https://avatars.githubusercontent.com/u/126297?v=3","gravatar_id":"","url":"https://api.github.com/users/jonorossi","html_url":"https://github.com/jonorossi","followers_url":"https://api.github.com/users/jonorossi/followers","following_url":"https://api.github.com/users/jonorossi/following{/other_user}","gists_url":"https://api.github.com/users/jonorossi/gists{/gist_id}","starred_url":"https://api.github.com/users/jonorossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonorossi/subscriptions","organizations_url":"https://api.github.com/users/jonorossi/orgs","repos_url":"https://api.github.com/users/jonorossi/repos","events_url":"https://api.github.com/users/jonorossi/events{/privacy}","received_events_url":"https://api.github.com/users/jonorossi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-21T08:44:35Z","updated_at":"2015-07-21T09:10:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/drwetter/testssl.sh/pulls/144","html_url":"https://github.com/drwetter/testssl.sh/pull/144","diff_url":"https://github.com/drwetter/testssl.sh/pull/144.diff","patch_url":"https://github.com/drwetter/testssl.sh/pull/144.patch"},"body":"Running the HEAD of testssl.sh on Mac OS X against https://testssl.sh is broken.\r\n\r\n```\r\n$ ./testssl.sh -H testssl.sh\r\n[...]\r\n--> Testing HTTP header response @ \"/\"\r\n\r\n HTTP Status Code             200 OK\r\n HTTP clock skew              0 sec from localtime\r\n Strict Transport Security    362 days=31337000 s, just this domain\r\n\")syntax error: invalid arithmetic operator (error token is \"tssl.sh: line 699: 2592000\r\n```\r\n\r\nI fixed the error by normalising to LF on line 691 to remove CRs from the HTTP headers before writing out the HPKP `TMPFILE`, and removed the CR handling code from line 699:\r\n```\r\n691:    egrep -aiw '^Public-Key-Pins|Public-Key-Pins-Report-Only' $HEADERFILE | tr -d '\\r' >$TMPFILE\r\n699:    hpkp_age_sec=$(sed -e 's/^.*max-age=//' -e 's/;.*//' $TMPFILE)\r\n```\r\n\r\nThen I got another error on line 713 because sed on OS X doesn't like `sed -i` without a file name extension.\r\n\r\nAfter these fixes to get it running the HPKP results still look wrong. https://testssl.sh provides two keys so the counting on line 695 doesn't seem to work (at least on OS X):\r\n```\r\n Public Key Pinning           One key is not sufficent, 30 days=2592000 s, just this domain\r\n                              No matching key for pin found\r\n```\r\n\r\nCould you please confirm the results are correct on Linux so I know the remaining issues are caused by tool differences."},"comment":{"url":"https://api.github.com/repos/drwetter/testssl.sh/issues/comments/123227182","html_url":"https://github.com/drwetter/testssl.sh/pull/144#issuecomment-123227182","issue_url":"https://api.github.com/repos/drwetter/testssl.sh/issues/144","id":123227182,"user":{"login":"jonorossi","id":126297,"avatar_url":"https://avatars.githubusercontent.com/u/126297?v=3","gravatar_id":"","url":"https://api.github.com/users/jonorossi","html_url":"https://github.com/jonorossi","followers_url":"https://api.github.com/users/jonorossi/followers","following_url":"https://api.github.com/users/jonorossi/following{/other_user}","gists_url":"https://api.github.com/users/jonorossi/gists{/gist_id}","starred_url":"https://api.github.com/users/jonorossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonorossi/subscriptions","organizations_url":"https://api.github.com/users/jonorossi/orgs","repos_url":"https://api.github.com/users/jonorossi/repos","events_url":"https://api.github.com/users/jonorossi/events{/privacy}","received_events_url":"https://api.github.com/users/jonorossi/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T09:10:56Z","updated_at":"2015-07-21T09:10:56Z","body":":disappointed: maybe I'll just give up running this on my Mac, and just set up a VM. Congrats, this is an engineering feat doing so much in bash, especially the sockets. Have you looked at writing any automated functional tests?"}}