49
49
#ifdef CRYPTOIRCD
50
50
#include <openssl/blowfish.h>
51
51
#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
53
60
typedef struct t_fline aFline ;
54
61
typedef struct t_crline aCRline ;
55
62
typedef struct t_vhline aVHline ;
@@ -217,9 +224,12 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
217
224
#ifdef CRYPTOIRCD
218
225
#define FLAGS_SECURE 0x8000000
219
226
#endif
227
+ #ifdef USE_SSL
228
+ #define FLAGS_SSL 0x10000000
229
+ #define FLAGS_SSL_HSHAKE 0x20000000
230
+ #endif
220
231
221
232
#define FLAGS_MAP 0x80000000 /* Show this entry in /map */
222
-
223
233
/* Dec 26th, 1997 - added flags2 when I ran out of room in flags -DuffJ */
224
234
225
235
/* Dec 26th, 1997 - having a go at
@@ -250,7 +260,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
250
260
#define UMODE_WHOIS 0x100000 /* gets notice on /whois */
251
261
#define UMODE_KIX 0x200000 /* usermode +q */
252
262
#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 */
254
264
#define UMODE_FCLIENT 0x1000000 /* recieve client on far connects.. */
255
265
#define UMODE_HIDING 0x2000000 /* Totally invisible .. */
256
266
#define UMODE_VICTIM 0x8000000 /* Intentional Victim */
@@ -259,7 +269,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
259
269
#define UMODE_SETHOST 0x40000000 /* used sethost */
260
270
#define UMODE_STRIPBADWORDS 0x80000000 /* */
261
271
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)
263
273
#define ALL_UMODES (SEND_UMODES|UMODE_SERVNOTICE|UMODE_LOCOP|UMODE_KILLS|UMODE_CLIENT|UMODE_FLOOD|UMODE_CHATOP|UMODE_SERVICES|UMODE_EYES)
264
274
#define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID)
265
275
@@ -329,8 +339,13 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
329
339
#define IsSecure (x ) ((x)->flags & FLAGS_SECURE)
330
340
#define SetSecure (x ) ((x)->flags |= FLAGS_SECURE)
331
341
#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
332
348
#endif
333
-
334
349
335
350
#define IsHybNotice (x ) ((x)->flags & FLAGS_HYBNOTICE)
336
351
#define SetHybNotice (x ) ((x)->flags |= FLAGS_HYBNOTICE)
@@ -792,6 +807,7 @@ struct t_vhline {
792
807
#define LISTENER_REMOTEADMIN 0x000008
793
808
#define LISTENER_JAVACLIENT 0x000010
794
809
#define LISTENER_MASK 0x000020
810
+ #define LISTENER_SSL 0x000040
795
811
796
812
struct Client {
797
813
struct Client * next , * prev , * hnext ;
@@ -842,6 +858,10 @@ struct Client {
842
858
#ifdef CRYPTOIRCD
843
859
aCryptInfo * cryptinfo ; /* crypt */
844
860
#endif
861
+ #ifdef USE_SSL
862
+ struct SSL * ssl ;
863
+ struct X509 * client_cert ;
864
+ #endif
845
865
#ifndef NO_FDLIST
846
866
long lastrecvM ; /* to check for activity --Mika */
847
867
int priority ;
@@ -1073,6 +1093,7 @@ struct Channel {
1073
1093
#endif
1074
1094
#define MODE_NOCTCP 0x10000000
1075
1095
#define MODE_AUDITORIUM 0x20000000
1096
+ #define MODE_ONLYSECURE 0x40000000
1076
1097
1077
1098
#define is_halfop is_half_op
1078
1099
/*
@@ -1164,5 +1185,8 @@ extern char *gnulicense[];
1164
1185
1165
1186
#define FLUSH_BUFFER -2
1166
1187
#define COMMA ","
1188
+ #ifdef USE_SSL
1189
+ #include "ssl.h"
1190
+ #endif
1167
1191
1168
1192
#endif /* __struct_include__ */
0 commit comments