{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/1903","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/1903/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/1903/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/1903/events","html_url":"https://github.com/openssl/openssl/issues/1903","id":188774913,"number":1903,"title":"Out of date/incorrect advice in SSL_get_error docs as of 1.1.0c","user":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars.githubusercontent.com/u/1455697?v=3","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-11-11T14:45:36Z","updated_at":"2016-11-22T09:55:55Z","closed_at":"2016-11-21T20:55:30Z","body":"This commit changed `SSL_read` to return -1 rather than 0 when `BIO_read` returns 0: https://github.com/openssl/openssl/commit/4880672a9b41a09a0984b55e219f02a2de7ab75e, which landed in the 1.1.0c release.\r\n\r\nWhen `SSL_get_error` is called, it'll return `SSL_ERROR_SYSCALL`, and the error stack will be empty. The man page for `SSL_get_error` says that at that point you should check `SSL_read`'s return code; a -1 means that there was a read error and to consult the BIO-specific error (e.g. errno), and 0 means that there was an EOF in violation of the protocol, but that doesn't appear to be correct anymore.\r\n\r\nIs this a bug in the implementation or the docs? If the new implementation is correct, I guess the new procedure should be to check the BIO error, and check if an error actually occurred to determine if it's an EOF?"},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/262196212","html_url":"https://github.com/openssl/openssl/issues/1903#issuecomment-262196212","issue_url":"https://api.github.com/repos/openssl/openssl/issues/1903","id":262196212,"user":{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars.githubusercontent.com/u/7422273?v=3","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T09:55:55Z","updated_at":"2016-11-22T09:55:55Z","body":"> I can understand that it is nice to make the API more consistent. But I want to make the API also cover the use cases it covered before in an obvious or at least documented way.\r\n\r\nWell, we have reverted the previous commit that caused the problem in the first place so you should be back to where we started from a functional perspective. The reality is that the old documentation was incorrect and didn't match what was implemented. It may have *worked* for some situations with some BIOs, but it was unreliable. Given that this whole area has proven to be very fragile to change I am reluctant to recommend more changes to make it do what the documentation said it did (especially since the documentation was inconsistent across different pages anyway).\r\n\r\nThe best way to determine whether an EOF has been hit is to ask the underlying BIO with BIO_eof(), i.e. something like:\r\n\r\nBIO_eof(SSL_get_rbio())\r\n\r\nBIO_eof() is already documented here:\r\nhttps://www.openssl.org/docs/man1.1.0/crypto/BIO_ctrl.html\r\n"}}
{"actor":{"display_login":"mattcaswell"}}