)]}'
{"nova/api/metadata/handler.py":[{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"3275e50ae6752b2841b4af95d3be687e51d3bf66","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            encodeutils.to_utf8(requestor_id),"},{"line_number":282,"context_line":"            hashlib.sha256).hexdigest()"},{"line_number":283,"context_line":"        if (not signature or"},{"line_number":284,"context_line":"            not secutils.constant_time_compare(expected_signature, signature)):"},{"line_number":285,"context_line":"            if requestor_id:"},{"line_number":286,"context_line":"                LOG.warning(\u0027X-Instance-ID-Signature: %(signature)s does \u0027"},{"line_number":287,"context_line":"                            \u0027not match the expected value: \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_92c9125a","line":284,"updated":"2019-05-29 22:10:36.000000000","message":"When I saw this change at first time, I guessed secutils.constant_time_compare() could return false if signature is None, then this change could be necessary.\nBut the method just raises NoneType like the following:\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n      File \"/home/oomichi/openstack/nova/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py\", line 1330, in patched\n        return func(*args, **keywargs)\n      File \"nova/tests/unit/test_metadata.py\", line 1556, in test_metadata_lb_proxy_not_signed\n        \u0027X-Metadata-Provider\u0027: proxy_lb_id})\n      File \"nova/tests/unit/test_metadata.py\", line 160, in fake_request\n        response \u003d request.get_response(app)\n      File \"/home/oomichi/openstack/nova/.tox/py27/local/lib/python2.7/site-packages/webob/request.py\", line 1314, in send\n        application, catch_exc_info\u003dFalse)\n      File \"/home/oomichi/openstack/nova/.tox/py27/local/lib/python2.7/site-packages/webob/request.py\", line 1278, in call_application\n        app_iter \u003d application(self.environ, start_response)\n      File \"/home/oomichi/openstack/nova/.tox/py27/local/lib/python2.7/site-packages/webob/dec.py\", line 129, in __call__\n        resp \u003d self.call_func(req, *args, **kw)\n      File \"/home/oomichi/openstack/nova/.tox/py27/local/lib/python2.7/site-packages/webob/dec.py\", line 193, in call_func\n        return self.func(req, *args, **kwargs)\n      File \"nova/api/metadata/handler.py\", line 108, in __call__\n        meta_data \u003d self._handle_instance_id_request_from_lb(req)\n      File \"nova/api/metadata/handler.py\", line 259, in _handle_instance_id_request_from_lb\n        instance_address)\n      File \"nova/api/metadata/handler.py\", line 284, in _validate_shared_secret\n        if not secutils.constant_time_compare(expected_signature, signature):\n    TypeError: \u0027NoneType\u0027 does not have the buffer interface\n\nSo this change seems reasonable for me now.","commit_id":"8179f36285b22159d739592ed33c4233767d6a54"}]}
