mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 10:24:40 +01:00
Some fixes for SIDH
This commit is contained in:
parent
b5d6938dbf
commit
05ebd385da
2 changed files with 6 additions and 2 deletions
|
@ -88,7 +88,7 @@ func (proxy *Proxy) Decrypt(serverInfo *ServerInfo, encrypted []byte, nonce []by
|
|||
}
|
||||
var packet []byte
|
||||
var err error
|
||||
if serverInfo.CryptoConstruction == XChacha20Poly1305 {
|
||||
if serverInfo.CryptoConstruction == XChacha20Poly1305 || serverInfo.CryptoConstruction == SIDHXChacha20Poly1305 {
|
||||
packet, err = xsecretbox.Open(nil, serverNonce, encrypted[responseHeaderLen:], serverInfo.SharedKey[:])
|
||||
} else {
|
||||
var xsalsaServerNonce [24]byte
|
||||
|
|
|
@ -151,7 +151,11 @@ func FetchCurrentDNSCryptCert(proxy *Proxy, serverName *string, proto string, pk
|
|||
certInfo.SharedKey = sharedKey
|
||||
highestSerial = serial
|
||||
certInfo.CryptoConstruction = cryptoConstruction
|
||||
copy(certInfo.MagicQuery[:], binCert[104:112])
|
||||
if cryptoConstruction == SIDHXChacha20Poly1305 {
|
||||
copy(certInfo.MagicQuery[:], binCert[636:644])
|
||||
} else {
|
||||
copy(certInfo.MagicQuery[:], binCert[104:112])
|
||||
}
|
||||
if isNew {
|
||||
dlog.Noticef("[%s] OK (crypto v%d) - rtt: %dms", *serverName, cryptoConstruction, rtt.Nanoseconds()/1000000)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue