add a 0-RTT encryption level

This commit is contained in:
Marten Seemann 2019-06-23 13:37:26 +08:00
parent aecaf9dd50
commit b1fc984306
2 changed files with 5 additions and 0 deletions

View file

@ -11,6 +11,8 @@ const (
EncryptionInitial EncryptionInitial
// EncryptionHandshake is the Handshake encryption level // EncryptionHandshake is the Handshake encryption level
EncryptionHandshake EncryptionHandshake
// Encryption0RTT is the 0-RTT encryption level
Encryption0RTT
// Encryption1RTT is the 1-RTT encryption level // Encryption1RTT is the 1-RTT encryption level
Encryption1RTT Encryption1RTT
) )
@ -21,6 +23,8 @@ func (e EncryptionLevel) String() string {
return "Initial" return "Initial"
case EncryptionHandshake: case EncryptionHandshake:
return "Handshake" return "Handshake"
case Encryption0RTT:
return "0-RTT"
case Encryption1RTT: case Encryption1RTT:
return "1-RTT" return "1-RTT"
} }

View file

@ -10,6 +10,7 @@ var _ = Describe("Encryption Level", func() {
Expect(EncryptionUnspecified.String()).To(Equal("unknown")) Expect(EncryptionUnspecified.String()).To(Equal("unknown"))
Expect(EncryptionInitial.String()).To(Equal("Initial")) Expect(EncryptionInitial.String()).To(Equal("Initial"))
Expect(EncryptionHandshake.String()).To(Equal("Handshake")) Expect(EncryptionHandshake.String()).To(Equal("Handshake"))
Expect(Encryption0RTT.String()).To(Equal("0-RTT"))
Expect(Encryption1RTT.String()).To(Equal("1-RTT")) Expect(Encryption1RTT.String()).To(Equal("1-RTT"))
}) })
}) })