Skip to content

Sending to untrusted identity contact: exit code #828

@exquo

Description

@exquo

Sending a message to an "untrusted identity" contact (e.g. one who reinstalled signal), signal-cli returns a 0 ("success") exit code:

signal-cli send -m 'message text' +1234567890; echo $?

Failed to send (some) messages:
+1234567890: Untrusted Identity for "+1234567890"
1630000000000
0

I assume the exit code should be non-zero (failure), since the message is not actually sent.

When sending a message through a dbus API, it does return non-zero code (2):

signal-cli -u +0987654321 --output=json daemon &
signal-cli --dbus send -m 'msg text' +1234567890; echo $?

Untrusted identity: Untrusted identity: 1630000000000
Failed to send message:
Untrusted Identity for "+1234567890"
2

Although, in the man page, "Exit codes" section it says

4: Sending failed due to untrusted key

When sending to a group, one of whose members has reinstalled signal, it makes sense if the return is "success", as per #348 and 06e93b8. This is indeed what happens with non-dbus execution:

signal-cli send -g 'txs4no+ebx<...GROUP_ID..>iVebi74gv+riVoBi7o=' -m 'non-dbus send to group'; echo $? 

Failed to send (some) messages:
txs4no+ebx<...GROUP_ID..>iVebi74gv+riVoBi7o=: Untrusted Identity for "+1234567890"
1630000000000
0

But running the group send through dbus results in non-zero exit code:

signal-cli -u +0987654321 --output=json daemon &
signal-cli --dbus send -g 'txs4no+ebx<...GROUP_ID..>iVebi74gv+riVoBi7o=' -m 'dbus send to group'; echo $?

Failure: Failure: 1630000000000
Failed to send (some) messages:
txs4no+ebx<...GROUP_ID..>iVebi74gv+riVoBi7o=: Untrusted Identity for "+1234567890"
2

To sum up:

  • Expected result:
    • sending to untrusted individual (either through dbus or CLI) -> exit code non-zero
    • sending to a group with untrusted individual (either through dbus or CLI) -> exit code zero.
  • Actual result:
    • sending through CLI (to either individual or group) -> exit code zero
    • sending through dbus (to either individual or group) -> exit code non-zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions