forked from quic-go/quic-go
use chacha20poly1305 instead of AES and include cert in key derivation
Unfortunately QUIC uses non-standard tag sizes with both AES-GCM and Poly1305. Adopting AES-GCM seems much harder, so I changed it to Chacha20Poly1305 and only made some slight changes to an existing algo. This should probably be double-checked at some point.
This commit is contained in:
@@ -83,11 +83,10 @@ func (s *Session) HandlePacket(addr *net.UDPAddr, publicHeaderBinary []byte, pub
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.aead, err = crypto.DeriveKeysAESGCM(sharedSecret, cryptoData[handshake.TagNONC], s.ConnectionID, frame.Data, s.ServerConfig.Get())
|
||||
s.aead, err = crypto.DeriveKeysChacha20(sharedSecret, cryptoData[handshake.TagNONC], s.ConnectionID, frame.Data, s.ServerConfig.Get(), s.ServerConfig.kd.GetCertUncompressed())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("Got common secret")
|
||||
s.SendFrames([]Frame{&AckFrame{
|
||||
Entropy: s.Entropy.Get(),
|
||||
LargestObserved: 2,
|
||||
|
||||
Reference in New Issue
Block a user