commit 84084ee
grunfink
·
2026-06-24 09:33:11 +0000 UTC
parent fbc30d1
Added and additional keyId check in 'Move'.
1 files changed,
+7,
-2
+7,
-2
1@@ -3145,7 +3145,7 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
2 const char *atto = get_atto(obj_data);
3
4 if (atto == NULL)
5- snac_log(snac, xs_fmt("ignored 'Delete' for object with attributedTo %s", object));
6+ snac_log(snac, xs_fmt("ignored 'Delete' for object without attributedTo %s", object));
7 else
8 if (strcmp(atto, key_id) != 0) {
9 snac_log(snac, xs_fmt("Delete: mismatched attributedTo '%s' and key '%s'", atto, key_id));
10@@ -3195,7 +3195,12 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
11 const char *old_account = xs_dict_get(msg, "object");
12 const char *new_account = xs_dict_get(msg, "target");
13
14- if (!xs_is_null(old_account) && !xs_is_null(new_account)) {
15+ if (xs_is_string(old_account) && xs_is_string(new_account)) {
16+ if (strcmp(old_account, key_id) != 0) {
17+ snac_log(snac, xs_fmt("'Move': mismatched old_account %s and key %s", old_account, key_id));
18+ srv_archive_error("move_old_account_key_mismatch", "bad keyId", old_account, msg);
19+ }
20+ else
21 if (following_check(snac, old_account)) {
22 xs *n_actor = NULL;
23