Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions docker/minitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,34 @@
# Trust test.openquantumsafe.org root CA:
sslContext.load_verify_locations(cafile="CA.crt")

# Iterate over all algorithm/port combinations:
for sigs, kexs in assignments.items():
for kex, port in kexs.items():
if (kex != "*"): # '*' denoting any classic KEX alg
# Enable use of the specific QSC KEX algorithm
os.environ["TLS_DEFAULT_GROUPS"]=kex
try:
with urllib.request.urlopen('https://test.openquantumsafe.org:'+str(port), context=sslContext) as response:
if response.getcode() != 200:
print("Failed to test %s successfully" % (kex))
else:
print("Success testing %s at port %d" % (kex, port))
except:
print("Test of algorithm combination SIG %s/KEX %s failed. Are all algorithms supported by current OQS library?" % (sigs, kex))

if "SHORT_TEST" in os.environ:
exit(0)
port = 6138
kex="kyber512"
sigs = "dilithium2"

try:
with urllib.request.urlopen('https://test.openquantumsafe.org:'+str(port), context=sslContext) as response:
if response.getcode() != 200:
print("Failed to test %s successfully" % (kex))
else:
print("Success testing %s at port %d" % (kex, port))
except:
print("Test of algorithm combination SIG %s/KEX %s failed. Are all algorithms supported by current OQS library?" % (sigs, kex))


# # Iterate over all algorithm/port combinations:
# for sigs, kexs in assignments.items():
# for kex, port in kexs.items():
# if (kex != "*"): # '*' denoting any classic KEX alg
# # Enable use of the specific QSC KEX algorithm
# os.environ["TLS_DEFAULT_GROUPS"]=kex
# try:
# with urllib.request.urlopen('https://test.openquantumsafe.org:'+str(port), context=sslContext) as response:
# if response.getcode() != 200:
# print("Failed to test %s successfully" % (kex))
# else:
# print("Success testing %s at port %d" % (kex, port))
# except:
# print("Test of algorithm combination SIG %s/KEX %s failed. Are all algorithms supported by current OQS library?" % (sigs, kex))

# if "SHORT_TEST" in os.environ:
# exit(0)
4 changes: 2 additions & 2 deletions oqs/oqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def _install_liboqs(target_directory, oqs_version=None):


def _load_liboqs():
home_dir = os.path.expanduser("~")
oqs_install_dir = os.path.abspath(home_dir + os.path.sep + "_oqs") # $HOME/_oqs
home_dir = os.path.expanduser("/opt")
oqs_install_dir = os.path.abspath(home_dir + os.path.sep + "oqssa") # $HOME/_oqs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this change is causing the CI failures—is it necessary?

Copy link
Author

@gobbledy-gook gobbledy-gook Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is utterly necessary or not, but it is where the shared object liboqs.so is found by oqs.py.

As I understand (please correct if I am wrong), previously, liboqs.so was being installed during runtime (while oqs.py tries to load the shared object but does not find it and as a result installs at ~/_oqs), however in this case the shared object is required to build ops-provider. Thus now it is installed in ${INSTALLDIR}=/opt/oqssa with all other binaries.

Copy link
Member

@vsoftco vsoftco Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/opt is a non-standard UNIX path, mostly used on macOS (homebrew). I prefer to have oqs install automatically in the user home directory if not found, so I would not change the initial code above

oqs_lib_dir = (
os.path.abspath(oqs_install_dir + os.path.sep + "bin") # $HOME/_oqs/bin
if platform.system() == "Windows"
Expand Down