]> jfr.im git - solanum.git/blame - extensions/extb_ssl.c
add help for `chm_regmsg`
[solanum.git] / extensions / extb_ssl.c
CommitLineData
dbbe26fa 1/* SSL extban type: matches ssl users */
0e51998b
VY
2
3#include "stdinc.h"
4#include "modules.h"
5#include "client.h"
6#include "ircd.h"
7
eeabf33a
EM
8static const char extb_desc[] = "SSL/TLS ($z) extban type";
9
0e51998b
VY
10static int _modinit(void);
11static void _moddeinit(void);
12static int eb_ssl(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
13
c81afd15 14DECLARE_MODULE_AV2(extb_ssl, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
0e51998b
VY
15
16static int
17_modinit(void)
18{
19 extban_table['z'] = eb_ssl;
20
21 return 0;
22}
23
24static void
25_moddeinit(void)
26{
27 extban_table['z'] = NULL;
28}
29
30static int eb_ssl(const char *data, struct Client *client_p,
31 struct Channel *chptr, long mode_type)
32{
33
34 (void)chptr;
35 (void)mode_type;
e0a8d121 36
35eccf49 37 if (!IsSecureClient(client_p))
e0a8d121
AJ
38 return EXTBAN_NOMATCH;
39
0e51998b 40 if (data != NULL)
e0a8d121
AJ
41 {
42 if (EmptyString(client_p->certfp))
43 return EXTBAN_NOMATCH;
44
6cfb1994 45 if (irccmp(data, client_p->certfp) != 0)
e0a8d121
AJ
46 return EXTBAN_NOMATCH;
47 }
48
49 return EXTBAN_MATCH;
0e51998b 50}