summaryrefslogtreecommitdiff
path: root/wrappers/python
diff options
context:
space:
mode:
authorStevenWdV <stevenwdv@gmail.com>2021-11-29 01:20:06 +0100
committerStevenWdV <stevenwdv@gmail.com>2021-11-29 01:26:47 +0100
commite4744fd94236944569bfed27af80a604b7668e4b (patch)
treee360330d55706513395a27e6c85c7cdfca92ee68 /wrappers/python
parent4a293e0bba1f4c7f1069e5ea40fd0947185aaeea (diff)
Fix Java wrapper on Unix (append 'lib' prefix to library)
Diffstat (limited to 'wrappers/python')
-rw-r--r--wrappers/python/discovery.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/wrappers/python/discovery.py b/wrappers/python/discovery.py
index 21118a9..b22c82e 100644
--- a/wrappers/python/discovery.py
+++ b/wrappers/python/discovery.py
@@ -2,6 +2,14 @@ import platform
from ctypes import *
from enum import Enum
+# TODO OpenBSD?
+
+_lib_prefixes = {
+ "windows": "",
+ "linux": "lib",
+ "darwin": "lib",
+}
+
_lib_suffixes = {
"windows": ".dll",
"linux": ".so",
@@ -26,7 +34,7 @@ _arch = \
_os = platform.system().lower()
-_lib = cdll.LoadLibrary(f"../../exports/{_os}/{_arch}/eduvpn_verify{_lib_suffixes[_os]}")
+_lib = cdll.LoadLibrary(f"../../exports/{_os}/{_arch}/{_lib_prefixes[_os]}eduvpn_verify{_lib_suffixes[_os]}")
class GoSlice(Structure):
@@ -74,6 +82,7 @@ def verify(signature: bytes, signed_json: bytes, expected_file_name: str, min_si
"""
Verifies the signature on the JSON server_list.json/organization_list.json file.
If the function returns the signature is valid for the given file type.
+
:param signature: .minisig signature file contents.
:param signed_json: Signed .json file contents.
:param expected_file_name: The file type to be verified, one of "server_list.json" or "organization_list.json".