Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 10464:61ef9a964574
[gaim-migrate @ 11739]
SecurID support for AIM. This is untested. I'll try to get it tested
in the next few days. I'm backporting this to oldstatus. If you don't
know what SecurID, google around for it.
Basically it's an optional additional authentication method that
AOL members can opt for (and pay an extra fee). After entering your
password, you are prompted for a 6 digit number from a digit readout/
keychain-sized LCD screen. This number is pseudo-random and changes
every 60 seconds.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 02 Jan 2005 07:20:38 +0000 |
parents | ad9258716144 |
children | 133a33699e19 |
comparison
equal
deleted
inserted
replaced
10463:9bed28273ec7 | 10464:61ef9a964574 |
---|---|
217 static int msgerrreasonlen = 25; | 217 static int msgerrreasonlen = 25; |
218 | 218 |
219 /* All the libfaim->gaim callback functions */ | 219 /* All the libfaim->gaim callback functions */ |
220 static int gaim_parse_auth_resp (aim_session_t *, aim_frame_t *, ...); | 220 static int gaim_parse_auth_resp (aim_session_t *, aim_frame_t *, ...); |
221 static int gaim_parse_login (aim_session_t *, aim_frame_t *, ...); | 221 static int gaim_parse_login (aim_session_t *, aim_frame_t *, ...); |
222 static int gaim_parse_auth_securid_request(aim_session_t *, aim_frame_t *, ...); | |
222 static int gaim_handle_redirect (aim_session_t *, aim_frame_t *, ...); | 223 static int gaim_handle_redirect (aim_session_t *, aim_frame_t *, ...); |
223 static int gaim_info_change (aim_session_t *, aim_frame_t *, ...); | 224 static int gaim_info_change (aim_session_t *, aim_frame_t *, ...); |
224 static int gaim_account_confirm (aim_session_t *, aim_frame_t *, ...); | 225 static int gaim_account_confirm (aim_session_t *, aim_frame_t *, ...); |
225 static int gaim_parse_oncoming (aim_session_t *, aim_frame_t *, ...); | 226 static int gaim_parse_oncoming (aim_session_t *, aim_frame_t *, ...); |
226 static int gaim_parse_offgoing (aim_session_t *, aim_frame_t *, ...); | 227 static int gaim_parse_offgoing (aim_session_t *, aim_frame_t *, ...); |
1781 gaim_connection_error(gc, _("Unable to login to AIM")); | 1782 gaim_connection_error(gc, _("Unable to login to AIM")); |
1782 return; | 1783 return; |
1783 } | 1784 } |
1784 | 1785 |
1785 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_connerr, 0); | 1786 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_connerr, 0); |
1787 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); | |
1786 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); | 1788 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); |
1787 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); | 1789 aim_conn_addhandler(sess, conn, AIM_CB_FAM_ATH, AIM_CB_ATH_SECURID_REQUEST, gaim_parse_auth_securid_request, 0); |
1788 | 1790 |
1789 conn->status |= AIM_CONN_STATUS_INPROGRESS; | 1791 conn->status |= AIM_CONN_STATUS_INPROGRESS; |
1790 if (gaim_proxy_connect(account, gaim_account_get_string(account, "server", FAIM_LOGIN_SERVER), | 1792 if (gaim_proxy_connect(account, gaim_account_get_string(account, "server", FAIM_LOGIN_SERVER), |
1791 gaim_account_get_int(account, "port", FAIM_LOGIN_PORT), | 1793 gaim_account_get_int(account, "port", FAIM_LOGIN_PORT), |
1792 oscar_login_connect, gc) < 0) { | 1794 oscar_login_connect, gc) < 0) { |
2333 aim_sendcookie(sess, bosconn, info->cookielen, info->cookie); | 2335 aim_sendcookie(sess, bosconn, info->cookielen, info->cookie); |
2334 gaim_input_remove(gc->inpa); | 2336 gaim_input_remove(gc->inpa); |
2335 | 2337 |
2336 gaim_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); | 2338 gaim_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); |
2337 ck[3] = 0x64; | 2339 ck[3] = 0x64; |
2340 | |
2341 return 1; | |
2342 } | |
2343 | |
2344 static void | |
2345 gaim_parse_auth_securid_request_yes_cb(gpointer user_data, const char *msg) | |
2346 { | |
2347 GaimConnection *gc = user_data; | |
2348 OscarData *od = gc->proto_data; | |
2349 aim_session_t *sess = od->sess; | |
2350 | |
2351 aim_auth_securid_send(sess, msg); | |
2352 } | |
2353 | |
2354 static void | |
2355 gaim_parse_auth_securid_request_no_cb(gpointer user_data, const char *value) | |
2356 { | |
2357 GaimConnection *gc = user_data; | |
2358 OscarData *od = gc->proto_data; | |
2359 | |
2360 /* Disconnect */ | |
2361 gc->wants_to_die = TRUE; | |
2362 gaim_connection_error(gc, _("The SecurID key entered is invalid.")); | |
2363 od->killme = TRUE; | |
2364 } | |
2365 | |
2366 static int | |
2367 gaim_parse_auth_securid_request(aim_session_t *sess, aim_frame_t *fr, ...) | |
2368 { | |
2369 GaimConnection *gc = sess->aux_data; | |
2370 GaimAccount *account = gaim_connection_get_account(gc); | |
2371 gchar *primary; | |
2372 | |
2373 gaim_debug_info("oscar", "Got SecurID request\n"); | |
2374 | |
2375 primary = g_strdup_printf("Enter the SecurID key for %s.", gaim_account_get_username(account)); | |
2376 gaim_request_input(gc, NULL, _("Enter SecurID"), primary, | |
2377 _("Enter the 6 digit number from the digital display."), | |
2378 FALSE, FALSE, NULL, | |
2379 _("OK"), G_CALLBACK(gaim_parse_auth_securid_request_yes_cb), | |
2380 _("Cancel"), G_CALLBACK(gaim_parse_auth_securid_request_no_cb), | |
2381 gc); | |
2382 g_free(primary); | |
2338 | 2383 |
2339 return 1; | 2384 return 1; |
2340 } | 2385 } |
2341 | 2386 |
2342 /* XXX - Should use gaim_url_fetch for the below stuff */ | 2387 /* XXX - Should use gaim_url_fetch for the below stuff */ |