]> jfr.im git - irc/atheme/atheme.git/log
irc/atheme/atheme.git
3 years agonickserv/enforce: REGAIN: fix race condition origin/regain-wait
Nicole Kleinhoff [Thu, 11 Feb 2021 03:29:27 +0000 (03:29 +0000)] 
nickserv/enforce: REGAIN: fix race condition

FNC semantics with most protocols are that services request the nick
change, but the actual nick change itself has to originate from the
user's own server. This means that we must wait for the Guest nick
change to be applied before changing the regaining user's nick, as
otherwise that change might be applied first on part of the network,
requiring an ircd-side resolution of the nick collision resulting from
this as the original person using the nick has not been renamed yet.

This probably still has a number of imperfections; it's essentially a
rebase of a handful of commits from almost two years ago and hasn't seen
much real-world testing yet.

3 years agoMerge PR #744 (try_kick instead of kick in chanserv/close)
Nicole Kleinhoff [Thu, 11 Feb 2021 02:37:32 +0000 (02:37 +0000)] 
Merge PR #744 (try_kick instead of kick in chanserv/close)

3 years agochanserv: allow hiding AKICK entries from public ACLs
Nicole Kleinhoff [Sun, 7 Feb 2021 06:43:22 +0000 (06:43 +0000)] 
chanserv: allow hiding AKICK entries from public ACLs

The PUBACL flag newly introduced in Atheme 7.3 allows channels to
make their access lists visible to the general public. Previously,
certain networks may have chosen to use custom modules or unsupported
modifications to enable similar functionality for their channels.

However, AKICK entries may have been excluded from such custom
functionality for historical or network policy reasons even though they
are technically equivalent to an ACL entry with the +b flag.

In the interest of helping such networks that wish to use the officially
supported PUBACL mechanism but need to preserve the behaviour of keeping
AKICK entries visible only to channel and network staff, this commit
adds an option to hide +b entries from channel access lists for users
without the +A channel access flag (or chan:auspex services privilege).

AKICK reasons and expiries (where used) - as exposed with the AKICK
command - remain accessible to authorized users only, no matter the
value of this option.

This arguably introduces potentially rather unintuitive behaviour in
silently pretending the applicable entries simply don't exist except for
the subset of users authorized to view them. Networks may wish to weigh
this against the perceived benefits of hiding AKICKs.

3 years agopo/: make update-po
Aaron Jones [Thu, 11 Feb 2021 01:07:04 +0000 (01:07 +0000)] 
po/: make update-po

This accounts for recent changes to some of the source files, and the
addition of a new file.

3 years agopo/: make update-pot
Aaron Jones [Thu, 11 Feb 2021 01:06:25 +0000 (01:06 +0000)] 
po/: make update-pot

This accounts for recent changes to some of the source files, and the
addition of a new file.

3 years agolibathemecore/atheme.c: allow periodic db save strategy to be adjusted
Aaron Jones [Mon, 8 Feb 2021 10:36:02 +0000 (10:36 +0000)] 
libathemecore/atheme.c: allow periodic db save strategy to be adjusted

Also document a situation where it is desirable to do so.

3 years agodist/atheme.conf.example: several large improvements
Aaron Jones [Sun, 7 Feb 2021 18:43:41 +0000 (18:43 +0000)] 
dist/atheme.conf.example: several large improvements

- Re-wrap all paragraphs to 78 columns.

- Space out unrelated paragraphs to make scrolling quickly through the
  file easier.

- Unify the format of warnings in comment blocks.

- Mention that SASLServ is an authentication service too.

- Replace "ircd" with "IRCd" and "email" with "e-mail".

- Remove some erroneous text referring to "core components" left
  behind by commit c7858583106c9161b454.

- Make IRC /commands UPPERCASE.

- Comment out all of the StatServ modules by default.

- Clarify that exttargets are not experimental.

- Copy text from crypto::argon2_saltlen to crypto::pbkdf2v2_saltlen.

- Replace single-line /* comments */ with // comments.

- Change example e-mail addresses to invalid ones, lest the user
  un-comment them without changing them, and start sending bogus
  e-mails.

- Add missing denycmd log level to documentation for serverinfo{}.

- Comment out all of the default logfile directives.

  It's not at all obvious that people would want these to be created
  by default, given the abundance of personal information they would
  end up containing.

- Where a configuration option accepts multiple semicolon-delimited
  tokens, re-arrange them in alphabetical order.

- Replace "SSL" with "TLS".

- Eliminate massively-duplicated documentation for service::nick,
  service::user, service::host, service::real, service::aliases and
  service::access.

- Remove pointless text that says the foo{} block is for configuring
  the foo modules. That much is obvious.

- Remove the modules/ prefix from documentation about options that
  affect modules, and quote the module name.

- Quote XOP template names and flags.

- Add missing aliases{} and access{} blocks to pseudoservice blocks
  which provide commands.

- Correct some grammatical errors.

- Move proxyscan{} up so that it is with the other pseudoservice
  blocks.

