Commit 305172d
committed
asn: ConfirmSignature accepts SPKI DER for Ed25519 / Ed448 alt-sig verify
The Ed25519 and Ed448 legs of ConfirmSignature called
wc_ed{25519,448}_import_public on the supplied key blob, which expects
the *raw* public key bytes. That works for the primary-signature
verify path because StoreKey strips the SubjectPublicKeyInfo BIT
STRING wrapper into cert->publicKey, but it broke the X9.146
alternative-signature verify path: dual-alg sapki is preserved as the
full SubjectPublicKeyInfo DER (cert->ca->sapkiDer in
ParseCertRelative), so for an Ed25519/Ed448 sapki the import call
returned BAD_FUNC_ARG and the cert was rejected before
DecodePeerAltPubKey could run.
Try the raw import first (preserves the existing primary path) and
fall back to wc_Ed{25519,448}PublicKeyDecode (which strips the SPKI
wrapper) when the raw form doesn't fit. Same dual-input pattern as
the comment notes; one extra call only on the SPKI path.
This unblocks the test_dual_alg_unsupported_alt_native test, which is
now a real TLS 1.3 handshake exercising:
- issuer-side: build a self-signed cert with primary ECDSA + alt
Ed25519 (real key, real Ed25519 alt signature),
- parse-time: ConfirmSignature verifies the Ed25519 alt sig against
the cert's own Ed25519 sapki (via the new SPKI fallback),
- DecodePeerAltPubKey: hits its default "log + skip" branch for the
unrecognised Ed25519 sapki OID,
- handshake: completes successfully because sigSpec == NATIVE never
consumes the alt key.
Verified with --enable-dual-alg-certs --enable-experimental
(default) and additionally with --enable-dilithium --enable-mldsa
--enable-certreq --enable-certgen --enable-keygen --enable-ed25519
+ -DWOLFSSL_CUSTOM_OID -DHAVE_OID_ENCODING -DHAVE_OID_DECODING:
- Both configs build clean under -Werror.
- All 10 dual-alg tests pass.
- test_dual_alg_unsupported_alt_native is now an end-to-end TLS
handshake (was a parser-only fallback in the previous commit).1 parent 54f14f9 commit 305172d
2 files changed
Lines changed: 68 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2619 | 2619 | | |
2620 | 2620 | | |
2621 | 2621 | | |
2622 | | - | |
2623 | | - | |
2624 | | - | |
2625 | | - | |
2626 | | - | |
2627 | | - | |
2628 | | - | |
2629 | | - | |
2630 | | - | |
2631 | | - | |
2632 | | - | |
2633 | | - | |
2634 | | - | |
2635 | | - | |
2636 | | - | |
2637 | | - | |
2638 | | - | |
2639 | | - | |
2640 | | - | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
2641 | 2630 | | |
2642 | 2631 | | |
2643 | 2632 | | |
2644 | 2633 | | |
2645 | 2634 | | |
2646 | | - | |
2647 | | - | |
2648 | | - | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
2649 | 2640 | | |
2650 | 2641 | | |
2651 | 2642 | | |
2652 | | - | |
| 2643 | + | |
| 2644 | + | |
2653 | 2645 | | |
2654 | 2646 | | |
2655 | | - | |
2656 | | - | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
2657 | 2652 | | |
2658 | 2653 | | |
2659 | 2654 | | |
2660 | 2655 | | |
2661 | | - | |
| 2656 | + | |
2662 | 2657 | | |
2663 | 2658 | | |
2664 | 2659 | | |
2665 | 2660 | | |
2666 | 2661 | | |
2667 | 2662 | | |
2668 | 2663 | | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
2669 | 2668 | | |
2670 | 2669 | | |
2671 | 2670 | | |
2672 | 2671 | | |
2673 | 2672 | | |
2674 | | - | |
2675 | | - | |
2676 | | - | |
2677 | | - | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
2681 | | - | |
2682 | | - | |
2683 | | - | |
2684 | | - | |
2685 | | - | |
2686 | | - | |
2687 | | - | |
2688 | | - | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
2689 | 2685 | | |
2690 | 2686 | | |
2691 | | - | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
2692 | 2691 | | |
2693 | 2692 | | |
2694 | 2693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16584 | 16584 | | |
16585 | 16585 | | |
16586 | 16586 | | |
16587 | | - | |
16588 | | - | |
| 16587 | + | |
| 16588 | + | |
| 16589 | + | |
| 16590 | + | |
| 16591 | + | |
| 16592 | + | |
| 16593 | + | |
| 16594 | + | |
| 16595 | + | |
| 16596 | + | |
| 16597 | + | |
| 16598 | + | |
| 16599 | + | |
| 16600 | + | |
| 16601 | + | |
| 16602 | + | |
16589 | 16603 | | |
16590 | 16604 | | |
16591 | 16605 | | |
| |||
16611 | 16625 | | |
16612 | 16626 | | |
16613 | 16627 | | |
16614 | | - | |
16615 | | - | |
| 16628 | + | |
| 16629 | + | |
| 16630 | + | |
| 16631 | + | |
| 16632 | + | |
| 16633 | + | |
| 16634 | + | |
| 16635 | + | |
| 16636 | + | |
| 16637 | + | |
| 16638 | + | |
16616 | 16639 | | |
16617 | 16640 | | |
16618 | 16641 | | |
| |||
0 commit comments