annotate plugins/ssl/ssl-nss.c @ 9468:4d0b0d5485e6

[gaim-migrate @ 10293] (23:23:20) datallah: LSchiere: if you are up to it, this: http://www.butfer.com/gaim-patches/gtkconv_send_file.patch, makes it so that you can send files to people from the conversation window. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 07 Jul 2004 03:24:37 +0000
parents d7b8eb1f0a18
children fec83fb0b6a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file ssl-nss.c Mozilla NSS SSL plugin.
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * gaim
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 *
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * (at your option) any later version.
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 *
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * GNU General Public License for more details.
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 *
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 #include "internal.h"
7051
e885d4963a68 [gaim-migrate @ 7614]
Christian Hammond <chipx86@chipx86.com>
parents: 7050
diff changeset
23 #include "debug.h"
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #include "plugin.h"
7051
e885d4963a68 [gaim-migrate @ 7614]
Christian Hammond <chipx86@chipx86.com>
parents: 7050
diff changeset
25 #include "sslconn.h"
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26
7029
b80c7a4dfae7 [gaim-migrate @ 7592]
Christian Hammond <chipx86@chipx86.com>
parents: 7028
diff changeset
27 #define SSL_NSS_PLUGIN_ID "ssl-nss"
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 #ifdef HAVE_NSS
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 #include <nspr.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 #include <private/pprio.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 #include <nss.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 #include <pk11func.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 #include <prio.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 #include <secerr.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 #include <secmod.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 #include <ssl.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 #include <sslerr.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 #include <sslproto.h>
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 typedef struct
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 PRFileDesc *fd;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 PRFileDesc *in;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 } GaimSslNssData;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 #define GAIM_SSL_NSS_DATA(gsc) ((GaimSslNssData *)gsc->private_data)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 static const PRIOMethods *_nss_methods = NULL;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 static PRDescIdentity _identity;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53
7993
495d3dbb4e84 [gaim-migrate @ 8670]
Christian Hammond <chipx86@chipx86.com>
parents: 7862
diff changeset
54 static void
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
55 ssl_nss_init_nss(void)
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
56 {
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
57 PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
58 NSS_NoDB_Init(NULL);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
59
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
60 /* TODO: Fix this so autoconf does the work trying to find this lib. */
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
61 SECMOD_AddNewModule("Builtins",
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
62 #ifndef _WIN32
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
63 LIBDIR "/libnssckbi.so",
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
64 #else
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
65 "nssckbi.dll",
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
66 #endif
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
67 0, 0);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
68 NSS_SetDomesticPolicy();
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
69
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
70 _identity = PR_GetUniqueIdentity("Gaim");
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
71 _nss_methods = PR_GetDefaultIOMethods();
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
72 }
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
73
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 static SECStatus
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 ssl_auth_cert(void *arg, PRFileDesc *socket, PRBool checksig,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 PRBool is_server)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 return SECSuccess;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 #if 0
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 CERTCertificate *cert;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 void *pinArg;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 SECStatus status;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 cert = SSL_PeerCertificate(socket);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 pinArg = SSL_RevealPinArg(socket);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 status = CERT_VerifyCertNow((CERTCertDBHandle *)arg, cert, checksig,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 certUsageSSLClient, pinArg);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 if (status != SECSuccess) {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 gaim_debug_error("nss", "CERT_VerifyCertNow failed\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 CERT_DestroyCertificate(cert);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 return status;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 CERT_DestroyCertificate(cert);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 return SECSuccess;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 #endif
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 static SECStatus
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 ssl_bad_cert(void *arg, PRFileDesc *socket)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 SECStatus status = SECFailure;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 PRErrorCode err;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 if (arg == NULL)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 return status;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 *(PRErrorCode *)arg = err = PORT_GetError();
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 switch (err)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 case SEC_ERROR_INVALID_AVA:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116 case SEC_ERROR_INVALID_TIME:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 case SEC_ERROR_BAD_SIGNATURE:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 case SEC_ERROR_EXPIRED_CERTIFICATE:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 case SEC_ERROR_UNKNOWN_ISSUER:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 case SEC_ERROR_UNTRUSTED_CERT:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 case SEC_ERROR_CERT_VALID:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 case SEC_ERROR_CRL_EXPIRED:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 case SEC_ERROR_CRL_BAD_SIGNATURE:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 case SEC_ERROR_EXTENSION_VALUE_INVALID:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 case SEC_ERROR_CA_CERT_INVALID:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 case SEC_ERROR_CERT_USAGES_INVALID:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 case SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 status = SECSuccess;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 break;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 default:
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 status = SECFailure;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 break;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 gaim_debug_error("nss", "Bad certificate: %d\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 return status;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 static gboolean
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 ssl_nss_init(void)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 {
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
145 return TRUE;
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148 static void
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 ssl_nss_uninit(void)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 PR_Cleanup();
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 _nss_methods = NULL;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 static void
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 ssl_nss_connect_cb(gpointer data, gint source, GaimInputCondition cond)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 GaimSslConnection *gsc = (GaimSslConnection *)data;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 GaimSslNssData *nss_data = g_new0(GaimSslNssData, 1);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161 PRSocketOptionData socket_opt;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163 gsc->private_data = nss_data;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 gsc->fd = source;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167 nss_data->fd = PR_ImportTCPSocket(gsc->fd);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
168
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169 if (nss_data->fd == NULL)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 gaim_debug_error("nss", "nss_data->fd == NULL!\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172
8362
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8360
diff changeset
173 if (gsc->error_cb != NULL)
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8360
diff changeset
174 gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data);
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8360
diff changeset
175
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 gaim_ssl_close((GaimSslConnection *)gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 return;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181 socket_opt.option = PR_SockOpt_Nonblocking;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182 socket_opt.value.non_blocking = PR_FALSE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184 PR_SetSocketOption(nss_data->fd, &socket_opt);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 nss_data->in = SSL_ImportFD(NULL, nss_data->fd);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188 if (nss_data->in == NULL)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190 gaim_debug_error("nss", "nss_data->in == NUL!\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
191
8362
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8360
diff changeset
192 if (gsc->error_cb != NULL)
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8360
diff changeset
193 gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data);
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8360
diff changeset
194
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 gaim_ssl_close((GaimSslConnection *)gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 return;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 SSL_OptionSet(nss_data->in, SSL_SECURITY, PR_TRUE);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201 SSL_OptionSet(nss_data->in, SSL_HANDSHAKE_AS_CLIENT, PR_TRUE);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
202
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
203 SSL_AuthCertificateHook(nss_data->in,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204 (SSLAuthCertificate)ssl_auth_cert,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
205 (void *)CERT_GetDefaultCertDB());
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206 SSL_BadCertHook(nss_data->in, (SSLBadCertHandler)ssl_bad_cert, NULL);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207
7157
fae7cfe975fd [gaim-migrate @ 7724]
Nathan Walp <nwalp@pidgin.im>
parents: 7053
diff changeset
208 if(gsc->host)
fae7cfe975fd [gaim-migrate @ 7724]
Nathan Walp <nwalp@pidgin.im>
parents: 7053
diff changeset
209 SSL_SetURL(nss_data->in, gsc->host);
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211 SSL_ResetHandshake(nss_data->in, PR_FALSE);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
212
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
213 if (SSL_ForceHandshake(nss_data->in))
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
214 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215 gaim_debug_error("nss", "Handshake failed\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
216
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 7157
diff changeset
217 if (gsc->error_cb != NULL)
8360
8d012c803411 [gaim-migrate @ 9084]
Nathan Walp <nwalp@pidgin.im>
parents: 7993
diff changeset
218 gsc->error_cb(gsc, GAIM_SSL_HANDSHAKE_FAILED, gsc->connect_cb_data);
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 7157
diff changeset
219
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
220 gaim_ssl_close(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
221
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
222 return;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
223 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
224
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
225 gsc->connect_cb(gsc->connect_cb_data, gsc, cond);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
226 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
227
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228 static void
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
229 ssl_nss_close(GaimSslConnection *gsc)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
230 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
231 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
232
7467
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
233 if(!nss_data)
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
234 return;
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
235
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
236 if (nss_data->in) PR_Close(nss_data->in);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
237 /* if (nss_data->fd) PR_Close(nss_data->fd); */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
238
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
239 g_free(nss_data);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
240 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
241
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
242 static size_t
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
243 ssl_nss_read(GaimSslConnection *gsc, void *data, size_t len)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
244 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
245 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
246
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
247 return PR_Read(nss_data->in, data, len);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
248 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
249
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
250 static size_t
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
251 ssl_nss_write(GaimSslConnection *gsc, const void *data, size_t len)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
252 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
253 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
254
7467
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
255 if(!nss_data)
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
256 return 0;
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
257
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
258 return PR_Write(nss_data->in, data, len);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
259 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
260
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
261 static GaimSslOps ssl_ops =
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
263 ssl_nss_init,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264 ssl_nss_uninit,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
265 ssl_nss_connect_cb,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
266 ssl_nss_close,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267 ssl_nss_read,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
268 ssl_nss_write
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269 };
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
270
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
271 #endif /* HAVE_NSS */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
272
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
273
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
274 static gboolean
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
275 plugin_load(GaimPlugin *plugin)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
276 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
277 #ifdef HAVE_NSS
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
278 if (!gaim_ssl_get_ops()) {
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
279 gaim_ssl_set_ops(&ssl_ops);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
280 }
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
281
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
282 /* Init NSS now, so others can use it even if sslconn never does */
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
283 ssl_nss_init_nss();
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
284 return TRUE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
285 #else
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
286 return FALSE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
287 #endif
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
288 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
289
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
290 static gboolean
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
291 plugin_unload(GaimPlugin *plugin)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
292 {
7053
9d8e56c66854 [gaim-migrate @ 7616]
Nathan Walp <nwalp@pidgin.im>
parents: 7051
diff changeset
293 #ifdef HAVE_NSS
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
294 if (gaim_ssl_get_ops() == &ssl_ops) {
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
295 gaim_ssl_set_ops(NULL);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
296 }
7050
e8cd8827fb25 [gaim-migrate @ 7613]
Christian Hammond <chipx86@chipx86.com>
parents: 7029
diff changeset
297 #endif
e8cd8827fb25 [gaim-migrate @ 7613]
Christian Hammond <chipx86@chipx86.com>
parents: 7029
diff changeset
298
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
299 return TRUE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
300 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
301
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
302 static GaimPluginInfo info =
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
303 {
8749
d7b8eb1f0a18 [gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents: 8362
diff changeset
304 GAIM_PLUGIN_API_VERSION, /**< api_version */
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
305 GAIM_PLUGIN_STANDARD, /**< type */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
306 NULL, /**< ui_requirement */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
307 GAIM_PLUGIN_FLAG_INVISIBLE, /**< flags */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
308 NULL, /**< dependencies */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
309 GAIM_PRIORITY_DEFAULT, /**< priority */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
310
7029
b80c7a4dfae7 [gaim-migrate @ 7592]
Christian Hammond <chipx86@chipx86.com>
parents: 7028
diff changeset
311 SSL_NSS_PLUGIN_ID, /**< id */
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
312 N_("NSS"), /**< name */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
313 VERSION, /**< version */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
314 /** summary */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
315 N_("Provides SSL support through Mozilla NSS."),
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
316 /** description */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
317 N_("Provides SSL support through Mozilla NSS."),
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
318 "Christian Hammond <chipx86@gnupdate.org>",
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
319 GAIM_WEBSITE, /**< homepage */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
320
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
321 plugin_load, /**< load */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
322 plugin_unload, /**< unload */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
323 NULL, /**< destroy */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
324
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
325 NULL, /**< ui_info */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
326 NULL /**< extra_info */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
327 };
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
328
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
329 static void
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
330 init_plugin(GaimPlugin *plugin)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
331 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
332 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
333
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
334 GAIM_INIT_PLUGIN(ssl_nss, init_plugin, info)