3 years agoREADME.md: re-wrap, tidy up, add notes about LLVM and sanitizers
Aaron Jones [Sun, 7 Feb 2021 14:25:29 +0000 (14:25 +0000)] 
README.md: re-wrap, tidy up, add notes about LLVM and sanitizers

3 years agoGitHub CI: Ignore more irrelevant file changes
Aaron Jones [Sun, 7 Feb 2021 14:28:51 +0000 (14:28 +0000)] 
GitHub CI: Ignore more irrelevant file changes

3 years agolibathemecore/entity.c: ensure entity ID buffer has a null terminator
Aaron Jones [Sun, 7 Feb 2021 13:24:45 +0000 (13:24 +0000)] 
libathemecore/entity.c: ensure entity ID buffer has a null terminator

Caught by Clang's AddressSanitizer.

Fixes: 416602a02a2cb2c3c7ef ("Give entities a UID, and make them persistent
    for accounts and groups")

3 years agochanserv/why: don't leak akick reason to users without +A/auspex
Nicole Kleinhoff [Sun, 7 Feb 2021 05:37:09 +0000 (05:37 +0000)] 
chanserv/why: don't leak akick reason to users without +A/auspex

On channels with the PUBACL flag, we expose the flag listing to users
without any access as well. However, details about AKICK entries are
still gated behind the +A flag. This specifically includes the reason
(including the private part, if any).

Ensure users have +A or the chan:auspex privilege before revealing the
reason to them via the WHY command.

3 years agoinclude/atheme/attributes.h: add support for Clang object ownership
Aaron Jones [Sat, 6 Feb 2021 17:09:09 +0000 (17:09 +0000)] 
include/atheme/attributes.h: add support for Clang object ownership

This enables Clang's static analyser to better diagnose memory logic
errors, such as use-after-free with custom (de)allocators.

Note that this currently trips up Clang's static analyser with false-
positive "bad deallocator" diagnostics, as it does not yet recognise
that sfree() can deallocate memory like free() will, and will suggest
that you should call free() on the object instead, even though sfree()
is marked with the appropriate attribute. This is a bug in Clang.

3 years agomodules/{nickserv/identify,saslserv/main}: correct operator precedence
Aaron Jones [Sat, 6 Feb 2021 16:51:30 +0000 (16:51 +0000)] 
modules/{nickserv/identify,saslserv/main}: correct operator precedence

"==" has higher precedence than "&"; the test would have always failed.

Found by Clang's -Wparentheses diagnostic.

Fixes: 1917e974310c23944f8d ("Merge pull request #723")
3 years agomodules/chanserv/flags: FLAGS: fix 25 paths to a memory leak
Aaron Jones [Sat, 6 Feb 2021 16:25:54 +0000 (16:25 +0000)] 
modules/chanserv/flags: FLAGS: fix 25 paths to a memory leak

Found by Clang's static analyser.

Fixes: 7d6cb876224ebffd2152 ("chanserv/flags: don't use a dangling
    pointer to an entity name as entities can be disposed at any
    time")

3 years agonickserv/multimark: use irccasecanon for restored nicks
Nicole Kleinhoff [Sat, 6 Feb 2021 02:55:06 +0000 (02:55 +0000)] 
nickserv/multimark: use irccasecanon for restored nicks

3 years agomodules/proxyscan/dnsbl: add MODULE_CONFLICT for contrib/dnsbl
Aaron Jones [Tue, 2 Feb 2021 15:18:26 +0000 (15:18 +0000)] 
modules/proxyscan/dnsbl: add MODULE_CONFLICT for contrib/dnsbl

It was already added to contrib; it was just missing this reciprocity.

3 years agomodules/chanserv/: add module conflicts for ban & unban_self
Aaron Jones [Tue, 2 Feb 2021 15:10:22 +0000 (15:10 +0000)] 
modules/chanserv/: add module conflicts for ban & unban_self

Both of these modules provide an UNBAN command. Loading both would result
in a potentially-concerning mowgli.patricia duplicate key warning. The
example configuration file already tells you not to load both, and the
unban_self module is thus commented-out by default, but it still happens
that someone loads both because they want to UNCOMMENT ALL THE THINGS
without reading what they actually do.

3 years agodist/atheme.conf.example: remove loadmodule lines for some main modules
Aaron Jones [Tue, 2 Feb 2021 14:57:45 +0000 (14:57 +0000)] 
dist/atheme.conf.example: remove loadmodule lines for some main modules

Where a pseudoservice main module only provides scaffolding for its other
modules to do anything, there's no point in explicitly loading it anymore,
because I fixed those module dependencies with commit 2ed940b07ce48e0ed339.

This avoids some harmless "foo/main is already loaded" noise on startup.

3 years agoalso try_kick when initiailly clearing a channel
jesopo [Tue, 2 Feb 2021 10:56:50 +0000 (10:56 +0000)] 
also try_kick when initiailly clearing a channel

3 years agodist/atheme.conf.example: remove trailing whitespace
Aaron Jones [Tue, 2 Feb 2021 10:16:45 +0000 (10:16 +0000)] 
dist/atheme.conf.example: remove trailing whitespace

3 years agodist/atheme.conf.example: re-wrap long lines to 79 columns
Aaron Jones [Tue, 2 Feb 2021 10:14:31 +0000 (10:14 +0000)] 
dist/atheme.conf.example: re-wrap long lines to 79 columns

This makes it easier on people who are still reading and/or editing this
file in an ancient terminal.

3 years agodist/atheme.conf.example: improve documentation for duration options
Aaron Jones [Tue, 2 Feb 2021 09:57:29 +0000 (09:57 +0000)] 
dist/atheme.conf.example: improve documentation for duration options

3 years agodist/atheme.conf.example: add spacing before rehashable option names
Aaron Jones [Tue, 2 Feb 2021 09:39:20 +0000 (09:39 +0000)] 
dist/atheme.conf.example: add spacing before rehashable option names

Again this was inconsistent.

3 years agodist/atheme.conf.example: add spacing between option & description
Aaron Jones [Tue, 2 Feb 2021 09:38:03 +0000 (09:38 +0000)] 
dist/atheme.conf.example: add spacing between option & description

Some options had this, some did not, some had too much.
Make it consistent.

3 years agodist/atheme.conf.example: document how to disable boolean options
Aaron Jones [Tue, 2 Feb 2021 09:22:44 +0000 (09:22 +0000)] 
dist/atheme.conf.example: document how to disable boolean options

3 years agodist/atheme.conf.example: add missing unit specifier to flood_time
Aaron Jones [Tue, 2 Feb 2021 09:16:41 +0000 (09:16 +0000)] 
dist/atheme.conf.example: add missing unit specifier to flood_time

All other time values have comments saying in what unit their value is.
This was the only one that did not.

3 years agoMerge pull request #747 from jesopo/boldify-soper
Aaron Jones [Mon, 1 Feb 2021 14:42:58 +0000 (14:42 +0000)] 
Merge pull request #747 from jesopo/boldify-soper

boldify soper name in wallops

3 years agoboldify soper name in wallops
jesopo [Mon, 1 Feb 2021 14:26:04 +0000 (14:26 +0000)] 
boldify soper name in wallops

3 years agoDisable Travis CI
Aaron Jones [Mon, 1 Feb 2021 10:06:57 +0000 (10:06 +0000)] 
Disable Travis CI

[ci skip]

3 years agoEnable GitHub Actions Continuous Integration
Aaron Jones [Mon, 1 Feb 2021 09:59:39 +0000 (09:59 +0000)] 
Enable GitHub Actions Continuous Integration

This has not yet been tested.

[ci skip]

3 years agomodules/nickserv/register: check e-mail address validity earlier
Aaron Jones [Sat, 30 Jan 2021 15:17:01 +0000 (15:17 +0000)] 
modules/nickserv/register: check e-mail address validity earlier

3 years agomodules/contrib/: bump to latest HEAD
Aaron Jones [Sat, 30 Jan 2021 15:06:49 +0000 (15:06 +0000)] 
modules/contrib/: bump to latest HEAD

3 years agoentity validation: provide match_user for default, groupserv vtables
Nicole Kleinhoff [Sat, 30 Jan 2021 05:05:12 +0000 (05:05 +0000)] 
entity validation: provide match_user for default, groupserv vtables

Previously, callers were expected to call match_entity against a given
user's myuser if there was no match_user provided. Providing this logic
in match_user instead moves this from multiple call sites to the entity
validation implementation itself.

Notably, this affected chanserv/sync which only checked match_user
without checking match_entity, breaking auto-sync upon ACL changes.

Fixes #703; fixes #704.

3 years agouse try_kick() instead of kick() for channels that have been CS CLOSEd
jesopo [Wed, 20 Jan 2021 22:05:44 +0000 (22:05 +0000)] 
use try_kick() instead of kick() for channels that have been CS CLOSEd

my proposed solution for #743, stolen from cs/akick.c, still sets the
closed channel modes but announces that it isn't kicking you because
you're oper/immune.

3 years agoNEWS.md: add HIDEMAIL-on-RETURN, add NickServ section
Nicole Kleinhoff [Wed, 30 Dec 2020 02:43:43 +0000 (02:43 +0000)] 
NEWS.md: add HIDEMAIL-on-RETURN, add NickServ section

3 years agonickserv/return: adjust response if HIDEMAIL set
Nicole Kleinhoff [Wed, 30 Dec 2020 02:43:13 +0000 (02:43 +0000)] 
nickserv/return: adjust response if HIDEMAIL set

3 years agoMerge PR #739 (force HIDEMAIL on RETURN changing email)
Nicole Kleinhoff [Wed, 30 Dec 2020 02:30:00 +0000 (02:30 +0000)] 
Merge PR #739 (force HIDEMAIL on RETURN changing email)

3 years agoFix typo: superceded → superseded.
Unit 193 [Sat, 12 Dec 2020 05:32:23 +0000 (00:32 -0500)] 
Fix typo: superceded → superseded.

[ci skip]

3 years agonotify soper, wallop and log when RETURN sets HIDEMAIL
jesopo [Sun, 6 Dec 2020 13:15:11 +0000 (13:15 +0000)] 
notify soper, wallop and log when RETURN sets HIDEMAIL

3 years agoset HIDEMAIL on RETURN when new email and no HIDEMAIL
jesopo [Sun, 6 Dec 2020 12:41:16 +0000 (12:41 +0000)] 
set HIDEMAIL on RETURN when new email and no HIDEMAIL

3 years agocommand_exec: avoid crashing with security/cmdperm
Nicole Kleinhoff [Mon, 30 Nov 2020 07:54:27 +0000 (07:54 +0000)] 
command_exec: avoid crashing with security/cmdperm

Previously, if a custom command_authorize handler denied execution of a
command, the error message would unconditionally try to include the
command's normally required privilege (either from the command
definition or an access{} item in the configuration). In the case of a
command normally available without special privileges (such as
nickserv/help), this would cause a null pointer dereference.

In such a case, we now give a generic "you are not authorized"
message instead.

There are some cases where the error message is misleading – in
particular, it'll blame the failure on the defined privileges, even if
the failure is actually due to a custom security policy module
(including the case where the privileges are actually held by the user).
Improving this situation is out of the scope of this commit.

3 years agomodules/chanserv/akick: fix unload crash with akicks that have timeouts
Aaron Jones [Sun, 29 Nov 2020 02:50:56 +0000 (02:50 +0000)] 
modules/chanserv/akick: fix unload crash with akicks that have timeouts

The module did not take care to cancel any outstanding expiry timers on
deinit, leading the event loop to (eventually) call a function that no
longer exists.

Reported-By: Ed Kellet <redacted>
3 years agolibathemeconf/conf.c: reorder options to match dist/atheme.conf.example
Aaron Jones [Mon, 23 Nov 2020 16:22:55 +0000 (16:22 +0000)] 
libathemeconf/conf.c: reorder options to match dist/atheme.conf.example

Also remove an option that no longer seems to be used by the codebase.

3 years agoMerge pull request #733 from jesopo/hide-oper
Aaron Jones [Mon, 23 Nov 2020 16:14:47 +0000 (16:14 +0000)] 
Merge pull request #733 from jesopo/hide-oper

add config option to hide oper status in remote whois (hide_opers)

3 years agoadd config option to hide oper status in remote whois (hide_opers)
jesopo [Mon, 23 Nov 2020 00:32:24 +0000 (00:32 +0000)] 
add config option to hide oper status in remote whois (hide_opers)

3 years agoMerge pull request #723 from jesopo/loginnolimit
Alyx [Sun, 22 Nov 2020 01:59:21 +0000 (19:59 -0600)] 
Merge pull request #723 from jesopo/loginnolimit

implement NS LOGINNOLIMIT <nick> ON|OFF

3 years agoMerge pull request #712 from ddevault/regain-login-first
Alyx [Sun, 22 Nov 2020 01:34:04 +0000 (19:34 -0600)] 
Merge pull request #712 from ddevault/regain-login-first

NickServ REGAIN: log in before changing nick

3 years agoMerge pull request #732 from jesopo/ctcp-case-insensitive
Alyx [Sun, 22 Nov 2020 01:30:55 +0000 (19:30 -0600)] 
Merge pull request #732 from jesopo/ctcp-case-insensitive

noopcanon -> strcasecanon; case insensitive CTCP

3 years agonoopcanon -> strcasecanon; case insensitive CTCP
jesopo [Sun, 22 Nov 2020 01:14:08 +0000 (01:14 +0000)] 
noopcanon -> strcasecanon; case insensitive CTCP

3 years agoinvertify those ifs
jesopo [Tue, 3 Nov 2020 04:04:04 +0000 (04:04 +0000)] 
invertify those ifs

3 years agoimplement NS LOGINNOLIMIT <nick> ON|OFF
jesopo [Tue, 3 Nov 2020 03:11:33 +0000 (03:11 +0000)] 
implement NS LOGINNOLIMIT <nick> ON|OFF

3 years agomodules/backend/corestorage: soper: check operclass exists
Aaron Jones [Sun, 25 Oct 2020 00:12:20 +0000 (00:12 +0000)] 
modules/backend/corestorage: soper: check operclass exists

If SOPER ADD is used on a config that contains the operclass being
added, and then the services database is used with a version of
services running a config that doesn't have that operclass in it,
services blows up on a NULL dereference when logging that soper in.

Fixes: #722
3 years agopo/: update all files
Aaron Jones [Thu, 22 Oct 2020 13:58:08 +0000 (13:58 +0000)] 
po/: update all files

3 years agomodules/hostserv/request: small bugfixes, two new small features
Aaron Jones [Thu, 22 Oct 2020 13:48:35 +0000 (13:48 +0000)] 
modules/hostserv/request: small bugfixes, two new small features

- Fix memory leaks when removing a vhost request from the outstanding
  requests list. Also consolidate the code responsible for this into
  one function, to save having to repeat it 6 times.

- Add a silent rejection feature. If a rejection reason is provided,
  and it is the string "SILENT", no memos or notices will be sent to
  the user whose vhost is being rejected.

- Add an option restricting users from making a subsequent vhost
  request until they no longer have an outstanding request that has
  yet to be accepted or rejected.

3 years agomodules/crypto/pbkdf2: don't reject valid salts from v7.2
Aaron Jones [Thu, 17 Sep 2020 16:45:43 +0000 (16:45 +0000)] 
modules/crypto/pbkdf2: don't reject valid salts from v7.2

Atheme 7.2's random_string() function uses more than just hexadecimal
characters. This is essentially the same problem as fixed by the
previous commit; the original problem with the statserv module was
because of looking at the code in this function which was also
deficient in the same manner.

Fixes: c6d9667cb4bb16d51d5e
3 years agomodules/statserv/pwhashes: fix broken pbkdf2 (v1) test
Aaron Jones [Thu, 17 Sep 2020 12:01:39 +0000 (12:01 +0000)] 
modules/statserv/pwhashes: fix broken pbkdf2 (v1) test

The output length of this deprecated module is 144 characters,
not 140. Also, the first 16 characters are an entirely alphanumeric
salt, not a hexadecimal one.

Fixes: 2c05c2f860cfedb52565
3 years agoNickServ REGAIN: log in before changing nick
Drew DeVault [Sun, 26 Jul 2020 17:21:21 +0000 (13:21 -0400)] 
NickServ REGAIN: log in before changing nick

This addresses a race condition where the user is "banned" on a channel
because all unregistered users are banned, preventing them from changing
their nick.

3 years agoMerge pull request #710 from edk0/nickserv-identify-confusion
Aaron Jones [Fri, 24 Jul 2020 01:00:08 +0000 (01:00 +0000)] 
Merge pull request #710 from edk0/nickserv-identify-confusion

nickserv: Prefer advertising two-argument IDENTIFY

3 years agonickserv: Prefer advertising two-argument IDENTIFY
Ed Kellett [Thu, 23 Jul 2020 10:51:41 +0000 (11:51 +0100)] 
nickserv: Prefer advertising two-argument IDENTIFY

Many users are only ever exposed to the one-argument variant, and
require human assistance to get out of situations that could have been
resolved easily. For example, a user matching a +q $~a may find
themselves stuck on an alternate nick.

Attempt to mitigate this problem by making two-argument IDENTIFY more
prominent in help and nags.

3 years agoattributes.h: add support for the 'fallthrough' statement attribute
Aaron Jones [Fri, 12 Jun 2020 08:20:43 +0000 (08:20 +0000)] 
attributes.h: add support for the 'fallthrough' statement attribute

GCC parses literal code comments of the form /* FALLTHROUGH */ but
Clang does not; this statement attribute is a more concrete declaration
of intent supported by both compilers, and yet still readable by humans.

Supported since at least Clang v5, and since GCC v7.1.

Add the new statement attribute where missing to the codebase to finally
silence the unannotated fallthrough warnings emitted during Clang build.

3 years agosaslserv/main: remove annoying "LOGIN (session timed out)" message
Lee Starnes [Fri, 12 Jun 2020 07:17:08 +0000 (07:17 +0000)] 
saslserv/main: remove annoying "LOGIN (session timed out)" message

Original commit by @lstarnes1024, edited by @aaronmdjones to further
remove the flag that it depended on, now that it has no use. Shuffling
the other flag up after it is okay because the only user of this flag
is saslserv/main, and reloading that will reload all other saslserv
modules anyway, so there is no ABI concern.

cf. https://github.com/atheme/atheme/issues/701
cf. https://github.com/atheme/atheme/pull/702/commits/2a446dd628ae9bf133b8

Closes #701
Closes #702

3 years agomkserno.sh: use a better git command to obtain commit hash
Aaron Jones [Fri, 12 Jun 2020 07:07:04 +0000 (07:07 +0000)] 
mkserno.sh: use a better git command to obtain commit hash

As pointed out in [1], the output of git-log(1) is not reliable,
depending on user configuration.

[1] https://github.com/atheme/atheme/issues/692#issuecomment-642976034

[ci skip]

4 years agoconfigure.ac: use host tool for 'ar'
Wade Cline [Sun, 31 May 2020 21:58:29 +0000 (21:58 +0000)] 
configure.ac: use host tool for 'ar'

cf. https://github.com/atheme/libmowgli-2/pull/49

4 years agodist/atheme.conf.example: correct erroneous comment
Aaron Jones [Sun, 3 May 2020 13:28:31 +0000 (13:28 +0000)] 
dist/atheme.conf.example: correct erroneous comment

[ci skip]

4 years agomodules/nickserv/: email keys & changed passwords: bump lengths
Aaron Jones [Sat, 2 May 2020 16:41:56 +0000 (16:41 +0000)] 
modules/nickserv/: email keys & changed passwords: bump lengths

random_string() was changed to use a wider alphabet in commit
659dfb78fb35edf488ac, but the lengths of its consumers were not.

Bump these from 12 to 16 characters for even more prediction
resistance. I'm hesitant to go even further because people may
have to end up typing these out on mobile devices or such.

4 years agomodules/crypto/argon2: warn if building against very old libargon2
Aaron Jones [Thu, 30 Apr 2020 14:41:06 +0000 (14:41 +0000)] 
modules/crypto/argon2: warn if building against very old libargon2

I cannot in my right mind fathom why Debian 9 ships with a 4-year-old
version of a cryptographic library, and not even a backport of a newer
version available, but it does, and there isn't.

This fixes building modules/crypto/argon2 on Debian 9.

4 years agom4/atheme-libtest-*.m4: pkg-config: actually no-op on not found
Aaron Jones [Thu, 30 Apr 2020 14:14:53 +0000 (14:14 +0000)] 
m4/atheme-libtest-*.m4: pkg-config: actually no-op on not found

Providing an empty action-if-not-found argument for PKG_CHECK_MODULES
doesn't stop ./configure from aborting. Actually do something (with no
effect) instead; we don't require any of these libraries.

