annotate plugins/ssl/ssl-nss.c @ 7993:495d3dbb4e84

[gaim-migrate @ 8670] Evil whitespace. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 04 Jan 2004 22:04:24 +0000
parents 01e6e9c46a01
children 8d012c803411
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
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 gaim_ssl_close((GaimSslConnection *)gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 return;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 }
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 socket_opt.option = PR_SockOpt_Nonblocking;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 socket_opt.value.non_blocking = PR_FALSE;
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 PR_SetSocketOption(nss_data->fd, &socket_opt);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 nss_data->in = SSL_ImportFD(NULL, nss_data->fd);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185 if (nss_data->in == NULL)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187 gaim_debug_error("nss", "nss_data->in == NUL!\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189 gaim_ssl_close((GaimSslConnection *)gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
191 return;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
193
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194 SSL_OptionSet(nss_data->in, SSL_SECURITY, PR_TRUE);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 SSL_OptionSet(nss_data->in, SSL_HANDSHAKE_AS_CLIENT, PR_TRUE);
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 SSL_AuthCertificateHook(nss_data->in,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 (SSLAuthCertificate)ssl_auth_cert,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 (void *)CERT_GetDefaultCertDB());
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 SSL_BadCertHook(nss_data->in, (SSLBadCertHandler)ssl_bad_cert, NULL);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201
7157
fae7cfe975fd [gaim-migrate @ 7724]
Nathan Walp <nwalp@pidgin.im>
parents: 7053
diff changeset
202 if(gsc->host)
fae7cfe975fd [gaim-migrate @ 7724]
Nathan Walp <nwalp@pidgin.im>
parents: 7053
diff changeset
203 SSL_SetURL(nss_data->in, gsc->host);
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
205 SSL_ResetHandshake(nss_data->in, PR_FALSE);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207 if (SSL_ForceHandshake(nss_data->in))
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 gaim_debug_error("nss", "Handshake failed\n");
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 7157
diff changeset
211 if (gsc->error_cb != NULL)
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 7157
diff changeset
212 gsc->error_cb(gsc, GAIM_SSL_HANDSHAKE_FAILED, data);
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 7157
diff changeset
213
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
214 gaim_ssl_close(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
216 return;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
217 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
218
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
219 gsc->connect_cb(gsc->connect_cb_data, gsc, cond);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
220 }
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 static void
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
223 ssl_nss_close(GaimSslConnection *gsc)
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 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
226
7467
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
227 if(!nss_data)
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
228 return;
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
229
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
230 if (nss_data->in) PR_Close(nss_data->in);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
231 /* if (nss_data->fd) PR_Close(nss_data->fd); */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
232
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
233 g_free(nss_data);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
234 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
235
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
236 static size_t
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
237 ssl_nss_read(GaimSslConnection *gsc, void *data, size_t len)
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 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
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 return PR_Read(nss_data->in, data, len);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
242 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
243
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
244 static size_t
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
245 ssl_nss_write(GaimSslConnection *gsc, const void *data, size_t len)
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 GaimSslNssData *nss_data = GAIM_SSL_NSS_DATA(gsc);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
248
7467
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
249 if(!nss_data)
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
250 return 0;
f9ed27be344e [gaim-migrate @ 8080]
Nathan Walp <nwalp@pidgin.im>
parents: 7274
diff changeset
251
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
252 return PR_Write(nss_data->in, data, len);
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
253 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
254
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
255 static GaimSslOps ssl_ops =
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
256 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
257 ssl_nss_init,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
258 ssl_nss_uninit,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
259 ssl_nss_connect_cb,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
260 ssl_nss_close,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
261 ssl_nss_read,
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262 ssl_nss_write
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
263 };
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
265 #endif /* HAVE_NSS */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
266
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
268 static gboolean
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269 plugin_load(GaimPlugin *plugin)
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 #ifdef HAVE_NSS
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
272 if (!gaim_ssl_get_ops()) {
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
273 gaim_ssl_set_ops(&ssl_ops);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
274 }
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
275
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
276 /* 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
277 ssl_nss_init_nss();
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
278 return TRUE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
279 #else
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
280 return FALSE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
281 #endif
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
282 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
283
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
284 static gboolean
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
285 plugin_unload(GaimPlugin *plugin)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
286 {
7053
9d8e56c66854 [gaim-migrate @ 7616]
Nathan Walp <nwalp@pidgin.im>
parents: 7051
diff changeset
287 #ifdef HAVE_NSS
7862
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
288 if (gaim_ssl_get_ops() == &ssl_ops) {
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
289 gaim_ssl_set_ops(NULL);
01e6e9c46a01 [gaim-migrate @ 8516]
Luke Schierer <lschiere@pidgin.im>
parents: 7467
diff changeset
290 }
7050
e8cd8827fb25 [gaim-migrate @ 7613]
Christian Hammond <chipx86@chipx86.com>
parents: 7029
diff changeset
291 #endif
e8cd8827fb25 [gaim-migrate @ 7613]
Christian Hammond <chipx86@chipx86.com>
parents: 7029
diff changeset
292
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
293 return TRUE;
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
294 }
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
295
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
296 static GaimPluginInfo info =
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
297 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
298 2, /**< api_version */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
299 GAIM_PLUGIN_STANDARD, /**< type */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
300 NULL, /**< ui_requirement */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
301 GAIM_PLUGIN_FLAG_INVISIBLE, /**< flags */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
302 NULL, /**< dependencies */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
303 GAIM_PRIORITY_DEFAULT, /**< priority */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
304
7029
b80c7a4dfae7 [gaim-migrate @ 7592]
Christian Hammond <chipx86@chipx86.com>
parents: 7028
diff changeset
305 SSL_NSS_PLUGIN_ID, /**< id */
7016
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
306 N_("NSS"), /**< name */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
307 VERSION, /**< version */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
308 /** summary */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
309 N_("Provides SSL support through Mozilla NSS."),
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
310 /** description */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
311 N_("Provides SSL support through Mozilla NSS."),
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
312 "Christian Hammond <chipx86@gnupdate.org>",
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
313 GAIM_WEBSITE, /**< homepage */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
314
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
315 plugin_load, /**< load */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
316 plugin_unload, /**< unload */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
317 NULL, /**< destroy */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
318
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
319 NULL, /**< ui_info */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
320 NULL /**< extra_info */
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
321 };
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
322
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
323 static void
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
324 init_plugin(GaimPlugin *plugin)
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
325 {
aa619031193b [gaim-migrate @ 7579]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
326 }
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 GAIM_INIT_PLUGIN(ssl_nss, init_plugin, info)