1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00
Commit Graph

195 Commits

Author SHA1 Message Date
Steffen Jaeckel
9cf78e59d5 auto-format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:01:28 +01:00
Steffen Jaeckel
7f646e3668 use new libstrophe API
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2021-10-27 22:45:44 +02:00
Steffen Jaeckel
ffc0b49ab1 first step to remove libmesode
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2021-10-27 22:45:44 +02:00
Michael Vetter
46c8245af9 Format new register code correctly 2021-10-13 21:32:44 +02:00
Michael Vetter
e0e45b7b24
Merge pull request #1574 from binex-dsk/master
Add in-band account registration
Fix https://github.com/profanity-im/profanity/issues/199
2021-10-13 21:19:22 +02:00
swirl
0653200965 registration: memory leaks, error checking 2021-10-13 15:02:05 -04:00
swirl
feaa770444 fixed crashes when server doesn't support registration 2021-10-10 15:43:14 -04:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
swirl
87d2c95c87 registration: remove auth param and excess functions 2021-08-17 14:09:48 -04:00
Michael Vetter
f53b4353fd REGISTRATION FIXED 2021-08-17 14:09:48 -04:00
swirl
8a6f1b52d7 progress on fixing registration
doesnt segfault on register, but aborts when you type after registering

need to find a way to disconnect later
2021-08-17 14:09:48 -04:00
swirl
4d3f26154e hacky fix(?) for register
very bad and spaghetti will fix later
2021-08-17 14:09:48 -04:00
swirl
2cc354b6ae fixed some bugs, added some more
- Added JABBER_RAW_CONNECT[ING/ED] connection states
- Added cl_ev_connect_raw and session_connect_raw to conform to normal
connection functions
- Fixed SIGABRT during registration
- Added a check in cmd_register to ensure it's actually connected before
registering--but this will always fail atm
2021-08-17 14:09:48 -04:00
swirl
d9366a26d6 initial register command test 2021-08-17 14:09:48 -04:00
Michael Vetter
8c50b63e56 Goodbye beautiful IDs
It was a great ride!

IDs look instead of
`TE5BTDc2ZTc3YTMwZGU3MDgzMzllOTliNGExNjVmMjZkMTY1ZmUyZGEyNTUxMjVmODBkMmQzOGMxYWI2ZjAxNzdiM2Q=`
more like `7HcnNSoO1MVvb0p9a9e293152922853e910b8b1a65bb26e225a0568` now.

Regards https://github.com/profanity-im/profanity/issues/1520

We still has our identifier into it to filter MUC reflected messages.

profident maybe should be changed to be longer or be generated upon each
start.
2021-04-14 22:47:58 +02:00
Thorben Günther
b0aea2bcff
Add command to change password of logged in user 2021-03-11 17:42:53 +01:00
Stefan
637c2c2d62 Logging [CONNECTION] 2021-03-09 17:47:22 +01:00
Michael Vetter
0a9200e268 Require libstrophe/libmesode 0.10.0 2020-09-30 19:30:40 +02:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
Michael Vetter
914c6752dd Fix reading/writing linked files
"base" was not really base but the filename :-)

Fix https://github.com/profanity-im/profanity/issues/1362
2020-06-13 15:02:43 +02:00
Dmitry Podgorny
424918c5ed Make legacy auth optional
Some systems don't provide recent libstrophe releases. When older
version of libstrophe is detected, don't build legacy auth support.

To simplify this patch, report about unsupported legacy auth and
keep commands option as is.
2020-06-11 02:51:07 +03:00
Dmitry Podgorny
ac410445af Add option for legacy authentication
New options:
  /connect <account> [auth default|legacy]
  /account <account> set auth default|legacy

Fixes #1236.
2020-06-05 11:37:51 +03:00
Michael Vetter
de8975c008 Add and use connection_get_barejid()
Instead of connection_get_fulljid() and then creating a Jid from it.
2020-05-25 13:04:19 +02:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
6b75848f96 Display ownership of connection_get_profanity_identifier 2019-10-22 12:04:16 +02:00
Michael Vetter
ba18752405 Use UUID in origin-id and id
Let's use UUID to have a more random string then just 10 alphanumeric
values.
2019-10-22 11:10:37 +02:00
Michael Vetter
963ab841b4 Set prof_ident to NULL after free
This caused the bug mentioned in the PR comment:

