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
This commit is contained in:
Tim-Philipp Müller 2012-01-23 13:15:46 +00:00
parent a224ffb971
commit a476d529d2
2 changed files with 14 additions and 9 deletions

View file

@ -1883,7 +1883,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
static void static void
gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass) gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass)
{ {
gchar *str; gchar *cname;
rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin); rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin);
rtpbin->priv->bin_lock = g_mutex_new (); 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; rtpbin->use_pipeline_clock = DEFAULT_USE_PIPELINE_CLOCK;
/* some default SDES entries */ /* 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", rtpbin->sdes = gst_structure_new ("application/x-rtp-source-sdes",
"cname", G_TYPE_STRING, str, "cname", G_TYPE_STRING, cname, "tool", G_TYPE_STRING, "GStreamer", NULL);
"name", G_TYPE_STRING, g_get_real_name (), g_free (cname);
"tool", G_TYPE_STRING, "GStreamer", NULL);
g_free (str);
} }
static void static void

View file

@ -556,12 +556,19 @@ rtp_session_init (RTPSession * sess)
sess->mtu = DEFAULT_RTCP_MTU; sess->mtu = DEFAULT_RTCP_MTU;
/* some default SDES entries */ /* 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); rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_CNAME, str);
g_free (str); g_free (str);
rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME, #if 0
g_get_real_name ()); /* 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"); rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_TOOL, "GStreamer");
sess->first_rtcp = TRUE; sess->first_rtcp = TRUE;