diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2006-09-28 15:42:12 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2006-09-28 15:42:12 +0000 |
commit | e69eb2d74f70e0af260078c86d3fec60c75cd333 (patch) | |
tree | f059b95e12c1b44e57118612031cae58352d2783 | |
parent | 9d4c5f5c593a8cb8fdba6fe2992ee60d0888014a (diff) | |
download | telepathy-gabble-e69eb2d74f70e0af260078c86d3fec60c75cd333.tar.gz |
Stop trying to make IVC mechanism generic. Rename authidentity to mac, auth-secret to btid, and drop auth-type
20060928154212-53eee-5825e936058ad7f5d0509611eb0d824c0ad10037.gz
-rw-r--r-- | src/gabble-connection-manager.c | 30 | ||||
-rw-r--r-- | src/gabble-connection.c | 66 | ||||
-rw-r--r-- | src/gabble-register.c | 24 |
3 files changed, 46 insertions, 74 deletions
diff --git a/src/gabble-connection-manager.c b/src/gabble-connection-manager.c index 5498274bf..e1c7b1f03 100644 --- a/src/gabble-connection-manager.c +++ b/src/gabble-connection-manager.c @@ -162,9 +162,8 @@ struct _GabbleParams { guint stun_port; gboolean ignore_ssl_errors; gchar *alias; - gchar *auth_identity; - gchar *auth_secret; - gchar *auth_type; + gchar *auth_mac; + gchar *auth_btid; }; enum { @@ -184,9 +183,8 @@ enum { JABBER_PARAM_STUN_PORT, JABBER_PARAM_IGNORE_SSL_ERRORS, JABBER_PARAM_ALIAS, - JABBER_PARAM_AUTH_IDENTITY, - JABBER_PARAM_AUTH_SECRET, - JABBER_PARAM_AUTH_TYPE, + JABBER_PARAM_AUTH_MAC, + JABBER_PARAM_AUTH_BTID, LAST_JABBER_PARAM }; @@ -207,9 +205,8 @@ static const GabbleParamSpec jabber_params[] = { { "stun-port", DBUS_TYPE_UINT16_AS_STRING, G_TYPE_UINT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GINT_TO_POINTER(GABBLE_PARAMS_DEFAULT_STUN_PORT), G_STRUCT_OFFSET(GabbleParams, stun_port) }, { "ignore-ssl-errors", DBUS_TYPE_BOOLEAN_AS_STRING, G_TYPE_BOOLEAN, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GINT_TO_POINTER(FALSE), G_STRUCT_OFFSET(GabbleParams, ignore_ssl_errors) }, { "alias", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET(GabbleParams, alias) }, - { "auth-identity", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET(GabbleParams, auth_identity) }, - { "auth-secret", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET(GabbleParams, auth_secret) }, - { "auth-type", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET(GabbleParams, auth_type) }, + { "mac", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET(GabbleParams, auth_mac) }, + { "btid", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET(GabbleParams, auth_btid) }, { NULL, NULL, 0, 0, NULL, 0 } }; @@ -425,9 +422,8 @@ free_params (GabbleParams *params) g_free (params->fallback_conference_server); g_free (params->stun_server); g_free (params->alias); - g_free (params->auth_identity); - g_free (params->auth_secret); - g_free (params->auth_type); + g_free (params->auth_mac); + g_free (params->auth_btid); } /** @@ -647,12 +643,10 @@ gabble_connection_manager_request_connection (GabbleConnectionManager *self, JABBER_PARAM_IGNORE_SSL_ERRORS, params.ignore_ssl_errors); SET_PROPERTY_IF_PARAM_SET ("alias", JABBER_PARAM_ALIAS, params.alias); - SET_PROPERTY_IF_PARAM_SET ("auth-identity", JABBER_PARAM_AUTH_IDENTITY, - params.auth_identity); - SET_PROPERTY_IF_PARAM_SET ("auth-secret", JABBER_PARAM_AUTH_SECRET, - params.auth_secret); - SET_PROPERTY_IF_PARAM_SET ("auth-type", JABBER_PARAM_AUTH_TYPE, - params.auth_type); + SET_PROPERTY_IF_PARAM_SET ("auth-mac", JABBER_PARAM_AUTH_MAC, + params.auth_mac); + SET_PROPERTY_IF_PARAM_SET ("auth-btid", JABBER_PARAM_AUTH_BTID, + params.auth_btid); /* split up account into username, stream-server and resource */ if (!_gabble_connection_set_properties_from_account (conn, params.account, error)) diff --git a/src/gabble-connection.c b/src/gabble-connection.c index 5461dddfc..8b73f7dfd 100644 --- a/src/gabble-connection.c +++ b/src/gabble-connection.c @@ -167,9 +167,8 @@ enum PROP_STUN_RELAY_PASSWORD, PROP_IGNORE_SSL_ERRORS, PROP_ALIAS, - PROP_AUTH_IDENTITY, - PROP_AUTH_SECRET, - PROP_AUTH_TYPE, + PROP_AUTH_MAC, + PROP_AUTH_BTID, LAST_PROPERTY }; @@ -241,9 +240,8 @@ struct _GabbleConnectionPrivate gchar *resource; gint8 priority; gchar *alias; - gchar *auth_identity; - gchar *auth_secret; - gchar *auth_type; + gchar *auth_mac; + gchar *auth_btid; /* reference to conference server name */ const gchar *conference_server; @@ -423,14 +421,11 @@ gabble_connection_get_property (GObject *object, case PROP_ALIAS: g_value_set_string (value, priv->alias); break; - case PROP_AUTH_IDENTITY: - g_value_set_string (value, priv->auth_identity); + case PROP_AUTH_MAC: + g_value_set_string (value, priv->auth_mac); break; - case PROP_AUTH_SECRET: - g_value_set_string (value, priv->auth_secret); - break; - case PROP_AUTH_TYPE: - g_value_set_string (value, priv->auth_type); + case PROP_AUTH_BTID: + g_value_set_string (value, priv->auth_btid); break; default: param_name = g_param_spec_get_name (pspec); @@ -522,17 +517,13 @@ gabble_connection_set_property (GObject *object, g_free (priv->alias); priv->alias = g_value_dup_string (value); break; - case PROP_AUTH_IDENTITY: - g_free (priv->auth_identity); - priv->auth_identity = g_value_dup_string (value); - break; - case PROP_AUTH_SECRET: - g_free (priv->auth_secret); - priv->auth_secret = g_value_dup_string (value); + case PROP_AUTH_MAC: + g_free (priv->auth_mac); + priv->auth_mac = g_value_dup_string (value); break; - case PROP_AUTH_TYPE: - g_free (priv->auth_type); - priv->auth_type = g_value_dup_string (value); + case PROP_AUTH_BTID: + g_free (priv->auth_btid); + priv->auth_btid = g_value_dup_string (value); break; default: param_name = g_param_spec_get_name (pspec); @@ -798,36 +789,23 @@ gabble_connection_class_init (GabbleConnectionClass *gabble_connection_class) G_PARAM_STATIC_BLURB); g_object_class_install_property (object_class, PROP_ALIAS, param_spec); - param_spec = g_param_spec_string ("auth-identity", - "Identifier for custom auth schemes", - "A username, public key, or whatever " - "for use in custom auth schemes", - NULL, - G_PARAM_READWRITE | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_AUTH_IDENTITY, param_spec); - - param_spec = g_param_spec_string ("auth-secret", - "Secret for custom auth schemes", - "A password or other secret " - "corresponding to auth-identity", + param_spec = g_param_spec_string ("auth-mac", + "MAC for authorization", + "MAC for authorization", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_AUTH_SECRET, param_spec); + g_object_class_install_property (object_class, PROP_AUTH_MAC, param_spec); - param_spec = g_param_spec_string ("auth-type", - "Custom auth mechanism", - "A name identifying the mechanism " - "auth-identity and auth-secret are to " - "be used with", + param_spec = g_param_spec_string ("auth-btid", + "BTID for authorization", + "BTID for authorization", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB); - g_object_class_install_property (object_class, PROP_AUTH_TYPE, param_spec); + g_object_class_install_property (object_class, PROP_AUTH_BTID, param_spec); /* signal definitions */ diff --git a/src/gabble-register.c b/src/gabble-register.c index 668bd0f07..4b93806eb 100644 --- a/src/gabble-register.c +++ b/src/gabble-register.c @@ -249,7 +249,7 @@ nokia_iv_get_reply_cb (GabbleConnection *conn, const gchar *err_msg = NULL; LmMessage *msg = NULL; LmMessageNode *query_node, *challenge_node; - gchar *auth_identity, *auth_secret; + gchar *auth_mac, *auth_btid; const gchar *challenge; gchar response[33]; gint i; @@ -287,13 +287,13 @@ nokia_iv_get_reply_cb (GabbleConnection *conn, lm_message_node_set_attribute (query_node, "xmlns", NS_NOKIA_IV); g_object_get (priv->conn, - "auth-identity", &auth_identity, - "auth-secret", &auth_secret, + "auth-mac", &auth_mac, + "auth-btid", &auth_btid, NULL); md5_init(&calculator); - md5_append(&calculator, (const md5_byte_t *)auth_secret, - strlen(auth_secret)); + md5_append(&calculator, (const md5_byte_t *)auth_btid, + strlen(auth_btid)); md5_append(&calculator, (const md5_byte_t *)":", 1); md5_append(&calculator, (const md5_byte_t *)challenge, strlen(challenge)); md5_finish(&calculator, digest); @@ -305,11 +305,11 @@ nokia_iv_get_reply_cb (GabbleConnection *conn, } response[32] = '\0'; - lm_message_node_add_child (query_node, "mac", auth_identity); + lm_message_node_add_child (query_node, "mac", auth_mac); lm_message_node_add_child (query_node, "response", response); - g_free (auth_identity); - g_free (auth_secret); + g_free (auth_mac); + g_free (auth_btid); if (!_gabble_connection_send_with_reply (priv->conn, msg, nokia_iv_set_reply_cb, @@ -382,11 +382,11 @@ set_reply_cb (GabbleConnection *conn, } else { - gchar *auth_type; + gchar *auth_mac; - g_object_get (priv->conn, "auth-type", &auth_type, NULL); + g_object_get (priv->conn, "auth-mac", &auth_mac, NULL); - if (auth_type && !g_strdiff(auth_type, AUTH_TYPE_NOKIA_IV)) + if (auth_mac) { LmMessage *msg; LmMessageNode *node; @@ -414,7 +414,7 @@ set_reply_cb (GabbleConnection *conn, necessary */ g_signal_emit (object, signals[FINISHED], 0, TRUE, -1, NULL); } - g_free(auth_type); + g_free(auth_mac); } return LM_HANDLER_RESULT_REMOVE_MESSAGE; |