comparison src/ssl-nss.c @ 6764:6d0d4e9149b9

[gaim-migrate @ 7296] well, jabber.org is being a pain in the moment, as is my server. but this seems to work, so here it is. Jabber SSL support. Make sure you set the port to 5223 and check the "Use SSL" checkbox in the account editor. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 06 Sep 2003 16:04:41 +0000
parents f9efcba2d02f
children efef00de3f09
comparison
equal deleted inserted replaced
6763:362e60e7c265 6764:6d0d4e9149b9
115 gaim_debug_error("nss", "Bad certificate: %d\n"); 115 gaim_debug_error("nss", "Bad certificate: %d\n");
116 116
117 return status; 117 return status;
118 } 118 }
119 119
120 static void
121 input_func(gpointer data, gint source, GaimInputCondition cond)
122 {
123 GaimSslConnection *gsc = (GaimSslConnection *)data;
124 #if 0
125 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
126 char *cp, *ip, *sp;
127 int op, kp0, kp1;
128 int result;
129
130 result = SSL_SecurityStatus(nss_data->in, &op, &cp, &kp0,
131 &kp1, &ip, &sp);
132
133 gaim_debug_misc("nss",
134 "bulk cipher %s, %d secret key bits, %d key bits, status: %d\n"
135 "subject DN: %s\n"
136 "issuer DN: %s\n",
137 cp, kp1, kp0, op, sp, ip);
138
139 PR_Free(cp);
140 PR_Free(ip);
141 PR_Free(sp);
142 #endif
143
144 gsc->input_func(gsc->user_data, gsc, cond);
145 }
146
147 static gboolean 120 static gboolean
148 ssl_nss_init(void) 121 ssl_nss_init(void)
149 { 122 {
150 PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1); 123 PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
151 NSS_NoDB_Init(NULL); 124 NSS_NoDB_Init(NULL);
225 gaim_ssl_close(gsc); 198 gaim_ssl_close(gsc);
226 199
227 return; 200 return;
228 } 201 }
229 202
230 gsc->inpa = gaim_input_add(gsc->fd, 203 gsc->connect_cb(gsc->connect_cb_data, gsc, cond);
231 GAIM_INPUT_READ | GAIM_INPUT_WRITE, 204 }
232 input_func, gsc); 205
206 static void
207 ssl_nss_recv_cb(gpointer data, gint source, GaimInputCondition cond)
208 {
209 GaimSslConnection *gsc = data;
210 gsc->recv_cb(gsc->recv_cb_data, gsc, cond);
233 } 211 }
234 212
235 static void 213 static void
236 ssl_nss_close(GaimSslConnection *gsc) 214 ssl_nss_close(GaimSslConnection *gsc)
237 { 215 {
262 static GaimSslOps ssl_ops = 240 static GaimSslOps ssl_ops =
263 { 241 {
264 ssl_nss_init, 242 ssl_nss_init,
265 ssl_nss_uninit, 243 ssl_nss_uninit,
266 ssl_nss_connect_cb, 244 ssl_nss_connect_cb,
245 ssl_nss_recv_cb,
267 ssl_nss_close, 246 ssl_nss_close,
268 ssl_nss_read, 247 ssl_nss_read,
269 ssl_nss_write 248 ssl_nss_write
270 }; 249 };
271 250