Skip to content

fix: determine whether a message is self-sent by cryptographic signature#8058

Merged
hpk42 merged 1 commit intomainfrom
hpk/fix_self_determination
Apr 1, 2026
Merged

fix: determine whether a message is self-sent by cryptographic signature#8058
hpk42 merged 1 commit intomainfrom
hpk/fix_self_determination

Conversation

@hpk42
Copy link
Copy Markdown
Contributor

@hpk42 hpk42 commented Mar 30, 2026

multiple devices can temporarly have different sets of self addresses, and still need to properly recognize incoming versus outgoing messages. Disclaimer: some LLM tooling was initially involved but i went over everything by hand.

@hpk42 hpk42 force-pushed the hpk/fix_self_determination branch from f5f63e9 to c1b7fa4 Compare March 30, 2026 21:18
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
@hpk42
Copy link
Copy Markdown
Contributor Author

hpk42 commented Mar 31, 2026

thanks, i think i addressed all review comments. If there is anything more, i am fine if you directly commit any further changes on top and merge.

@hpk42 hpk42 force-pushed the hpk/fix_self_determination branch 2 times, most recently from 6968123 to d97e3ee Compare March 31, 2026 07:02
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/receive_imf/receive_imf_tests.rs Outdated
Comment thread src/mimeparser.rs
}
if !is_encrypted {
signatures.clear();
}
Copy link
Copy Markdown
Collaborator

@iequidoo iequidoo Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to remove this if !is_encrypted ... block (see another comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is pre-existing code not touched by this PR, though, and i'd like to keep it this way.

Comment thread src/mimeparser.rs
// so we determine 'incoming' flag by From-address
from_is_not_self_addr
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let signature = signature.filter(|_| is_encrypted);

so that the fix also works for singed-only messages. Not very important though, but this doesn't add more code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as we don't have signed-only messages as a design goal, let's please not discuss or motivate changes according to it. Even if core would do signed-only messages, there is no concept whatsoever in the UIs about it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, it's just weird that signatures are checked after clearing and i was thinking about shared usage when the key is imported into e.g. TB. But ok, this is not a valid scenario anymore, let's not discuss it

…ature. multiple devices can temporarly have different sets of self addresses, and still need to properly recognize incoming versus outgoing messages. Disclaimer: some LLM tooling was initially involved but i went over everything by hand, and also addressed review comments.
@hpk42 hpk42 force-pushed the hpk/fix_self_determination branch from d97e3ee to dcb5b82 Compare April 1, 2026 12:25
@hpk42 hpk42 enabled auto-merge (rebase) April 1, 2026 12:34
@hpk42 hpk42 merged commit 28cce5e into main Apr 1, 2026
54 of 56 checks passed
@hpk42 hpk42 deleted the hpk/fix_self_determination branch April 1, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants