]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Import ssl_ja3_hash field
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 9 Aug 2022 08:20:10 +0000 (11:20 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 20 Dec 2022 09:28:27 +0000 (11:28 +0200)
src/auth/auth-request-fields.c
src/auth/auth-request.h

index b69e64f2fb6081e17be32d13545704b29ab19dea..295d046159bb966e677d1607b123888cc4dcd9a3 100644 (file)
@@ -78,6 +78,8 @@ void auth_request_export(struct auth_request *request, string_t *dest)
                str_printfa(dest, "\tlport=%u", fields->local_port);
        if (fields->remote_port != 0)
                str_printfa(dest, "\trport=%u", fields->remote_port);
+       if (fields->ssl_ja3_hash != NULL)
+               auth_str_add_keyvalue(dest, "ssl_j3_hash", fields->ssl_ja3_hash);
        if (fields->real_local_ip.family != 0) {
                auth_str_add_keyvalue(dest, "real_lip",
                                      net_ip2addr(&fields->real_local_ip));
@@ -163,6 +165,8 @@ bool auth_request_import_info(struct auth_request *request,
                event_add_int(event, "remote_port", fields->remote_port);
                if (fields->real_remote_port == 0)
                        auth_request_import_info(request, "real_rport", value);
+       } else if (strcmp(key, "ssl_ja3_hash") == 0) {
+               fields->ssl_ja3_hash = p_strdup(request->pool, value);
        } else if (strcmp(key, "real_lip") == 0) {
                if (net_addr2ip(value, &fields->real_local_ip) == 0)
                        event_add_str(event, "real_local_ip", value);
index 63cc0dfaa6e9d2db9f4c6426b4eb3120b8a60b71..dbd223ddd731619606681e8113a51359355c2e22 100644 (file)
@@ -63,6 +63,7 @@ struct auth_request_fields {
        const char *service, *mech_name, *session_id, *local_name, *client_id;
        struct ip_addr local_ip, remote_ip, real_local_ip, real_remote_ip;
        in_port_t local_port, remote_port, real_local_port, real_remote_port;
+       const char *ssl_ja3_hash;
 
         /* extra_fields are returned in authentication reply. Fields prefixed
            with "userdb_" are automatically placed to userdb_reply instead. */