Skip to content

Commit

Permalink
hotfix: use default value for key, nonce, precounterblocksuffix
Browse files Browse the repository at this point in the history
  • Loading branch information
haeramkeem committed Jun 19, 2024
1 parent 2d3bc94 commit f9a1878
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
Binary file modified build/ztmb-doh-proxy
Binary file not shown.
Binary file modified build/ztmb-prover
Binary file not shown.
Binary file modified build/ztmb-wo-zkp
Binary file not shown.
5 changes: 4 additions & 1 deletion pkg/logic/enc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import (
// ---

const (
AEAD_TAG_SIZE = 16
AEAD_TAG_SIZE = 16
AEAD_DEFAULT_KEY = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
AEAD_DEFAULT_NONCE = "000102030405060708090a0b"
AEAD_DEFAULT_PRECOUNTERBLOCK_SUFFIX = "00000002"
)

type AEAD interface {
Expand Down
5 changes: 4 additions & 1 deletion pkg/logic/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (input *InputJson) ReadFile() (*DnsPacket, AEAD, error) {
return nil, nil, err
}

// Set default value
input.Key = AEAD_DEFAULT_KEY
input.Nonce = AEAD_DEFAULT_NONCE
input.Counter = AEAD_DEFAULT_PRECOUNTERBLOCK_SUFFIX
if err := json.Unmarshal(raw, input); err != nil {
return nil, nil, err
}
Expand All @@ -43,7 +47,6 @@ func (input *InputJson) ReadFile() (*DnsPacket, AEAD, error) {

aead := new(aesParam)
// aead := new(chachaPolyParam)

if aead.key, err = hex.DecodeString(input.Key); err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit f9a1878

Please sign in to comment.