You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some investigation into the padding feature of Merlin, I'm not sure if it is acting in the intended fashion. It seems that each message is always given a padding the exact size specified by the user at build time for PaddingMax. So if it is 4096, then every message has a padding of 4096 bytes, not a random number of UP TO 4096 bytes. We also discussed randomizing the PaddingMax on the server side during OPAQUE so it isn't a hard coded value.
The text was updated successfully, but these errors were encountered:
The SendMerlinMessage function in clients/http/http.go updates the message's padding with m.Padding = core.RandStringBytesMaskImprSrc(client.PaddingMax). However, this function returns a random string of characters but with a fixed length. The issue is confirmed as the intent is to include a random string of random length, not a fixed length. I'll work on implementing a fix and pushing it.
Seems like wrapping the PaddingMax value in rand.Intn should do the trick (e.g., m.Padding = core.RandStringBytesMaskImprSrc(rand.Intn(client.PaddingMax)). rand.Seed(time.Now().UTC().UnixNano()) is called when the agent starts.
On the server side, padding is added to return messages in the Handler function of pkg/server/jobs/jobs.go.
During the OPAQUE process, the server does not know the agent's configuration and will not be able to determine its PaddingMax value, so a hard coded value of 4096 is used.
I'll update both places with the same solution of wrapping the values in rand.Intn.
After some investigation into the padding feature of Merlin, I'm not sure if it is acting in the intended fashion. It seems that each message is always given a padding the exact size specified by the user at build time for PaddingMax. So if it is 4096, then every message has a padding of 4096 bytes, not a random number of UP TO 4096 bytes. We also discussed randomizing the PaddingMax on the server side during OPAQUE so it isn't a hard coded value.
The text was updated successfully, but these errors were encountered: