4949#ifdef CRYPTOIRCD
5050#include <openssl/blowfish.h>
5151#endif
52-
52+ #ifdef USE_SSL
53+ #include <openssl/rsa.h> /* SSL stuff */
54+ #include <openssl/crypto.h>
55+ #include <openssl/x509.h>
56+ #include <openssl/pem.h>
57+ #include <openssl/ssl.h>
58+ #include <openssl/err.h>
59+ #endif
5360typedef struct t_fline aFline ;
5461typedef struct t_crline aCRline ;
5562typedef struct t_vhline aVHline ;
@@ -217,9 +224,12 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
217224#ifdef CRYPTOIRCD
218225#define FLAGS_SECURE 0x8000000
219226#endif
227+ #ifdef USE_SSL
228+ #define FLAGS_SSL 0x10000000
229+ #define FLAGS_SSL_HSHAKE 0x20000000
230+ #endif
220231
221232#define FLAGS_MAP 0x80000000 /* Show this entry in /map */
222-
223233/* Dec 26th, 1997 - added flags2 when I ran out of room in flags -DuffJ */
224234
225235/* Dec 26th, 1997 - having a go at
@@ -250,7 +260,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
250260#define UMODE_WHOIS 0x100000 /* gets notice on /whois */
251261#define UMODE_KIX 0x200000 /* usermode +q */
252262#define UMODE_BOT 0x400000 /* User is a bot */
253- #define UMODE_CODER 0x800000 /* User is a network coder */
263+ #define UMODE_SECURE 0x800000 /* User is a secure connect */
254264#define UMODE_FCLIENT 0x1000000 /* recieve client on far connects.. */
255265#define UMODE_HIDING 0x2000000 /* Totally invisible .. */
256266#define UMODE_VICTIM 0x8000000 /* Intentional Victim */
@@ -259,7 +269,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
259269#define UMODE_SETHOST 0x40000000 /* used sethost */
260270#define UMODE_STRIPBADWORDS 0x80000000 /* */
261271
262- #define SEND_UMODES (UMODE_INVISIBLE|UMODE_OPER|UMODE_WALLOP|UMODE_FAILOP|UMODE_HELPOP|UMODE_REGNICK|UMODE_SADMIN|UMODE_NETADMIN|UMODE_TECHADMIN|UMODE_COADMIN|UMODE_ADMIN|UMODE_SERVICES|UMODE_HIDE|UMODE_EYES|UMODE_WHOIS|UMODE_KIX|UMODE_BOT|UMODE_CODER |UMODE_FCLIENT|UMODE_HIDING|UMODE_DEAF|UMODE_VICTIM|UMODE_HIDEOPER|UMODE_SETHOST|UMODE_STRIPBADWORDS)
272+ #define SEND_UMODES (UMODE_INVISIBLE|UMODE_OPER|UMODE_WALLOP|UMODE_FAILOP|UMODE_HELPOP|UMODE_REGNICK|UMODE_SADMIN|UMODE_NETADMIN|UMODE_TECHADMIN|UMODE_COADMIN|UMODE_ADMIN|UMODE_SERVICES|UMODE_HIDE|UMODE_EYES|UMODE_WHOIS|UMODE_KIX|UMODE_BOT|UMODE_SECURE |UMODE_FCLIENT|UMODE_HIDING|UMODE_DEAF|UMODE_VICTIM|UMODE_HIDEOPER|UMODE_SETHOST|UMODE_STRIPBADWORDS)
263273#define ALL_UMODES (SEND_UMODES|UMODE_SERVNOTICE|UMODE_LOCOP|UMODE_KILLS|UMODE_CLIENT|UMODE_FLOOD|UMODE_CHATOP|UMODE_SERVICES|UMODE_EYES)
264274#define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID)
265275
@@ -329,8 +339,13 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
329339#define IsSecure (x ) ((x)->flags & FLAGS_SECURE)
330340#define SetSecure (x ) ((x)->flags |= FLAGS_SECURE)
331341#define ClearSecure (x ) ((x)->flags &= ~FLAGS_SECURE)
342+ #else
343+ #ifdef USE_SSL
344+ #define IsSecure (x ) ((x)->flags & FLAGS_SSL)
345+ #else
346+ #define IsSecure (x ) (0)
347+ #endif
332348#endif
333-
334349
335350#define IsHybNotice (x ) ((x)->flags & FLAGS_HYBNOTICE)
336351#define SetHybNotice (x ) ((x)->flags |= FLAGS_HYBNOTICE)
@@ -792,6 +807,7 @@ struct t_vhline {
792807#define LISTENER_REMOTEADMIN 0x000008
793808#define LISTENER_JAVACLIENT 0x000010
794809#define LISTENER_MASK 0x000020
810+ #define LISTENER_SSL 0x000040
795811
796812struct Client {
797813 struct Client * next , * prev , * hnext ;
@@ -842,6 +858,10 @@ struct Client {
842858#ifdef CRYPTOIRCD
843859 aCryptInfo * cryptinfo ; /* crypt */
844860#endif
861+ #ifdef USE_SSL
862+ struct SSL * ssl ;
863+ struct X509 * client_cert ;
864+ #endif
845865#ifndef NO_FDLIST
846866 long lastrecvM ; /* to check for activity --Mika */
847867 int priority ;
@@ -1073,6 +1093,7 @@ struct Channel {
10731093#endif
10741094#define MODE_NOCTCP 0x10000000
10751095#define MODE_AUDITORIUM 0x20000000
1096+ #define MODE_ONLYSECURE 0x40000000
10761097
10771098#define is_halfop is_half_op
10781099/*
@@ -1164,5 +1185,8 @@ extern char *gnulicense[];
11641185
11651186#define FLUSH_BUFFER -2
11661187#define COMMA ","
1188+ #ifdef USE_SSL
1189+ #include "ssl.h"
1190+ #endif
11671191
11681192#endif /* __struct_include__ */
0 commit comments