{"action":"opened","issue":{"url":"https://api.github.com/repos/Eyepea/aiosip/issues/129","repository_url":"https://api.github.com/repos/Eyepea/aiosip","labels_url":"https://api.github.com/repos/Eyepea/aiosip/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/Eyepea/aiosip/issues/129/comments","events_url":"https://api.github.com/repos/Eyepea/aiosip/issues/129/events","html_url":"https://github.com/Eyepea/aiosip/issues/129","id":356105639,"node_id":"MDU6SXNzdWUzNTYxMDU2Mzk=","number":129,"title":"SIP Digest authentication failed when the qop directive present in the challenge","user":{"login":"Jane-Fan","id":9366910,"node_id":"MDQ6VXNlcjkzNjY5MTA=","avatar_url":"https://avatars2.githubusercontent.com/u/9366910?v=4","gravatar_id":"","url":"https://api.github.com/users/Jane-Fan","html_url":"https://github.com/Jane-Fan","followers_url":"https://api.github.com/users/Jane-Fan/followers","following_url":"https://api.github.com/users/Jane-Fan/following{/other_user}","gists_url":"https://api.github.com/users/Jane-Fan/gists{/gist_id}","starred_url":"https://api.github.com/users/Jane-Fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jane-Fan/subscriptions","organizations_url":"https://api.github.com/users/Jane-Fan/orgs","repos_url":"https://api.github.com/users/Jane-Fan/repos","events_url":"https://api.github.com/users/Jane-Fan/events{/privacy}","received_events_url":"https://api.github.com/users/Jane-Fan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-31T19:53:50Z","updated_at":"2018-08-31T19:53:50Z","closed_at":null,"author_association":"NONE","body":"The sip registration fails sometime via aiosip.auth.py. \r\n\r\nThe aiosip/auth.py computes the response correctly when the qop directive value is not specified.\r\nIt should also include the scenario that the qop directive value is present. The response is calculated differently based on qop directive value.\r\n\r\nFor example, if the qop directive value is not present,\r\n    **response=MD5(HA1:nonce:HA2)**\r\nIf the qop is \"auth\" or \"auth-int\",\r\n    **response=MD5(HA1:nonce:nonceCount:cnonce:qop:HA2)**\r\nPlease refer the link [details](https://en.wikipedia.org/wiki/Digest_access_authentication.\r\n\r\n>  \r\n     @classmethod\r\n     def from_authenticate_header(cls, authenticate, method, uri, username, password):\r\n         if authenticate.startswith('Digest'):\r\n             params = {\r\n                 'username': username,\r\n                 'uri': uri\r\n             }\r\n\r\n             params.update(cls.__parse_digest(authenticate))\r\n             auth = cls(mode='Digest', **params)\r\n             ha1 = md5digest(username, auth['realm'], password)\r\n             ha2 = md5digest(method, uri)\r\n             try:\r\n                 qop = auth['qop']\r\n             except KeyError:\r\n                 auth['response'] = md5digest(ha1, auth['nonce'], ha2)\r\n             else:\r\n                 auth['nc'] = '00000001'\r\n                 auth['cnonce'] = '0a4f113b'\r\n                 auth['response'] = md5digest(\r\n                     ha1, auth['nonce'], auth['nc'], auth['cnonce'], qop, ha2\r\n                 )\r\n         else:\r\n             raise ValueError('Authentication method not supported')\r\n         return auth\r\n\r\n"}}
{"actor":{"display_login":"Jane-Fan"}}