Skip to content

Commit

Permalink
allow parsed or generated PubClientHelloMsg to be marshaled back to b…
Browse files Browse the repository at this point in the history
…ytes (#138)
  • Loading branch information
jmwample committed Nov 8, 2022
1 parent 9c1996a commit 8e1e65e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions u_public.go
Expand Up @@ -16,6 +16,7 @@ import (
// ClientHandshakeState will be converted into and from either
// - clientHandshakeState (TLS 1.2)
// - clientHandshakeStateTLS13 (TLS 1.3)
//
// uTLS will call .handshake() on one of these private internal states,
// to perform TLS handshake using standard crypto/tls implementation.
type PubClientHandshakeState struct {
Expand Down Expand Up @@ -431,6 +432,12 @@ func UnmarshalClientHello(data []byte) *PubClientHelloMsg {
return nil
}

// Marshal allows external code to convert a ClientHello object back into
// raw bytes.
func (chm *PubClientHelloMsg) Marshal() []byte {
return chm.getPrivatePtr().marshal()
}

// A CipherSuite is a specific combination of key agreement, cipher and MAC
// function. All cipher suites currently assume RSA key agreement.
type PubCipherSuite struct {
Expand Down

0 comments on commit 8e1e65e

Please sign in to comment.