mirror of
https://github.com/J08nY/std-curves.git
synced 2026-01-09 13:28:01 -05:00
27 lines
843 B
Python
Executable File
27 lines
843 B
Python
Executable File
#!/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, timeout=5)
|
|
if r.status_code != 200:
|
|
print(f"Curve {category}/{curve['name']} has bad OID, return code {r.status_code}!")
|
|
result = 1
|
|
sys.exit(result)
|