This allows the configure script to succeed on a freshly-installed
machine without the libraries in question installed.

Further, warn the user that pkg-config is missing if it is. This is
necessary for a lot of the library detection tests, unless the user
manually specifies LIBFOO_CFLAGS and LIBFOO_LIBS on the ./configure
command-line, which we don't want to encourage, and is provided only
for compatibility with weird operating systems that install libraries
into paths that its toolchain does not look for libraries in.

[ci skip]

4 years agolibathemecore/atheme: db-create: advise user restart is necessary
Aaron Jones [Wed, 29 Apr 2020 10:07:03 +0000 (10:07 +0000)] 
libathemecore/atheme: db-create: advise user restart is necessary

Also fix the loglevel of the message about creation.

Closes #696

4 years agoMerge pull request #694 from edk0/last-seen-privacy
Aaron Jones [Mon, 13 Apr 2020 05:32:21 +0000 (05:32 +0000)] 
Merge pull request #694 from edk0/last-seen-privacy

nickserv/info: Make private last-seen times more private

4 years agonickserv/info: Make private times more private
Ed Kellett [Sun, 12 Apr 2020 15:37:02 +0000 (16:37 +0100)] 
nickserv/info: Make private times more private

The previous approach rounded the elapsed time down to weeks, which does
reduce the resolution of last seen times to a week over one observation.
Unfortunately, if we're allowed multiple observations, we can zero in on
the time the low-resolution clock ticks over.

