Skip to content

Commit

Permalink
ODoH: supoprt config version 0x0001 in addition to 0xff06
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jun 11, 2021
1 parent a34258c commit 1b03ac8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dnscrypt-proxy/oblivious_doh.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
)

const (
odohVersion = uint16(0xff06)
maxODoHConfigs = 10
odohVersion = uint16(0x0001)
odohTestVersion = uint16(0xff06)
maxODoHConfigs = 10
)

type ODoHTargetConfig struct {
Expand Down Expand Up @@ -77,7 +78,7 @@ func parseODoHTargetConfigs(configs []byte) ([]ODoHTargetConfig, error) {
}
configVersion := binary.BigEndian.Uint16(configs[offset : offset+2])
configLength := binary.BigEndian.Uint16(configs[offset+2 : offset+4])
if configVersion == odohVersion {
if configVersion == odohVersion || configVersion == odohTestVersion {
target, err := parseODoHTargetConfig(configs[offset+4 : offset+4+int(configLength)])
if err == nil {
targets = append(targets, target)
Expand Down

0 comments on commit 1b03ac8

Please sign in to comment.