Conversation
3a24044 to
81d925f
Compare
Several users have reported segfaults when starting up profanity which has OMEMO support, but OMEMO is not set up yet. @StefanKropp has been able to reproduce this and tracked it down to `_load_identity()` calling `omemo_known_devices_keyfile_save()`. The latter then calls `save_keyfile()` which calls `g_key_file_save_to_file()`. This can then fail if one of the first two strings is NULL and won't set the `error` on return. In its error handling `save_keyfile()` unconditionally dereferences `error` which leads to the segfault. Fix this and also go through the entire codebase and verify that the usage of `GError` is done correctly. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
So one can easily see if there are two instances running, if they are logging to the same file. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
When setting up OMEMO for the first time via `/omemo gen` one had to reconnect in order to make OMEMO work. This is fixed now. Fixes: 5b6b513 ("Fix OMEMO keyfile loading") Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
With that command one can see the modifications of the runtime configuration vs. the saved configuration. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
| } | ||
|
|
||
| static GList* | ||
| _g_strv_to_glist(gchar** in, gsize length) |
There was a problem hiding this comment.
Would it maybe make sense to move this to the common file?
There was a problem hiding this comment.
Maybe.
While looking at it, I realized that we're using both GList and GSList in a mixed fashion, but I couldn't find a reason why we couldn't limit this to one of them. Since we're traversing lists only in forward direction I guess we could always use GSList. But I'd leave that up to another PR, so I'll keep it local to the accounts module for now.
|
Wow! These are a lot of good improvements! Thanks! I didn't run it but code looks good. |
First let's make clear we're currently using SHA1 & untangle the tlscerts API from fingerprint specific details. Related-to: #2068 Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This also reads the certificate SHA256 and pubkey fingerprint from libstrophe, but doesn't store it persistently yet. Related-to: #2068 Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
If a cert has a SHA256 use that one and only use SHA1 as fallback. Closes: #2068 Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
... as much as possible ... subject and issuer details excluded. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* add can simply do a `memcpy()`. * in remove we don't have to put the array in a list in order to put it back into an array again. Also we don't have to `strdup()` each entry, which leads to even less allocations. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* use `gchar` instead of `char`. * improve situations when strings must be duplicated or can pass ownership. * encapsulate the X.509 name details into a struct. * prevent memory leaks if a name detail is contained multiple times. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* Add new TLS policy `direct` as a replacement for `legacy`. * Document that `/[command]?` prints the help of a command. * Add option to get help via `/command help`. * Fix `my-prof.supp` generation and tests for out-of-source builds. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* Less `GString`. * Don't `g_free()` a `strdup()`'ed string. * Don't lookup the `console` window X times, but only once. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
If one is running multiple instances of profanity, the behavior of the accounts module was to constantly overwrite the accounts file with the version that was on-disk of the first instance of profanity started. This is changed now in order to only write what we modified, we keep a copy of the accounts file and when "saving" we re-read accounts from disk and only update the values of the modified account. This is not 100% fool proof if one modifies the same account from two different instances, but still better than before. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* No need to call `g_key_file_has_key()` before calling a getter. * Add helper to convert `gcharv` to `glist`. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
No need to have a fixed list of keys, we can simply copy all existing ones. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
e.g. if one connects with an account for the first time and the server returns a `see-other-host` error. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
Related-to: #2078 Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
|
This PR added a nested function |
|
See discussion in: |
Please check commit messages for details.