Do not ignore ODoH encryption errors

This commit is contained in:
Frank Denis 2021-05-09 16:16:38 +02:00
parent f9cecd1215
commit 31f4d7aa03
1 changed files with 3 additions and 0 deletions

View File

@ -105,6 +105,9 @@ func (t ODoHTarget) encryptQuery(query []byte) (ODoHQuery, error) {
aad := append([]byte{0x01}, t.keyID...)
ciphertext, err := clientCtx.EncryptToServer(odohPlaintext, aad)
if err != nil {
return ODoHQuery{}, err
}
encryptedMessage := encodeLengthValue(append(encryptedSharedSecret, ciphertext...))
odohMessage := append(append([]byte{0x01}, t.keyID...), encryptedMessage...)