Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion xtest/otdfctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ def kas_registry_create_key(
# Handle race condition: if key already exists, return the existing one
if process.returncode != 0:
err_str = (err.decode() if err else "") + (out.decode() if out else "")
if "Invalid key parameters: invalid algorithm" in err_str:
if (
"Invalid key parameters: invalid algorithm" in err_str
or "key_algorithm_defined" in err_str
):
Comment on lines +315 to +318
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While this string matching correctly identifies the specific protobuf validation error returned by platform v0.15.0, it is a bit of a "magic string" that lacks context in the code. Adding a brief comment explaining that this string corresponds to a specific platform version's error response would improve maintainability.

            if (
                "Invalid key parameters: invalid algorithm" in err_str
                # Platform v0.15.0 returns this protobuf validation error for unsupported algorithms
                or "key_algorithm_defined" in err_str
            ):

raise InvalidAlgorithm(
f"Algorithm not supported by platform: {err_str}"
)
Expand Down
6 changes: 4 additions & 2 deletions xtest/tdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ def __init__(self, **kwargs: dict[str, Any]):
if self.semver >= (0, 13, 0):
self.features.add("mechanism-ec-curves-384-521")

# X-Wing hybrid PQ/T KEM support (ML-KEM-768 + X25519)
if self.semver >= (0, 14, 0):
# X-Wing / secp+ML-KEM hybrid PQ/T KEM support.
# Key management API for hpqt:* algorithms landed after service/v0.15.0;
# v0.15.0 rejects them with a key_algorithm validation error.
if self.semver >= (0, 16, 0):
self.features.add("mechanism-xwing")
self.features.add("mechanism-secpmlkem")

Expand Down
Loading