GitHub PullRequestReviewCommentEvent at 2014-04-22 09:05:40
Repository: cryptography
Actor: skeuomorf
Payload: {"comment":{"url":"https://api.github.com/repos/pyca/cryptography/pulls/comments/11843814","id":11843814,"diff_hunk":"@@ -431,6 +431,70 @@ def load_fips_dsa_key_pair_vectors(vector_data):\n     return vectors\n \n \n+def load_fips_dsa_sig_gen_vectors(vector_data):\n+    \"\"\"\n+    Loads data out of the FIPS DSA SigGen vector files.\n+    \"\"\"\n+    vectors = []\n+    sha_regex = re.compile(\n+        r\"\\[mod = L=...., N=..., SHA-(?P<sha>1|224|256|384|512)\\]\"\n+    )\n+    # When reading_key_data is set to True it tells the loader to continue\n+    # constructing dictionaries. We set reading_key_data to False during the\n+    # blocks of the vectors of N=224 because we don't support it.\n+    reading_key_data = True\n+    for line in vector_data:\n+        line = line.strip()\n+\n+        if not line or line.startswith(\"#\"):\n+            continue\n+\n+        sha_match = sha_regex.match(line)\n+        if sha_match:\n+            digest_algorithm = \"SHA-{0}\".format(sha_match.group(\"sha\"))\n+\n+        elif line.startswith(\"[mod = L=2048, N=224\"):\n+            reading_key_data = False\n+            continue\n+        elif line.startswith(\"[mod = L=2048, N=256, SHA-1\"):\n+            reading_key_data = True\n+            continue\n+\n+        if not reading_key_data:\n+            continue\n+\n+        line = line.split(\"=\")\n+\n+        if line[0].strip() == \"P\":","path":"tests/utils.py","position":38,"original_position":38,"commit_id":"5208251a66d7936fcbd1ee32f7d0839c09d8a9f0","original_commit_id":"5208251a66d7936fcbd1ee32f7d0839c09d8a9f0","user":{"login":"skeuomorf","id":1059260,"avatar_url":"https://avatars.githubusercontent.com/u/1059260?","gravatar_id":"1bda5b685301da39d2e9ea500f8336b1","url":"https://api.github.com/users/skeuomorf","html_url":"https://github.com/skeuomorf","followers_url":"https://api.github.com/users/skeuomorf/followers","following_url":"https://api.github.com/users/skeuomorf/following{/other_user}","gists_url":"https://api.github.com/users/skeuomorf/gists{/gist_id}","starred_url":"https://api.github.com/users/skeuomorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skeuomorf/subscriptions","organizations_url":"https://api.github.com/users/skeuomorf/orgs","repos_url":"https://api.github.com/users/skeuomorf/repos","events_url":"https://api.github.com/users/skeuomorf/events{/privacy}","received_events_url":"https://api.github.com/users/skeuomorf/received_events","type":"User","site_admin":false},"body":"Fixed in #946 ","created_at":"2014-04-22T09:05:40Z","updated_at":"2014-04-22T09:05:40Z","html_url":"https://github.com/pyca/cryptography/pull/947#discussion_r11843814","pull_request_url":"https://api.github.com/repos/pyca/cryptography/pulls/947","_links":{"self":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/comments/11843814"},"html":{"href":"https://github.com/pyca/cryptography/pull/947#discussion_r11843814"},"pull_request":{"href":"https://api.github.com/repos/pyca/cryptography/pulls/947"}}}}