Skip to content

Commit

Permalink
add assertion verification disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleene committed Jan 24, 2025
1 parent 1d51879 commit 8b9618a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions xtest/sdk/go/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ elif [ "$1" == "decrypt" ]; then
if [ -n "$8" ]; then
args+=(--with-assertion-verification-keys "$8")
fi
if [ "$NO_VERIFY_ASSERTIONS" == 'true' ]; then
args+=(--no-verify-assertions)
fi
echo "${cmd[@]}" decrypt "${args[@]}" "$2"
"${cmd[@]}" decrypt "${args[@]}" "$2"
else
Expand Down
5 changes: 5 additions & 0 deletions xtest/sdk/java/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,10 @@ if [ -n "$8" ]; then
args+=(--with-assertion-verification-keys "$8")
fi

if [ "$NO_VERIFY_ASSERTIONS" == 'true' ]; then
args+=(--with-assertion-verification-disabled)
fi


echo java -jar "$SCRIPT_DIR"/cmdline.jar "${args[@]}" -f "$2" ">" "$3"
java -jar "$SCRIPT_DIR"/cmdline.jar "${args[@]}" -f "$2" >"$3"
3 changes: 3 additions & 0 deletions xtest/sdk/js/cli/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ if [ "$1" == "encrypt" ]; then

npx $CTL encrypt "$2" "${args[@]}"
elif [ "$1" == "decrypt" ]; then
if [ "$NO_VERIFY_ASSERTIONS" == 'true' ]; then
args+=(--noVerifyAssertions)
fi
npx $CTL decrypt "$2" "${args[@]}"
else
echo "Incorrect argument provided"
Expand Down
9 changes: 8 additions & 1 deletion xtest/tdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"nano_ecdsa",
"ns_grants",
"hexless",
"assertion_verification_disable",
]

sdk_paths: dict[sdk_type, str] = {
Expand Down Expand Up @@ -249,6 +250,7 @@ def decrypt(
rt_file: str,
fmt: format_type = "nano",
assert_keys: str = "",
no_verify_assertions: bool = False,
):
c = [
sdk_paths[sdk],
Expand All @@ -265,8 +267,13 @@ def decrypt(
"",
assert_keys,
]
env = dict(os.environ)
if no_verify_assertions:
env |= {"NO_VERIFY_ASSERTIONS": "true"}
else:
env |= {"NO_VERIFY_ASSERTIONS": "false"}
logger.info(f"dec [{' '.join(c)}]")
subprocess.check_output(c, stderr=subprocess.STDOUT)
subprocess.check_output(c, stderr=subprocess.STDOUT, env=env)


def supports(sdk: sdk_type, feature: feature_type) -> bool:
Expand Down

0 comments on commit 8b9618a

Please sign in to comment.