The solution used here is to reduce the resolution of the last-seen time
itself. Since the time is not changing, this happens the same way each
time, and subsequent observations reveal no information. This is not
perfect on its own: it discloses high-resolution information about users
who were last seen at the beginning of the current Atheme week, since
they couldn't have been last seen in the future. We deal with this by
representing both 0- and 1-week differences as "less than two
weeks ago".

Finally, this is of limited value as long as we reveal the
high-resolution fact that a user is online now. We dispense with this
and show an obfuscated time for private users regardless of
logged-in status.

4 years agomodules/statserv/pwhashes: require general:auspex instead of admin
Aaron Jones [Sat, 21 Mar 2020 16:42:01 +0000 (16:42 +0000)] 
modules/statserv/pwhashes: require general:auspex instead of admin

Suggested-by: Nicole Kleinhoff <redacted>
[ci skip]

4 years agomodules/saslserv/main: fix double mechanism registration
Aaron Jones [Thu, 27 Feb 2020 23:13:08 +0000 (23:13 +0000)] 
modules/saslserv/main: fix double mechanism registration

During an saslserv/main reload, some modules (such as SCRAM) can end up
registering their mechanisms twice. We should ignore that; it pollutes
the mechanism list propagated to servers.

[ci skip]

4 years agomodules/saslserv/scram: provide correct mechanism to use on mismatch
Aaron Jones [Thu, 27 Feb 2020 21:19:00 +0000 (21:19 +0000)] 
modules/saslserv/scram: provide correct mechanism to use on mismatch