```
It seems with the changes done here we get a crash in: src/xmpp/message.c message_handlers_init() when looking up handlers: ProfMessageHandler *handler = g_hash_table_lookup(pubsub_event_handlers, curr->data);.

Steps to reproduce:

    open Profanity and connect
    /autoping set 10
    /autoping timeout 10
    stop WiFi/connection
    wait for Lost connection
    restart wifi
    /connect
```
2019-10-21 09:50:13 +02:00
Michael Vetter
8a5932b251 Rename _calculate_identifier to _compute_identifier 2019-10-20 00:01:19 +02:00
Michael Vetter
db4b55eee0 Rename random_bytes to profanity_instance_id 2019-10-19 23:27:19 +02:00
Michael Vetter
2a4d1b8410 Free hmac and msgid 2019-10-19 08:18:37 +02:00
Michael Vetter
f190d2c5f2 Free prof_identifier in case of reconnect
Bedore we assign it new.
2019-10-19 07:40:59 +02:00
Michael Vetter
4d7a496ae2 Change origin-id/id algo
Hash twice.
Use HMAC SHA256 from glib.
2019-10-18 16:12:26 +02:00
Michael Vetter
430b2eaa0d Log incoming MUC messages if origin-id sais they dont come from us
Regards https://github.com/profanity-im/profanity/issues/1201
2019-10-18 10:40:24 +02:00
Michael Vetter
53640f6e97 Remove prefix from stanza id
We sent `prof_prefix_uuid` as id. Where the prefix was also optional.
We don't need this at all.
2019-10-17 15:40:40 +02:00
Michael Vetter
827af999b7 Change algo for connection_create_stanza_id() 2019-10-17 15:32:46 +02:00
Michael Vetter
8f5d1751b2 Change connection_create_stanza_id()
To return identifier and uuid together.
We can remove the prefix later on.
2019-10-17 09:23:11 +02:00
Michael Vetter
708bc83870 Calculate identifier upon connect
This will be needed so that we can later detect if messages (origin-in)
was sent by us.

Regards https://github.com/profanity-im/profanity/issues/1207
2019-10-16 15:53:28 +02:00
Michael Vetter
ee0541a262 Rename identification file 2019-10-16 10:54:05 +02:00
Michael Vetter
46f0304f89 Use random string for random-bytes identifier
And rename `instance` to `identifier`.

Regards https://github.com/profanity-im/profanity/issues/1207
2019-10-16 10:45:41 +02:00
Michael Vetter
1e09a055ca Create random-bytes file
So far only with dummy value.
We will need an identifier that we can hash together with a message ID
and put in as the origin-id.
So when we receive message we can unsplit it and see if it was sent from
this client.

Regards https://github.com/profanity-im/profanity/issues/1207
2019-10-16 10:17:34 +02:00
Paul Fariello
b110da9a92 Fix various OMEMO memleaks 2019-07-10 17:32:23 +02:00
Dmitry Podgorny
c2d3c3e416 xmpp/connection: fix #1103
When connection is lost, profanity tries to disconnect what leads
to an infinite loop. The loop occurs, because connection_disconnet()
runs xmpp_run_once() separately and waits for XMPP_CONN_DISCONNECT
event. But it doesn't happen, because the connection object is
disconnected.

As solution, don't disconnect after XMPP_CONN_DISCONNECT is received.
Also, don't free libstrophe objects while the event loops executes,
because the event loop continues using objects after callbacks quit.
2019-06-01 20:21:46 +03:00
Paul Fariello
4ad6904216 Wait for discovery end to publish omemo devicelist and bundle
Add sv_ev_connection_features_received for that purpose
2019-04-10 17:23:46 +02:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
Dmitry Podgorny
7f65aaa9a2 Add option to trust server's certificate
New tls policy "trust" added to /connect and /account. With the policy
TLS connection is established even with invalid certificate. Note, that
trust policy forces TLS connection and it fails when server doesn't
support TLS.

Examples:
 /connect <jid> tls trust
 /account <name> set tls trust
2018-11-06 14:09:02 +02:00
Michael Vetter
6d80700329 Move ID generation to xmpp folder
create_unique_id() was changed to use UUIDs instead of a counter in the
last commit. Since now it depends on connection_create_uuid() which is
in the xmpp subfolder the function should also be moved there.

Renamed it to connection_create_stanza_id() and moved it to
src/xmpp/connection.c.

Discussion happened in https://github.com/boothj5/profanity/pull/1010
2018-08-30 11:17:04 +02:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
Dmitry Podgorny
1012e11283 Legacy SSL support
Add "legacy" tls policy to /account and /connect commands. When this
policy is specified the connection is connected with
XMPP_CONN_LEGACY_SSL flag. Notice, legacy SSL and STARTTLS are not
compatible and user has to know when exactly the new policy should be
used.

To enable it, run one of the next commands:
  /connect <jid> tls legacy [server <host>]
  /account <name> set tls legacy

Notice, there is no SRV record for legacy SSL. Therefore, you may need
"server" property to connect successfully. Refer to configuration
provided by your server.
2017-06-24 21:33:30 +03:00