Repository navigation
Teach sshkey_check_sigtype about OQS hybrid framing - #204
andrewyounkers merged 2 commits into
Conversation
f3da26c to
351bdc5
Compare
|
Converting this PR to draft for now. CI is red across ubuntu + the full VM matrix with a failure pattern that also appears on #204 (which does not touch the KEX path), so this looks like a shared CI / floating I will reproduce and troubleshoot on my fork (and locally) first, then follow up here with findings and/or a separate CI/liboqs fix as appropriate before asking for review again. |
workflow_dispatch-only job to reproduce CI Checks against a chosen liboqs ref without opening or updating upstream PRs. Used to bisect rekey failures seen on draft PRs open-quantum-safe#203/open-quantum-safe#204. Signed-off-by: Mohammadreza Khellat <mkhellat@beavernets.com> Co-authored-by: Mohammad Masoumi <225140472+mhmd-masoumi@users.noreply.github.com> Co-authored-by: Cursor Auto <cursoragent@cursor.com>
workflow_dispatch-only job to reproduce CI Checks against a chosen liboqs ref without opening or updating upstream PRs. Used to bisect rekey failures seen on draft PRs open-quantum-safe#203/open-quantum-safe#204. Signed-off-by: Mohammadreza Khellat <mkhellat@gmail.com> Co-authored-by: Mohammad Masoumi <225140472+mhmd-masoumi@users.noreply.github.com> Co-authored-by: Cursor Auto <cursoragent@cursor.com>
|
Update on the red Ubuntu / VM CI: fork-only rekey-only trisect against |
351bdc5 to
5e2dde9
Compare
| &classic_type)) != 0) | ||
| goto out; | ||
| /* Require the PQ half to also be a well-formed typed SSH signature. */ | ||
| if ((r = sshkey_get_sigtype(pq_sig, pq_len, &pq_type)) != 0) |
There was a problem hiding this comment.
It looks like the PQ type is parsed into pq_type but its value isn’t used after this call. In your opinion, would it make sense not to introduce it here and pass NULL to sshkey_get_sigtype(), or validate pq_type against the expected PQ type?
Hybrid signatures are string(classical) || string(pq), each component a normal typed SSH signature. The outer blob has no leading hybrid algorithm name, so the classic get_sigtype path always failed and identity_sign skipped the PKCS#11 post-sign check for hybrids. Validation is meaningful: RSA hybrids must embed rsa-sha2-* (not ssh-rsa/SHA1) in the classical half; ECDSA hybrids label that half with the hybrid algorithm name. Parse both components and check the classical type accordingly; also require the PQ half to be a well-formed typed signature. Re-enable the check in identity_sign (covers agent path too). Fixes open-quantum-safe#201 Signed-off-by: Mohammadreza Khellat <mkhellat@gmail.com>
Signed-off-by: Mohammadreza Khellat <mkhellat@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
4019f02 to
bf7ef35
Compare
|
@andrewyounkers Thank you for the approval — much appreciated. From our side this is ready to merge. Rebased onto current |
5d42e44
into
open-quantum-safe:OQS-v10
Summary
Fixes #201.
Logic
sshkey_check_sigtypeassumes a classic SSH signature: leadingstring(algorithm). OQS classical+PQ hybrids instead encode:each component itself a typed SSH signature. The outer blob therefore has no hybrid algorithm name, so the check always failed. During the 8.4/10.x uplift this was papered over by skipping the check for hybrids in
identity_sign(OQS-TODO).Is the validation meaningful for hybrids? Yes for the callers that use it (PKCS#11 / agent):
rsa-sha2-256(notssh-rsa/SHA1) in the classical half — same concern as plain RSA tokens.sshkey_ssh_name_plain.Changing the wire format to put the hybrid name on the outside would break existing OQS-OpenSSH interop, so this extends the parser instead.
Change
sshkey_check_oqs_hybrid_sigtype: parse both components; require classical type matches expected (rsa-sha2-*or hybrid name); require PQ half is a well-formed typed signature.requested_algthrough that path insshkey_check_sigtype.OQS-TODOinidentity_sign(agent path inauthfd.cbenefits automatically).Test plan
get_sigtypeon hybrid outer blob misreads classical length as type length; hybrid parser recoversrsa-sha2-256from classical componentOQS-v10post-kex: drop Classic McEliece to match liboqs default-off #206; upstream CI Checks + full VM matrix green(https://github.com/open-quantum-safe/openssh/actions/runs/42452557774,
https://github.com/open-quantum-safe/openssh/actions/runs/42452557897)