diff --git a/cert/cert_v2.go b/cert/cert_v2.go index 2c6f14a00..d173d6d3c 100644 --- a/cert/cert_v2.go +++ b/cert/cert_v2.go @@ -231,7 +231,16 @@ func (c *certificateV2) MarshalForHandshakes() ([]byte, error) { //TODO: panic on nil rawDetails b.AddBytes(c.rawDetails) - // Skipping the curve and public key since those come across in a different part of the handshake + // Skipping public key since those come across in a different part of the handshake + + //todo is curve skippable? I don't think so? + + // Add the curve only if its not the default value + if c.curve != Curve_CURVE25519 { + b.AddASN1(TagCertCurve, func(b *cryptobyte.Builder) { + b.AddBytes([]byte{byte(c.curve)}) + }) + } // Add the signature b.AddASN1(TagCertSignature, func(b *cryptobyte.Builder) {