c6bc85ccd5
Merge upstream/master into merge/upstream-full
...
CI Code / Check coding style (pull_request) Failing after 5s
CI Code / Check spelling (pull_request) Successful in 15s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m29s
CI Code / Linux (arch) (pull_request) Successful in 4m38s
CI Code / Linux (debian) (pull_request) Successful in 7m25s
CI Code / Code Coverage (pull_request) Successful in 7m28s
Merge profanity-im/profanity master (373 commits) into cproof fork.
Source changes (manual merge):
- src/command/: cmd_defs, cmd_funcs, cmd_ac — upstream g_new0, auto_gchar,
launch_editor callback; keep our XEP-0308 LMC, force-encryption, CWE-134
- src/config/: preferences, tlscerts, account — upstream UNIQUE dedup,
dynamic pad capacity; keep our db_history_result_t, scroll logic
- src/database.*: upstream g_new0 memory mgmt; keep our return types,
add null-check fix for msg->timestamp
- src/omemo/, src/pgp/: upstream _gpgme_key_get_email, g_new0;
keep our replace_id in omemo_on_message_send
- src/tools/: editor, http_upload, bookmark_ignore — upstream launch_editor
callback API
- src/ui/: console, window, chatwin, mucwin, inputwin, buffer —
upstream win_warn_needed/sent dedup, PAD_MIN_HEIGHT dynamic pads;
keep our y_start_pos scroll, _truncate_datetime_suffix
- src/xmpp/: message, stanza, presence, roster_list, iq, session —
upstream connection_get_available_resources; keep our LMC stanza logic
- src/common.c: fix format-security (cons_show)
Build system:
- Makefile.am: updated test paths to subdirectory structure, added
test_cmd_ac, test_forced_encryption
- Restored autotools files deleted by upstream meson migration:
bootstrap.sh, autogen.sh, m4/ax_valgrind_check.m4, configure-debug
Tests:
- Unit tests: upstream unittests.c base + our forced_encryption tests
(482 passed, 0 failed across all 4 configurations)
- Functional tests: kept our version (93 passed, 0 failed)
upstream version requires stbbr_for_xmlns not yet in our stabber fork
- Updated test stubs: stub_xmpp.c, stub_omemo.c from upstream
Compile fixes:
- src/common.c: cons_show(errmsg) -> cons_show("%s", errmsg)
- src/database.c: null-check before msg->timestamp access
- src/ui/console.c: size_t -> (int) cast for format width
- src/config/tlscerts.c: %d -> %zu for size_t
2026-04-11 13:34:51 +03:00
Michael Vetter
798edce22a
chore: Move to SPDX license header
2026-03-09 12:55:37 +01:00
Michael Vetter
e1fd2a1cf6
refactor: replace calloc with g_new0 for struct allocations
...
Migrate structure allocations from calloc to glibs g_new0 macro to
improve type safety and memory robustness.
* Type Safety: The macro takes the type name directly, ensuring the
allocated size always matches the pointer type.
* Static Analysis: It guarantees a non-NULL return by aborting on
failure, which silences -fanalyzer warnings regarding potential NULL
pointer dereferences.
* Readability: Removes redundant sizeof() calls and is the glib way
2026-02-26 19:06:39 +01:00
Michael Vetter
6e61383e97
cleanup: Adapt loop counter to proper type
...
Fixing a couple of -Wsign-compare warnings.
2026-02-20 16:02:27 +01:00
Steffen Jaeckel
a50cd3a885
Refactor tlscerts.
...
* 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 >
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
1ede01ed8c
Free in reverse order.
...
... as much as possible ... subject and issuer details excluded.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu >
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
a07cff8a99
Use the stronger certificate fingerprint.
...
If a cert has a SHA256 use that one and only use SHA1 as fallback.
Closes: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu >
2025-11-23 12:47:06 +01:00
Steffen Jaeckel
0acea8d0d2
Retrieve and save new fingerprints from libstrophe.
...
This also reads the certificate SHA256 and pubkey fingerprint from
libstrophe, but doesn't store it persistently yet.
Related-to: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu >
2025-11-23 12:46:51 +01:00
Steffen Jaeckel
4dcaa839fa
Prepare to use SHA256 fingerprints of certs.
...
First let's make clear we're currently using SHA1 & untangle the tlscerts
API from fingerprint specific details.
Related-to: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu >
2025-11-23 12:46:29 +01:00
Steffen Jaeckel
7f5ae430af
Fix more memleaks
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu >
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
c5a131ee46
Introduce our own shutdown callback mechanism.
...
Instead of adding stuff to `_shutdown()`, we can now register a shutdown
routine from the respective `init()` function of our modules.
This also has the advantage, that we're sure they're called in reverse
order from how the initialization happened.
I didn't simply use `atexit()` because POSIX says that the number of
possible callbacks is limited (min 32) and I was not sure whether
we will maybe extend this number at one point.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu >
2025-03-07 21:09:16 +01:00
Steffen Jaeckel
ca2df180d8
Introduce a shared implementation for keyfile loading
...
Instead of copy&pasting the same code over again, use a common
implementation.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de >
2023-09-04 09:59:09 +02:00
John Hernandez
865a056315
Cleanup g_strfreev() to auto_gcharv
...
Include some additional minor cleanups
2023-07-13 17:05:07 +02:00
John Hernandez
8304ac86ff
g_free() to auto_gfree, introduce auto_guchar
...
Fix 11 potential mem leaks in theme.c
2023-07-13 17:04:59 +02:00
John Hernandez
7f3fca2bd0
Cleanup: gchar as gchar instead of char
...
Use gchar instead of char in most of the cases where gchar is intended.
Reason: improve compatibility and stability. Issue #1819
Minor refactoring.
2023-05-04 16:15:09 +02:00
Steffen Jaeckel
b28ac09368
a tad more const-correctness
...
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de >
2022-03-22 11:44:00 +01:00
Steffen Jaeckel
7c56eac154
also store PEM in TLSCertificate
...
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de >
2022-03-22 11:34:23 +01:00
Steffen Jaeckel
44e65f3089
simplify code
...
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de >
2022-03-21 14:33:30 +01:00
Michael Vetter
057c9ad776
Add config.h in files were it was missing
...
Related to https://github.com/profanity-im/profanity/issues/1512
2021-03-26 19:54:22 +01:00
Michael Vetter
35aecd425f
Declare counter var inside loop
...
We require c99/gnu99 anyways.
2020-11-09 11:33:33 +01: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
Paul Fariello
a52e3ea1d8
Add context to autocomplete_with_func and use it for omemo trust command
...
Fix #1068
2020-01-31 10:07:08 +01:00
Michael Vetter
46fd7150e5
Add vim modeline
2019-11-13 12:11:05 +01:00
Michael Vetter
706af9a900
Update copyright to include 2019
2019-01-22 11:31:45 +01:00
James Booth
250e972b7a
Update copyright
2018-01-21 15:00:02 +00:00
James Booth
6b830277a6
Allow previous autocompletion with shift tab
2017-04-01 00:27:11 +01:00
James Booth
68a3daedb9
Update Copyright
2017-01-28 17:24:22 +00:00
James Booth
a3a73cf003
Move all filepath handling to files.c
2016-07-24 21:49:35 +01:00
James Booth
29452f8f1b
Move xgd functions
2016-07-24 17:12:09 +01:00
James Booth
ef942bd27a
Add config/files.c
2016-07-24 16:22:15 +01:00
James Booth
0a57c4de78
Tidy headers
2016-07-24 15:43:51 +01:00
James Booth
e8fc80f5c1
Update GPL link in headers
2016-07-24 01:14:49 +01:00
James Booth
1ddfa47313
Free TLSCertificate memory
2016-03-08 20:25:36 +00:00
James Booth
e53e94f1e2
Updated copyright
2016-02-14 22:54:46 +00:00
James Booth
bf1e7efe23
Show summary of trusted certificates, add /tls cert <fingerprint>
...
fixes #676
2015-11-22 19:53:41 +00:00
James Booth
0bb596e14a
Added extra fields to TLSCertificate
2015-11-10 22:46:48 +00:00
James Booth
9302188a32
Show current TLS certificate
2015-11-10 01:20:40 +00:00
James Booth
4cbfb88814
Store current TLS certificate fingerpint in memory for reconnect
2015-11-09 20:57:26 +00:00
James Booth
5863292094
Applied coding style to src/config/
2015-10-25 22:23:38 +00:00
James Booth
bd42185389
Added /tls revoke
2015-09-24 01:06:53 +01:00
James Booth
6f8ad6b8e8
Added /tls trusted command
2015-09-24 00:43:41 +01:00
James Booth
d96e68ea53
Save trusted certificates to tlscerts file with more information
2015-09-24 00:18:18 +01:00