Skip to content

Commit f66281d

Browse files
author
Richard Wheeler
committed
net.quic: 13a - correct an overclaimed doc comment
encode_certificate_verify's doc comment stated as settled fact that its OpenSSL-produced DER signature is directly compatible with net.mbedtls's verify_ecdsa_signature ("no reformatting needed between the two libraries"). That's the expected, standard behavior (OpenSSL's default EC signing format and mbedTLS's ECDSA verification both use ASN.1 DER ECDSA-Sig-Value, the TLS/X.509 convention), but this repo has never actually tested it: there's no EC certificate fixture to build an mbedtls_pk_context from for a real cross-library check, only a same-library (OpenSSL signs, OpenSSL verifies) round trip. Reworded to state what's actually verified (source inspection + the same-library test) versus what's expected-but-untested, rather than asserting settled fact. Caught during a requested pass verifying claims made across this PR's commits/comments. Everything else checked (RSA-PSS signing wrapper non-existence, EC certificate fixture non-existence, the three distinct key_share wire shapes, the supported_versions client/server asymmetry, and the application-secrets-derive-after-server-Finished timing) was confirmed accurate against the cached primary RFC text directly.
1 parent 01f7548 commit f66281d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

vlib/net/quic/tls13_certificate.v

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,17 @@ pub fn encode_certificate_verify(algorithm u16, signing_key ecdsa.PrivateKey, tr
299299
// vlib/crypto/ecdsa/ecdsa.v, keyed off the key's own bit size, matching
300300
// exactly what sig_scheme_ecdsa_secp256r1_sha256 requires. The
301301
// resulting signature is OpenSSL's standard ASN.1 DER ECDSA-Sig-Value
302-
// encoding, the same format net.mbedtls's verify_ecdsa_signature (used
303-
// on the client-side verify path, tls13_certificate_chain.c.v) already
304-
// parses -- no reformatting needed between the two libraries.
302+
// encoding (sign_digest, vlib/crypto/ecdsa/ecdsa.v, sets no raw/compact
303+
// signature option, so OpenSSL's EVP_PKEY_sign default applies) --
304+
// the same format TLS/X.509 ECDSA signatures conventionally use, and
305+
// what net.mbedtls's verify_ecdsa_signature (the client-side verify
306+
// path, tls13_certificate_chain.c.v) is written to parse. This is
307+
// confirmed by source inspection and this file's own same-library
308+
// (OpenSSL signs, OpenSSL verifies) round-trip test
309+
// (tls13_certificate_test.v), NOT by an actual cross-library
310+
// OpenSSL-signs/mbedTLS-verifies test -- this repo has no EC
311+
// certificate fixture to build an mbedtls_pk_context from for that
312+
// (same gap verify_ecdsa_signature's own client-side tests document).
305313
signature := signing_key.sign(content, hash_config: .with_recommended_hash)!
306314

307315
mut body := []u8{}

0 commit comments

Comments
 (0)