ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_certfp.c
(Generate patch)

Comparing ircd-hybrid/trunk/modules/m_certfp.c (file contents):
Revision 4485 by michael, Sat Aug 16 15:56:05 2014 UTC vs.
Revision 9857 by michael, Fri Jan 1 04:43:22 2021 UTC

# Line 1 | Line 1
1   /*
2   *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (c) 2013-2014 ircd-hybrid development team
4 > *  Copyright (c) 2013-2021 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 15 | Line 15
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program; if not, write to the Free Software
18 < *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
18 > *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19   *  USA
20   */
21  
# Line 27 | Line 27
27   #include "stdinc.h"
28   #include "client.h"
29   #include "ircd.h"
30 #include "server.h"
30   #include "send.h"
31   #include "parse.h"
32   #include "modules.h"
34 #include "irc_string.h"
33   #include "memory.h"
34  
35  
# Line 46 | Line 44
44   *      - parv[0] = command
45   *      - parv[1] = certificate fingerprint
46   */
47 < static int
47 > static void
48   ms_certfp(struct Client *source_p, int parc, char *parv[])
49   {
50    if (!IsClient(source_p))
51 <    return 0;
51 >    return;
52  
53 <  MyFree(source_p->certfp);
54 <  source_p->certfp = xstrdup(parv[1]);
53 >  xfree(source_p->tls_certfp);
54 >  source_p->tls_certfp = xstrdup(parv[1]);
55  
56 <  sendto_server(source_p, NOCAPS, NOCAPS, ":%s CERTFP %s",
57 <                source_p->id, parv[1]);
60 <  return 0;
56 >  sendto_server(source_p, 0, 0, ":%s CERTFP %s",
57 >                source_p->id, source_p->tls_certfp);
58   }
59  
60   static struct Message certfp_msgtab =
61   {
62 <  "CERTFP", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
63 <  { m_ignore, m_ignore, ms_certfp, m_ignore, m_ignore, m_ignore }
62 >  .cmd = "CERTFP",
63 >  .handlers[UNREGISTERED_HANDLER] = { .handler = m_ignore },
64 >  .handlers[CLIENT_HANDLER] = { .handler = m_ignore },
65 >  .handlers[SERVER_HANDLER] = { .handler = ms_certfp, .args_min = 2 },
66 >  .handlers[ENCAP_HANDLER] = { .handler = m_ignore },
67 >  .handlers[OPER_HANDLER] = { .handler = m_ignore }
68   };
69  
70   static void
# Line 80 | Line 81 | module_exit(void)
81  
82   struct module module_entry =
83   {
83  .node    = { NULL, NULL, NULL },
84  .name    = NULL,
84    .version = "$Revision$",
86  .handle  = NULL,
85    .modinit = module_init,
86    .modexit = module_exit,
89  .flags   = 0
87   };

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)