diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-02-10 15:25:29 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-02-19 00:16:44 +0100 |
commit | f94041d2d433597c0b05c0ded76ddc3e58cffaac (patch) | |
tree | 5d97b24acafc6d5c15aab2d50666f7b23c424549 | |
parent | 053bed3f0c49c4b765cdf726b1824b89a8411f50 (diff) |
gtk: add private spice_session_get_{password,host,cert_subject}()
-rw-r--r-- | gtk/spice-channel.c | 12 | ||||
-rw-r--r-- | gtk/spice-session-priv.h | 3 | ||||
-rw-r--r-- | gtk/spice-session.c | 27 |
3 files changed, 33 insertions, 9 deletions
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index 08bcc2c..499a3ca 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -1422,20 +1422,14 @@ reconnect: { - gchar *hostname, *subject; guint8 *pubkey; guint pubkey_len; - g_object_get(c->session, - "host", &hostname, - "cert-subject", &subject, NULL); spice_session_get_pubkey(c->session, &pubkey, &pubkey_len); c->sslverify = spice_openssl_verify_new(c->ssl, verify, - hostname, - (char*)pubkey, pubkey_len, - subject); - g_free(hostname); - g_free(subject); + spice_session_get_host(c->session), + (char*)pubkey, pubkey_len, + spice_session_get_cert_subject(c->session)); } ssl_reconnect: diff --git a/gtk/spice-session-priv.h b/gtk/spice-session-priv.h index d88b508..8ca3ebb 100644 --- a/gtk/spice-session-priv.h +++ b/gtk/spice-session-priv.h @@ -45,6 +45,9 @@ void spice_session_set_migration_state(SpiceSession *session, SpiceSessionMigrat void spice_session_set_port(SpiceSession *session, int port, gboolean tls); void spice_session_get_pubkey(SpiceSession *session, guint8 **pubkey, guint *size); guint spice_session_get_verify(SpiceSession *session); +const gchar* spice_session_get_password(SpiceSession *session); +const gchar* spice_session_get_host(SpiceSession *session); +const gchar* spice_session_get_cert_subject(SpiceSession *session); G_END_DECLS diff --git a/gtk/spice-session.c b/gtk/spice-session.c index 0bc0195..c3dceed 100644 --- a/gtk/spice-session.c +++ b/gtk/spice-session.c @@ -1065,3 +1065,30 @@ void spice_session_set_migration_state(SpiceSession *session, SpiceSessionMigrat s->migration_state = state; g_object_notify(G_OBJECT(session), "migration-state"); } + +G_GNUC_INTERNAL +const gchar* spice_session_get_password(SpiceSession *session) +{ + spice_session *s = SPICE_SESSION_GET_PRIVATE(session); + + g_return_val_if_fail(s != NULL, NULL); + return s->password; +} + +G_GNUC_INTERNAL +const gchar* spice_session_get_host(SpiceSession *session) +{ + spice_session *s = SPICE_SESSION_GET_PRIVATE(session); + + g_return_val_if_fail(s != NULL, NULL); + return s->host; +} + +G_GNUC_INTERNAL +const gchar* spice_session_get_cert_subject(SpiceSession *session) +{ + spice_session *s = SPICE_SESSION_GET_PRIVATE(session); + + g_return_val_if_fail(s != NULL, NULL); + return s->cert_subject; +} |