When a client tries to login with e.g. SCRAM-SHA-512 but their database
credentials were calculated with SHA2-256, indicate to the client that
SCRAM-SHA-256 is the only acceptable SASL SCRAM method for login. This
is done by recalculating a new SASL mechanism list, against a list of
mechanisms to /avoid/ putting into the list, and then sending that list
to the client (but not telling servers to set their general mechanism
list to it, as that would affect other clients). The list of mechanisms
to avoid is calculated based on the database credentials, which we only
know after receiving a username from the client.

As an aside, I am rather disappointed with the design of SCRAM, in
particular its choice to leave negotiation of digest algorithm out of
band. This would be much cleaner if the mechanism was just named "SCRAM"
(or "SCRAM-PLUS"), and the server could indicate (in the server's first
message) which digest algorithm the client should use to calculate
SaltedPassword, ClientKey, & ServerKey. As it stands, we can only fail
the mechanism if the digest algorithm implied by the SASL mechanism name
doesn't match the digest algorithm used to calculate the database
credentials, and then hope that the client eventually falls back to the
correct mechanism.

This commit aids that fallback process for IRCv3.1 networks (IRCv3.2
networks will have the full mechlist as a value of the sasl= capability,
so clients always know which mechanisms it should try). To that end, we
also put a note in the documentation that deploying SCRAM on IRCv3.1
networks is discouraged.

