From a476d529d2f2d6a2c4a7008387de7cd427581b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 23 Jan 2012 13:15:46 +0000 Subject: [PATCH] rtpmanager: don't reveal the user's username, hostname or real name by default Send a randomly made-up user@hostname as CNAME and don't send a NAME at all by default. https://bugzilla.gnome.org/show_bug.cgi?id=668320 --- gst/rtpmanager/gstrtpbin.c | 10 ++++------ gst/rtpmanager/rtpsession.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index 621c85b49e..0b2167dd17 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -1883,7 +1883,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) static void gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass) { - gchar *str; + gchar *cname; rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin); rtpbin->priv->bin_lock = g_mutex_new (); @@ -1901,12 +1901,10 @@ gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass) rtpbin->use_pipeline_clock = DEFAULT_USE_PIPELINE_CLOCK; /* some default SDES entries */ - str = g_strdup_printf ("%s@%s", g_get_user_name (), g_get_host_name ()); + cname = g_strdup_printf ("user%u@x-%u.net", g_random_int (), g_random_int ()); rtpbin->sdes = gst_structure_new ("application/x-rtp-source-sdes", - "cname", G_TYPE_STRING, str, - "name", G_TYPE_STRING, g_get_real_name (), - "tool", G_TYPE_STRING, "GStreamer", NULL); - g_free (str); + "cname", G_TYPE_STRING, cname, "tool", G_TYPE_STRING, "GStreamer", NULL); + g_free (cname); } static void diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index eed96ac5b7..72849a7ae8 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -556,12 +556,19 @@ rtp_session_init (RTPSession * sess) sess->mtu = DEFAULT_RTCP_MTU; /* some default SDES entries */ - str = g_strdup_printf ("%s@%s", g_get_user_name (), g_get_host_name ()); + + /* we do not want to leak details like the username or hostname here */ + str = g_strdup_printf ("user%u@x-%u.net", g_random_int (), g_random_int ()); rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_CNAME, str); g_free (str); - rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME, - g_get_real_name ()); +#if 0 + /* we do not want to leak the user's real name here */ + str = g_strdup_printf ("Anon%u", g_random_int ()); + rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME, str); + g_free (str); +#endif + rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_TOOL, "GStreamer"); sess->first_rtcp = TRUE;