aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2020-11-23 11:40:19 +0100
committerJ08nY2020-11-23 11:44:01 +0100
commitac483046f5ff99cc4629bbfe5b1f9fbb6c90297b (patch)
tree2c740792806baf5241d987543f286a9bbbcae925
parentb9d2a6d114875635d97a3b10fbc0ec1f72ff6c50 (diff)
downloadstd-curves-ac483046f5ff99cc4629bbfe5b1f9fbb6c90297b.tar.gz
std-curves-ac483046f5ff99cc4629bbfe5b1f9fbb6c90297b.tar.zst
std-curves-ac483046f5ff99cc4629bbfe5b1f9fbb6c90297b.zip
Add GitHub action to check OID values.
-rwxr-xr-x.github/workflows/oids.py26
-rw-r--r--.github/workflows/oids.yml26
2 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/oids.py b/.github/workflows/oids.py
new file mode 100755
index 0000000..92c8da8
--- /dev/null
+++ b/.github/workflows/oids.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+import glob
+import json
+import sys
+import os.path
+import requests
+
+if __name__ == "__main__":
+ result = 0
+ for curves_json in glob.glob("*/curves.json"):
+ category = os.path.dirname(curves_json)
+ with open(curves_json) as f:
+ curves = json.load(f)
+ for curve in curves["curves"]:
+ if "oid" not in curve:
+ continue
+ oid = curve["oid"]
+ if not oid:
+ print(f"Curve {category}/{curve['name']} has empty OID value.")
+ continue
+ url = f"http://oid-info.com/get/{oid}"
+ r = requests.get(url)
+ if r.status_code != 200:
+ print(f"Curve {category}/{curve['name']} has bad OID, return code {r.status_code}!")
+ result = 1
+ sys.exit(result)
diff --git a/.github/workflows/oids.yml b/.github/workflows/oids.yml
new file mode 100644
index 0000000..1ae6bb9
--- /dev/null
+++ b/.github/workflows/oids.yml
@@ -0,0 +1,26 @@
+name: OID check
+
+on:
+ push:
+ branches: [ data ]
+ pull_request:
+ branches: [ data ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python 3.8
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.8
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install requests
+ - name: Check the OIDs
+ run: |
+ python .github/workflows/oids.py