chris-wood / odoh

Oblivious DoH library
MIT License
17 stars 4 forks source link

`ObliviousDoHConfigs` is not implemented #20

Closed tanyav2 closed 4 years ago

tanyav2 commented 4 years ago

According to the draft, we can support multiple ObliviousDoHConfigs and multiple ObliviousDoHConfigContents. This allows a server to support multiple versions of ODoH and multiple sets of ODoH HPKE suite parameters.

This support is missing in the current implementation.

Example test vector: odohconfig: "0002ff020002002000010001002040d105c6793eff8964e869ec1d55f7a3c78962c1c39a2158ee5e8f675443be34002000010001000401020304ff030002002000010001000401020304002000010001002040d105c6793eff8964e869ec1d55f7a3c78962c1c39a2158ee5e8f675443be34" which maps to [0, 2, 255, 2, 0, 2, 0, 32, 0, 1, 0, 1, 0, 32, 64, 209, 5, 198, 121, 62, 255, 137, 100, 232, 105, 236, 29, 85, 247, 163, 199, 137, 98, 193, 195, 154, 33, 88, 238, 94, 143, 103, 84, 67, 190, 52, 0, 32, 0, 1, 0, 1, 0, 4, 1, 2, 3, 4, 255, 3, 0, 2, 0, 32, 0, 1, 0, 1, 0, 4, 1, 2, 3, 4, 0, 32, 0, 1, 0, 1, 0, 32, 64, 209, 5, 198, 121, 62, 255, 137, 100, 232, 105, 236, 29, 85, 247, 163, 199, 137, 98, 193, 195, 154, 33, 88, 238, 94, 143, 103, 84, 67, 190, 52]

should deserialize to:

ObliviousDoHConfigs { 
    configs: [
        ObliviousDoHConfig { 
            version: 65282, 
            contents: [
                ObliviousDoHConfigContents { 
                    kem_id: 32, 
                    kdf_id: 1, 
                    aead_id: 1, 
                    public_key: [64, 209, 5, 198, 121, 62, 255, 137, 100, 232, 105, 236, 29, 85, 247, 163, 199, 137, 98, 193, 195, 154, 33, 88, 238, 94, 143, 103, 84, 67, 190, 52]
                }, 
                ObliviousDoHConfigContents { 
                    kem_id: 32, 
                    kdf_id: 1, 
                    aead_id: 1, 
                    public_key: [1, 2, 3, 4] 
                }
            ] 
        }, 
        ObliviousDoHConfig { 
            version: 65283, 
            contents: [
                ObliviousDoHConfigContents { 
                    kem_id: 32, 
                    kdf_id: 1, 
                    aead_id: 1, 
                    public_key: [1, 2, 3, 4] 
                }, 
                ObliviousDoHConfigContents { 
                    kem_id: 32, 
                    kdf_id: 1, 
                    aead_id: 1, 
                    public_key: [64, 209, 5, 198, 121, 62, 255, 137, 100, 232, 105, 236, 29, 85, 247, 163, 199, 137, 98, 193, 195, 154, 33, 88, 238, 94, 143, 103, 84, 67, 190, 52] 
                }
            ] 
        }
    ] 
}
chris-wood commented 4 years ago

This should now be resolved. Closing.