chore: Update imap-codec
. #246
No reviewers
Labels
No Label
IMAP
JMAP
Maildir
Retired
User Experience
User Interface
bsd
bug
contacts
currently worked on
documentation
duplicate
easy
enhancement
help wanted
invalid
linux-gnu
macos
mbox
notmuch
question
security
wishlist
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: meli/meli#246
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "duesee/meli:master"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Syncing with latest developments in imap-codec :-)
chore: Update `imap-codec`.to wip: chore: Update `imap-codec`.deef64a94c
to9d51b6bd52
wip: chore: Update `imap-codec`.to chore: Update `imap-codec`.@ -531,3 +528,3 @@
timeout(self.timeout, async {
let command = {
let tag = Tag::unchecked(format!("M{}", self.cmd_id));
let tag = Tag::unvalidated(format!("M{}", self.cmd_id));
(Not a PR review, just a thought)
Now that commands are code-ified instead of handrolled, the
M
prefix could go away and have an e.g. ascending integer counter instead. That wayTag
could be an enum:and a
Tag::new_int(self.cmd_id)
method would need no allocation. ItsWrite
/Display
impl could also use a hex representation to avoid base ten taking lots of ascii digits to be represented in the outgoing command. What do you think?I like the idea but am not sure how we would integrate this. In imap-codec, I try to maintain the "inverse property" of parse/unparse.
So, when we create a
Tag::Int(42)
, serialize it into e.g.2A
, and deserialize it again, we really want to obtainTag::Int(42)
again (and notTag::String("2A")
). So the only way to archive this would be to correctly "partition" the tag space and agree on a special representation. But this would rather not be generic enough.So, maybe the better way would be not to use
Command
but onlyCommandBody
and handle tags manually. Or, makeTag
generic, a trait, or something other.I would propose that we postpone this for now until we are sure that it helps us a lot :-)
Some more thoughts: Ideally, we want to have random tags. The reason is that during our research on STARTTLS we experienced that many attacks would have been much harder to execute with random tags. Of course, this is STARTTLS-specific, but it can increase the difficulty for other kinds of attacks and is a good security in-depth measure.
Given that, we still could use numbers. With a bit less entropy per byte but it doesn't really matter.
You're right, I didn't think of the de-serialization! It was just a thought I had at that moment.
LGTM, not merging now because I don't know if you mean this to be WIP or ready so let me know!
I requested a review to signal that this is ready to be reviewed. I can keep doing so in the future :-)