4 years agomodules/saslserv/*.c: move MU_NOPASSWORD checks to saslserv/main
Aaron Jones [Thu, 27 Feb 2020 19:51:37 +0000 (19:51 +0000)] 
modules/saslserv/*.c: move MU_NOPASSWORD checks to saslserv/main

4 years agoUpdate libmowgli to include changes musl support fixes
Alyx Wolcott [Sat, 22 Feb 2020 21:11:25 +0000 (15:11 -0600)] 
Update libmowgli to include changes musl support fixes

4 years agolibathemecore/base64.c: encoding: correct corner-case length check bug
Aaron Jones [Tue, 18 Feb 2020 02:44:15 +0000 (02:44 +0000)] 
libathemecore/base64.c: encoding: correct corner-case length check bug

This was identified by excercising the new bcrypt encryption functionality
introduced in the previous commit.

4 years agomodules/crypto/: add extended-key-setup blowfish (bcrypt) support
Aaron Jones [Tue, 18 Feb 2020 01:56:46 +0000 (01:56 +0000)] 
modules/crypto/: add extended-key-setup blowfish (bcrypt) support

Since this is the algorithm backing the crypt3-openbsd module, remove
that too.

4 years agolibathemecore/: add extended-key-setup blowfish (bcrypt) support
Aaron Jones [Tue, 18 Feb 2020 01:38:36 +0000 (01:38 +0000)] 
libathemecore/: add extended-key-setup blowfish (bcrypt) support

Some code taken from OpenBSD libc, attribution and licence preserved.

4 years agolibathemecore/atheme.c: move digest tests to crypto benchmark utility
Aaron Jones [Tue, 18 Feb 2020 01:26:08 +0000 (01:26 +0000)] 
libathemecore/atheme.c: move digest tests to crypto benchmark utility

This removes the -t and -T command-line options from atheme-services and
adds a -T option to the crypto benchmark utility. Atheme proper now un-
conditionally requires the digest testsuite to pass (because libathemecore
itself uses the Digest API), with no option to skip it. CI builds can now
invoke the testsuite from the crypto benchmarking utility.

4 years agomodules/crypto/: move legacy modules to subdirectory
Aaron Jones [Mon, 17 Feb 2020 20:20:57 +0000 (20:20 +0000)] 
modules/crypto/: move legacy modules to subdirectory

This does not rename the modules themselves; you still load them with the
standard modules/crypto/ prefix. This is just to tidy up the source tree.

This also removes the modules/crypto/posix compatibility module. Please
see the Password Hashing Modules section of dist/atheme.conf.example if
you still use this module on v7.2 or older, for migration instructions.

Finally, document the ./configure options necessary to have each module
built, and elaborate on the distinction between pbkdf2 and pbkdf2v2.

4 years agom4/atheme-featuretest-nls.m4: fix option name
Aaron Jones [Sun, 9 Feb 2020 13:00:41 +0000 (13:00 +0000)] 
m4/atheme-featuretest-nls.m4: fix option name

This is a default off option; its help string should be enable.

[ci skip]

4 years agom4/: tidy up NLS logic
Aaron Jones [Sun, 9 Feb 2020 12:46:26 +0000 (12:46 +0000)] 
m4/: tidy up NLS logic

We shouldn't do all the NLS checks before parsing --enable-nls; it should
be the other way around: only do the checks if --enable-nls=yes was given.

Since all but one of our translations are currently broken, also change
the default from yes to no. This can be revisited after our translations
are brought up to scratch.

4 years agomodules/crypto/pbkdf2v2: correct erroneous debugging statement
Aaron Jones [Thu, 6 Feb 2020 19:36:21 +0000 (19:36 +0000)] 
modules/crypto/pbkdf2v2: correct erroneous debugging statement

This is not necessarily SHA; we support verifying with MD5 too, and might
support non-SHA in the future.

[ci skip]

4 years agoTravis CI: Explicitly install gettext(1) package
Aaron Jones [Thu, 6 Feb 2020 09:03:44 +0000 (09:03 +0000)] 
Travis CI: Explicitly install gettext(1) package

The libgettextpo-dev package no longer seems to pull this in.

[ci skip]

4 years agoMake the SASL mechanism tools optional
Aaron Jones [Thu, 6 Feb 2020 07:24:42 +0000 (07:24 +0000)] 
Make the SASL mechanism tools optional

4 years agoMake the crypto benchmarking utility optional
Aaron Jones [Thu, 6 Feb 2020 06:43:50 +0000 (06:43 +0000)] 
Make the crypto benchmarking utility optional

4 years agom4/atheme-conditional-compilation.m4: sort functions alphabetically
Aaron Jones [Thu, 6 Feb 2020 06:44:42 +0000 (06:44 +0000)] 
m4/atheme-conditional-compilation.m4: sort functions alphabetically

4 years agom4/atheme-libtest-clock-gettime: this is a kernel function, not userland
Aaron Jones [Thu, 6 Feb 2020 06:10:09 +0000 (06:10 +0000)] 
m4/atheme-libtest-clock-gettime: this is a kernel function, not userland

[ci skip]

4 years agom4/atheme-libtest-clock-gettime: do link test with required API & constants
Aaron Jones [Thu, 6 Feb 2020 06:03:02 +0000 (06:03 +0000)] 
m4/atheme-libtest-clock-gettime: do link test with required API & constants

This is what we do in all the other library test files.

[ci skip]

4 years agom4/atheme-print-configuration: make even nicer output
Aaron Jones [Thu, 6 Feb 2020 05:29:50 +0000 (05:29 +0000)] 
m4/atheme-print-configuration: make even nicer output

Group lines by category, indent them some more, indicate which SASL
mechanisms are going to be built (some are always built, so this output
won't change, but they're just there for consistency's sake...).

Good news for all of those stuck in 1995: Aside from the build variables
(CC/CFLAGS/CPPFLAGS/LDFLAGS/LIBS), it all still fits into 80 columns, so
your VGA console can render it just fine.

4 years agom4/atheme-libtest-rt.m4: rename to clock-gettime
Aaron Jones [Thu, 6 Feb 2020 05:16:54 +0000 (05:16 +0000)] 
m4/atheme-libtest-rt.m4: rename to clock-gettime

This file tests whether we can use the clock_gettime(3) function, and
whether we need to link against -lrt to do so (as on older GNU libc...)

However, the functionality we're actually looking for is clock_gettime(3),
not whether we need -lrt or not, so don't name it after the library we
might need, but rather after the function we do need.

4 years agolibathemecore/gcrypt: header inclusion guards aren't necessary in units
Aaron Jones [Thu, 6 Feb 2020 05:16:10 +0000 (05:16 +0000)] 
libathemecore/gcrypt: header inclusion guards aren't necessary in units

Silences two harmless unused macro diagnostics.

[ci skip]

4 years agolibathemecore/memory_frontend: smemzero: support OPENSSL_cleanse(3ssl)
Aaron Jones [Sun, 2 Feb 2020 22:32:07 +0000 (22:32 +0000)] 
libathemecore/memory_frontend: smemzero: support OPENSSL_cleanse(3ssl)

4 years agoUse #elif more to avoid pointless preprocessor soup
Aaron Jones [Sun, 2 Feb 2020 22:19:54 +0000 (22:19 +0000)] 
Use #elif more to avoid pointless preprocessor soup

This looks *MUCH* better, and is also much more maintainable.

Also document, in libathemecore/memory_frontend.c, where various memory
comparison and wiping functions originated, and clean up some other
miscellaneous things.

4 years agolibathemecore/memory: support consttime_memequal & explicit_memset
Aaron Jones [Sun, 2 Feb 2020 11:24:28 +0000 (11:24 +0000)] 
libathemecore/memory: support consttime_memequal & explicit_memset

These C library functions are present in NetBSD v7.0+ and possibly other
C libraries. On NetBSD they both require only <string.h>, which we
already include (by way of <atheme/stdheaders.h>).

Also move the preprocessor warning directive down to where it is actually
needed.

4 years agoconfigure.ac: move most build system / toolchain / header / etc checks
Aaron Jones [Sun, 2 Feb 2020 11:17:20 +0000 (11:17 +0000)] 
configure.ac: move most build system / toolchain / header / etc checks

This puts them in a dedicated file, where they can live in peace and not
pollute the rest.

We also put needed things once per line, even if it is a bit more verbose,
it saves us having to re-wrap lines when we add or remove something.

4 years agodoc/SASL-SCRAM: clarify setup instructions
Aaron Jones [Sun, 2 Feb 2020 05:34:28 +0000 (05:34 +0000)] 
doc/SASL-SCRAM: clarify setup instructions

- Explain the ./configure argument to force GNU libidn to be available
  and what to look for when it prints its configuration.

- Reorder mechanisms in order of strength when asking to decide.

- Clarify that regular PBKDF2 credentials definitely allow impersonation,
  and that this is why the SCRAM module does nothing if this style of
  credentials is being used.

- Move loadmodule advice to next to eachother.

- Space everything out a bit more for readability.

- Directly discourage uncommenting the SCRAM loadmodule line in the
  example configuration file without having read the documentation.

4 years agodist/atheme.conf.example: improve PBKDF2 documentation
Aaron Jones [Sun, 2 Feb 2020 05:23:54 +0000 (05:23 +0000)] 
dist/atheme.conf.example: improve PBKDF2 documentation

4 years agomodules/crypto/pbkdf2v2: parse_dbentry: use less stack space
Aaron Jones [Sun, 2 Feb 2020 05:21:55 +0000 (05:21 +0000)] 
modules/crypto/pbkdf2v2: parse_dbentry: use less stack space

Also denote lack of need for zeroing potentially-sensitive information.

4 years agomodules/crypto/pbkdf2v2: option parsing: some improvements
Aaron Jones [Sun, 2 Feb 2020 05:20:00 +0000 (05:20 +0000)] 
modules/crypto/pbkdf2v2: option parsing: some improvements

- Give clearer error message for the SCRAM- variants being unavailable

- Accept more digest names differing only by e.g. hyphen or lack of, or
  an implied or explicit version, for broader compatibility

- Only assign to pbkdf2v2_digest once