summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ssl_gnutls.cpp
AgeCommit message (Collapse)Author
2014-01-22Split IOHook into IOHook and IOHookProviderAttila Molnar
Create one IOHook instance for each hooked socket which contains all the hook specific data and read/write/close functions, removing the need for the "issl_session" array in SSL modules. Register instances of the IOHookProvider class in the core and use them to create specialized IOHook instances (OnConnect/OnAccept). Remove the OnHookIO hook, add a dynamic reference to ListenSocket that points to the hook provider (if any) to use for incoming connections on that socket. For outgoing connections modules still have to find the IOHookProvider they want to use themselves but instead of calling AddIOHook(hookprov), now they have to call IOHookProvider::OnConnect() after the connection has been established.
2014-01-22Add the ability to have multiple SSL profilesAttila Molnar
SSL profiles are now used instead of fixed SSL settings for everything SSL, making it possible to use completely different settings for each listener and outgoing connection. Outgoing connections are broken until the next commit.
2014-01-22m_ssl_gnutls Create GNUTLS_NEW_CERT_CALLBACK_API and cert_cb_last_param_typeAttila Molnar
2014-01-21Add m_starttls and remove it from m_ssl_gnutls, which allows it to work with ↵Adam
both openssl and gnutls
2013-11-18Use gnutls_rnd instead of gcry_randomize on newer GnuTLS versions.Peter Powell
Also, fix a bug where eval() caused compile errors.
2013-11-12Use WriteNumeric() everywhere we send numerics and include the user's nick ↵Adam
automatically
2013-09-08Automatically register ServiceProviders created by modulesattilamolnar
2013-08-30Replace OnRehash() with ReadConfig() that is called on boot, on module load ↵attilamolnar
and on rehash This eliminates the need for calling OnRehash() in init()
2013-08-30Merge insp20attilamolnar
2013-08-16Clean up the build system properties and related code.Peter Powell
- Deduplicate getcompilerflags, getdependancies, getlinkerflags. - Remove $NoPedantic (add -Wno-pedantic to $CompileFlags instead). - Remove --enable-freebsd-ports-openssl and all related code (this will be replaced with --no-pkg-config=[name] in the future). - Remove some unused build system properties. - Remove support for caching third party include and library paths (can cause unexpected problems when they change).
2013-08-13m_ssl_gnutls Fix feature testing and cipher suite related errors on older ↵attilamolnar
GnuTLS versions Use the (old) LIBGNUTLS_VERSION_* defines as a fallback when GNUTLS_VERSION_* is unavailable Fixes #595 reported by @rhylan
2013-08-12Add <path> keys for all of the compile-time paths.Peter Powell
Also, make all paths in the config relative to their associated directory. This reverts a change in 2.0 which turned out to be a terrible idea, especially for system-wide installations.
2013-08-04Automatically attach modules to eventsattilamolnar
2013-08-04Modify the log message to contain the log type.Peter Powell
2013-08-04Change modules to use the MODNAME constant when logging.Peter Powell
The majority of modules were logging with their module name as the log type. There was a few places which were logging to a non-name type but, with the exception of CONFIG, those messages are so uncommon that it doesn't make sense to use a seperate type for them.
2013-07-06Allow the user to specify any hashing mechanism supported by the underlying ↵Daniel Vassdal
SSL library
2013-07-04Remove $Core and $Mod* comments apart from $ModDep.Peter Powell
2013-06-07Create SSLIOHook interface that provides GetCertificate()attilamolnar
2013-06-07Create IOHook interface (extracted from Module)attilamolnar
2013-06-06Convert a ton of uses of MAXBUF to use a fixed buffer size.Peter Powell
2013-06-06Merge insp20attilamolnar
2013-05-27Clean up the FileReader class and all of the modules that use it.Peter Powell
- Modules which use this class will now have to catch a CoreException when opening files if they wish to ignore the failed loading of a file. - m_randquote has been cleaned up massively and the RANDQUOTE command has been removed as it was pretty much useless.
2013-05-19Fix spacing in calls to LogManager::Log.Peter Powell
2013-05-18Deduplicate hex string creation codeattilamolnar
2013-05-15Tidy up keywords on module methods.Peter Powell
- Remove virtual keyword from a ton of methods which don't need it. - Add override keyword to a ton of methods which do need it.
2013-05-14Add method for writing server notices.Peter Powell
This allows us to send a server notice to a user without worrying about whether they are registered or not. If a user receives a server notice and they are not registered then the nickname field will contain an asterisk instead of their nick name.
2013-05-02m_ssl_gnutls Call gnutls_transport_set_errno() on Windows onlyattilamolnar
2013-05-02Fix gnutls (again) on Windows by using gnutls_transport_set_errno()Adam
2013-04-28Merge insp20attilamolnar
2013-04-24m_ssl_gnutls Add ability to load DH params from fileattilamolnar
This greatly decreases the load time because the DH parameters no longer have to be (re)generated each time the module is loaded
2013-04-16Fix m_ssl_gnutls and perhaps some other things on Windows by recognizing ↵Adam
WSAEWOULDBLOCK
2013-04-12Tidy up source files:Peter Powell
- Use #pragma once instead of include guards. - Move header files in src/modules to include/modules. - Fixed various spacing issues.
2013-04-12Add LOG_ prefix to the log level enum values.Peter Powell
2013-04-11Convert ISUPPORT to use a map instead of a string.Peter Powell
2013-04-01Whitespace and empty destructor removal, minor coding style changesattilamolnar
2013-02-17m_ssl_gnutls Fix null pointer dereference in case gnutls_xxx_get_name() ↵attilamolnar
returns NULL
2013-01-28m_ssl_gnutls Fix build with GnuTLS 1.xattilamolnar
Fixes #409 reported by @SaberUK
2012-12-17Fixed m_ssl_gnutls build on Windows; gnutls.h uses ssize_t which is defined ↵Adam
in gcrypt.h
2012-12-02Register all commands, modes and extensions using AddService()attilamolnar
AddService() throws an exception if an item cannot be registered, modules no longer need to worry about AddMode() etc. failing
2012-11-19m_ssl_gnutls Dynamically detect the number of certificates in the certfileattilamolnar
Remove the "certcount" setting, as it's no longer needed When finished reading the certs, resize the buffer to the actual number of certs read
2012-11-19Fix m_ssl_gnutls under GCC on recent versions of GnuTLS.Peter Powell
Commas at the end of enumerator lists are valid in C99 but are not valid in C++ before C++11. This causes a build error on GCC when using -pedantic.
2012-11-09m_ssl_gnutls, m_ssl_openssl Set error message for the socket to "Connection ↵attilamolnar
closed" whenever the ssl connection is closed
2012-11-08Fix m_ssl_gnutls when using non-standard include/lib paths.Peter Powell
This fixes #315.
2012-10-14m_ssl_gnutls: Resolve deprecation warnings properlyChrisTX
2012-10-13m_ssl_gnutls Cast pointer difference to an unsigned int before displaying itattilamolnar
2012-10-12Windows: In-depth cleanup (see details)ChrisTX
-Fix x64 builds for Windows. Now all configurations compile. -Remove the non-working rebase stuff. -Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now. -Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2 -Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need. -Enable optimizations for release builds. -De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure -Add the VC++ specific bad files in .gitignore -Disable PID writing on Windows. This is only making sense for *nix builds. -Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working) -Removed certain unused functions and variables -Remove stdint defines from the windows wrapper -Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds. -Re-evaluated the warnings list, commented it. -Moved inspircd_config/_version to include/ to match *nix -Removed the creation of inspircd_se_config, as it isn't used at all. -Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out) -Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly. -Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down) -Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded. -Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways) -Removed the unused ClearConsole() -Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate. -Made inet_aton an inline function for increased performance -C4800, performance warning about bool forcing, resolved at all occurrences. -C4701, uninitialized variable 'cached', resolved at all occurrences. -dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance. -Removed the wrong CRT debug flags. This drains a lot of performance. -Removed the clock_gettime/gettimeofday wrappers -Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function. -Added a block of C4355 for < VS2012 -Update project files for c870714
2012-10-12Remove superfluous std::string()sattilamolnar
2012-10-04Replace hardcoded paths with configurable onesChrisTX
This patchset aims to ease the packaging of InspIRCd for a system-wide installation scenario. Changes in detail: configure: Add the options --log-path and --data-path m_ssl_gnutls, openssl: Change the hardcoded "conf/" to the existent CONFIG_PATH macro m_xline_db: Make the location of xline.db configurable. It will use --data-path as default value, but this can be changed using the configuration files.
2012-08-20listensocket: Fix the two aliasing warningsChrisTX
m_ssl_gnutls: Fix three warnings: 1. libgcrypt will emit a warning to stdout during runtime that it has not been properly initialized 2. Resolve a warning about invalid narrowing inside a { } block. This is not valid as of C++11. 3. Resolve a warning about a wrong format specifier being used
2012-07-26m_ssl_gnutls Allow setting the priorities to use on the ciphers, key ↵attilamolnar
exchange algorithms, compression methods and macs