From: Aki Tuomi Date: Tue, 9 Aug 2022 08:20:10 +0000 (+0300) Subject: auth: Import ssl_ja3_hash field X-Git-Tag: 2.4.0~3263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70baf893e85222d071d21cdd5ead546a905d477a;p=thirdparty%2Fdovecot%2Fcore.git auth: Import ssl_ja3_hash field --- diff --git a/src/auth/auth-request-fields.c b/src/auth/auth-request-fields.c index b69e64f2fb..295d046159 100644 --- a/src/auth/auth-request-fields.c +++ b/src/auth/auth-request-fields.c @@ -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); diff --git a/src/auth/auth-request.h b/src/auth/auth-request.h index 63cc0dfaa6..dbd223ddd7 100644 --- a/src/auth/auth-request.h +++ b/src/auth/auth-request.h @@ -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. */