]> jfr.im git - irc/atheme/atheme.git/log
irc/atheme/atheme.git
22 months agomodules/chanserv/close: check correct flags variable for log target origin/release/7.2
Aaron Jones [Fri, 15 Jul 2022 01:09:02 +0000 (01:09 +0000)] 
modules/chanserv/close: check correct flags variable for log target

A user reported that the ChanServ CLOSE command was not working for
their channel, saying that the channel could not be closed.

MC_HOLD and CHAN_LOG both have the same value (1), but the former is
for flags in `struct mychan`, and the latter is for `struct channel`.

This lead me to believe that the channel was defined as a log target,
when in reality it was checking the wrong flags field and deducing
that the channel was a log target because it was held.

Check the correct flags field.

(Cherry-picked from commit 51e84e63e5b696ef39d5)

Reported-by: @hello-smile6
2 years agoAtheme IRC Services v7.2.12 v7.2.12
Aaron Jones [Sun, 30 Jan 2022 19:38:38 +0000 (19:38 +0000)] 
Atheme IRC Services v7.2.12

2 years agomodules/saslserv/main: backport 7.3 commits for pending EID login
Aaron Jones [Sun, 30 Jan 2022 19:17:02 +0000 (19:17 +0000)] 
modules/saslserv/main: backport 7.3 commits for pending EID login

This backports commits 4e664c75d0b280a052eb & ceb0235695e6736ce2ab
from the master branch.

The IRCv3.1 SASL specification contains the following wording:

    If the client completes registration (with CAP END, NICK, USER
    and any other necessary messages) while the SASL authentication
    is still in progress, the server SHOULD abort it and send a 906
    numeric, then register the client without authentication.

We were relying on this behaviour (which was our mistake; it's a
SHOULD, not a MUST), which turned out to be implemented in every
IRC server daemon (that supports SASL) that we are aware of. This
means that if someone completes registration without having completed
an SASL negotiation, the SASL session would be aborted before the
client is introduced to the network. At that point, the session would
not exist and the client would not be logged in.

The InspIRCd developers changed this behaviour in the
inspircd/inspircd@407b2e004cf66e442771 commit. It no longer aborts
negotiation when a client prematurely completes registration.

This means that if the client is attempting a multi-step (challenge-
response) authentication mechanism, and that mechanism caches user
credentials at some point before completion, the client can pre-
maturely end negotiation and get logged in as that user.

Worse still, SASL impersonation lets the attacker set the authzid to
their intended victim, allowing them to login as anyone, even if they
don't have a challenge-response authentication credential configured.
This does not exist in version 7.1; the victim's account there has to
have such a credential to be vulnerable to this attack.

Vulnerable configurations are as follows:

- All of:
  - InspIRCd 3+
  - Any of:
    - Atheme 7.1 (any version)
    - Atheme 7.2 (any version before 7.2.12; this commit)
    - Atheme 7.3 (any version before commit 4e664c75d0b280a052eb)
  - Any of:
    - The saslserv/scram module is loaded
    - The saslserv/ecdh-x25519-challenge module is loaded
    - The saslserv/ecdsa-nist256p-challenge module is loaded

This is a fix for a security vulnerability. The master (7.3) branch
was already fixed in 4e664c75d0b280a052eb, but the scope of the
problem was not fully known at that time. The 7.1 branch is no longer
supported, is not receiving security updates, and will not be patched;
users of the 7.1 series (using an IRCd that does not abort the SASL
session when the client prematurely completes registration) must
upgrade, or unload the `saslserv/ecdsa-nist256p-challenge` module.

This problem was discovered by and reported by @edk0.

2 years agocorestorage: don't try to write if we couldn't open a database
Aaron Jones [Fri, 23 Jun 2017 07:39:58 +0000 (07:39 +0000)] 
corestorage: don't try to write if we couldn't open a database

(cherry picked from commit f26b1b762e650d1a39f8800deedf20ea9da92c9c)

2 years agoMerge pull request #785 from fasterthanlime/patch-1
alyx [Wed, 2 Jun 2021 00:14:19 +0000 (19:14 -0500)] 
Merge pull request #785 from fasterthanlime/patch-1

Comment typo: nore ➡️ node

2 years agoComment typo: nore ➡️ node
Amos Wenger [Tue, 1 Jun 2021 23:59:08 +0000 (01:59 +0200)] 
Comment typo: nore ➡️ node

3 years agomodules/contrib/: transition to independent build system
Aaron Jones [Thu, 18 Mar 2021 21:10:55 +0000 (21:10 +0000)] 
modules/contrib/: transition to independent build system

Having to duplicate configure tests in all supported Atheme release and
development branches, to enable contrib modules to be built reliably on
all of our supported platforms, was quickly becoming untenable.

3 years agoconfigure: put directory macros in a header file, not in CPPFLAGS
Aaron Jones [Thu, 11 Mar 2021 20:03:24 +0000 (20:03 +0000)] 
configure: put directory macros in a header file, not in CPPFLAGS

This will be necessary for my near-future intention to change the contrib
modules repository to be self-building; i.e. to have its own configure
script and build system.

Also don't try to expand directories like MODDIR for pretty printing,
because it sometimes doesn't work depending on the directory arguments
given to ./configure. Yeah, the config output looks worse, but oh well.

3 years agoinclude/mkserno.sh: exit early in presence of an environment variable
Aaron Jones [Tue, 2 Mar 2021 05:43:18 +0000 (05:43 +0000)] 
include/mkserno.sh: exit early in presence of an environment variable

This makes life easier for people who want to package snapshots
of a git branch. They must provide their own serno.h in this
case, containing also, perhaps, the date the snapshot was
downloaded or such.

3 years agoGit tree (not tarballs): include/mkserno.sh: remove --broken switch
Aaron Jones [Sun, 28 Feb 2021 14:49:10 +0000 (14:49 +0000)] 
Git tree (not tarballs): include/mkserno.sh: remove --broken switch

Some very old gits do not support this; it was added in 2.13.0 (2017).

We already sort of detect broken submodules in the configure script,
so this should be safe to remove. Unless the user deliberately
corrupts their repository, there's no difference.

3 years agoAtheme IRC Services v7.2.11 v7.2.11
Aaron Jones [Sun, 28 Feb 2021 02:38:16 +0000 (02:38 +0000)] 
Atheme IRC Services v7.2.11

3 years agolibathemecore/conf.c: sfree() does not exist in this branch, use free()
Aaron Jones [Sun, 28 Feb 2021 02:37:35 +0000 (02:37 +0000)] 
libathemecore/conf.c: sfree() does not exist in this branch, use free()

3 years agoDisable Travis CI
Aaron Jones [Sun, 28 Feb 2021 02:25:58 +0000 (02:25 +0000)] 
Disable Travis CI

This no longer works.

3 years agoconfigure, README.md, GIT-Access.txt: backport from master & adjust
Aaron Jones [Sun, 28 Feb 2021 02:24:57 +0000 (02:24 +0000)] 
configure, README.md, GIT-Access.txt: backport from master & adjust

This will enable future releases on this branch to be more user friendly.

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

3 years agolibmowgli-2/: bump to latest HEAD
Nicole Kleinhoff [Tue, 23 Feb 2021 01:05:46 +0000 (01:05 +0000)] 
libmowgli-2/: bump to latest HEAD

3 years agolibathemecore/conf.c: fix minor memory leak with hide_xop
Nicole Kleinhoff [Fri, 19 Feb 2021 07:43:40 +0000 (07:43 +0000)] 
libathemecore/conf.c: fix minor memory leak with hide_xop

The entries in global_template_dict are heap-allocated structures;
hide_xop was deleting the entries without freeing them, leaking a few
bytes each time the config was loaded.

(cherry picked from commit f22b8f34a5174e87d3cc2a008ca3317fe33ac61e)

3 years agoatheme.conf.example: add +e to default template example
Nicole Kleinhoff [Sun, 14 Feb 2021 07:29:33 +0000 (07:29 +0000)] 
atheme.conf.example: add +e to default template example

(cherry picked from commit e66fccfc08b4043290bf64ca2ea6d78f8cfc632a)

3 years agoCA_ constants: include CA_EXEMPT (+e) where appropriate
Nicole Kleinhoff [Sun, 14 Feb 2021 07:32:10 +0000 (07:32 +0000)] 
CA_ constants: include CA_EXEMPT (+e) where appropriate

Some CA_ constants including CA_REMOVE weren't updated when CA_EXEMPT
was split off from it; add it to CA_SUCCESSOR_0 and CA_SOP_DEF.

CA_USEDUPDATE remains without +e on purpose as that flag merely
signifies ability to join the channel, comparable to +i.

(copied from commit ff6708a7672e82a393a60c84dab743b79892acfe)

Fixes #695.

3 years agonickserv/multimark: forbid unloading due to data loss
Nicole Kleinhoff [Sat, 6 Feb 2021 03:07:29 +0000 (03:07 +0000)] 
nickserv/multimark: forbid unloading due to data loss

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

3 years agomodules/nickserv/register: check e-mail address validity earlier
Aaron Jones [Sat, 30 Jan 2021 15:16:12 +0000 (15:16 +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:04:42 +0000 (15:04 +0000)] 
modules/contrib/: bump to latest HEAD

3 years agomodules/chanserv/akick: fix unload crash with akicks that have timeouts
Aaron Jones [Sun, 29 Nov 2020 03:15:51 +0000 (03:15 +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.

Backport of commit f28269362bb59ef6673d from master.

Reported-By: Ed Kellet <redacted>
4 years agoTravis CI: Bump configuration to same state as master
Aaron Jones [Wed, 25 Dec 2019 10:32:55 +0000 (10:32 +0000)] 
Travis CI: Bump configuration to same state as master

4 years agoAdd SECURITY.md
Nicole Kleinhoff [Wed, 18 Dec 2019 19:12:02 +0000 (19:12 +0000)] 
Add SECURITY.md

Quick summary:

- we'll support the current and previous release series once 7.3 is out
  (for now, only 7.2 is supported)
- poke us on IRC or email security@atheme.org to report stuff
- we do coordinated disclosure, full disclosure after two weeks

4 years agoatheme.conf.example: document needoper not being inherited
Janik Kleinhoff [Mon, 2 Sep 2019 13:35:32 +0000 (13:35 +0000)] 
atheme.conf.example: document needoper not being inherited

5 years agomodules/crypto/pbkdf2v2: add HMAC-MD5 support (verify-only)
Aaron Jones [Tue, 12 Feb 2019 22:18:39 +0000 (22:18 +0000)] 
modules/crypto/pbkdf2v2: add HMAC-MD5 support (verify-only)

This is cheap (the necessary scaffolding is already present) and easy,
and will enable the migration of password hashes from more sources.

It will always re-encrypt the password, after verification, with a
stronger digest algorithm, because you cannot configure the module to
use this one.

This is a back-port of commit 7b1204391f5bd25b5409728aac46b2855f7f9433
from the master (v7.3) branch, for forward-compatibility.

5 years agomodules/contrib/: bump to latest HEAD
Aaron Jones [Wed, 9 Jan 2019 02:25:37 +0000 (02:25 +0000)] 
modules/contrib/: bump to latest HEAD

[ci skip]

5 years agoAdd Preliminary Turkish Translation
Monkey D. Luffy [Wed, 26 Dec 2018 16:51:51 +0000 (16:51 +0000)] 
Add Preliminary Turkish Translation

5 years agomodules/contrib/: bump to latest HEAD
Aaron Jones [Sun, 16 Dec 2018 20:31:41 +0000 (20:31 +0000)] 
modules/contrib/: bump to latest HEAD

5 years agoconfigure: reliably test for res_query(3) if building modules/contrib/
Aaron Jones [Sun, 16 Dec 2018 20:27:49 +0000 (20:27 +0000)] 
configure: reliably test for res_query(3) if building modules/contrib/

This makes building contrib modules on non-Linux platforms possible,
where res_query(3) is in -lc, not -lresolv.

5 years agomodules/contrib/: bump to latest HEAD
Aaron Jones [Sun, 29 Jul 2018 02:41:25 +0000 (02:41 +0000)] 
modules/contrib/: bump to latest HEAD

5 years agoAtheme v7.2.10-r2 v7.2.10-r2
Aaron Jones [Thu, 5 Jul 2018 14:11:29 +0000 (14:11 +0000)] 
Atheme v7.2.10-r2

5 years agomodules/crypto/pbkdf2v2: fix regression from v7.2.9
Aaron Jones [Thu, 5 Jul 2018 14:06:06 +0000 (14:06 +0000)] 
modules/crypto/pbkdf2v2: fix regression from v7.2.9

Interoperability tests were performed between 7.2.9 and master,
and 7.2.10 and master, but not 7.2.9 and 7.2.10. 7.2.10 and
master use base64-encoded salts for new hashes, and master has
a verify function which doesn't require string-equal output.

However, 7.2 doesn't have that feature, so crypt() must output
a string-equal hash to all of the previous outputs over all
versions. What I failed to notice was that crypt() was assuming
the salt was base64-encoded, so if it wasn't, password
verification would fail; the hash is the same byte-wise, but it
is encoded as a string differently.

While we're at it, make sure the parameter upgrade system takes
account of various salt lengths, allow the user to configure a
different salt length (as if on master), and make sure we erase
the password from the stack after we're done with it.

Reported-by: xerox123
5 years agoAtheme 7.2.10
Aaron Jones [Fri, 29 Jun 2018 13:01:18 +0000 (13:01 +0000)] 
Atheme 7.2.10

5 years agomodules/misc/httpd: mod_deinit: close listener & children immediately
Aaron Jones [Sun, 10 Jun 2018 02:08:56 +0000 (02:08 +0000)] 
modules/misc/httpd: mod_deinit: close listener & children immediately

Closes #628

5 years agolibathemecore/connection: add func to close listener & children immediately
Aaron Jones [Sun, 10 Jun 2018 02:08:15 +0000 (02:08 +0000)] 
libathemecore/connection: add func to close listener & children immediately

5 years agomodules/chanserv/{access,flags}: use flags setter information if available
Aaron Jones [Tue, 5 Jun 2018 13:48:00 +0000 (13:48 +0000)] 
modules/chanserv/{access,flags}: use flags setter information if available

6 years agomodules/crypto/argon2d.c: argon2d_hash_raw(): fix uninitialised data path
Aaron Jones [Wed, 28 Feb 2018 11:50:04 +0000 (11:50 +0000)] 
modules/crypto/argon2d.c: argon2d_hash_raw(): fix uninitialised data path

If the first blake2b_long() call in argon2d_hash_raw() fails, it would pass
uninitialised data in bhash_bytes[] to argon2d_load_block(). Similarly if
the second call fails, same thing. Lastly, the return value should depend on
whether the final call succeeds.

Fix this by testing if it fails, and add a function attribute to all boolean
functions that will result in a diagnostic if their return value is not
tested (or under Clang, explicitly discarded). Adjust other callers of those
functions to also test for failure.

This issue was found by the Clang static analyzer.

6 years agomodules/crypto/pbkdf2v2: use SASL mechanism name for SCRAM digests
Aaron Jones [Mon, 12 Feb 2018 07:50:42 +0000 (07:50 +0000)] 
modules/crypto/pbkdf2v2: use SASL mechanism name for SCRAM digests

[ci skip]

6 years agoinclude/common.h: bump e-mail max length to 254 characters
Aaron Jones [Mon, 12 Feb 2018 07:14:20 +0000 (07:14 +0000)] 
include/common.h: bump e-mail max length to 254 characters

<http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690>

[ci skip]

6 years agomodules/contrib/: bump to latest HEAD
Aaron Jones [Sun, 11 Feb 2018 14:44:59 +0000 (14:44 +0000)] 
modules/contrib/: bump to latest HEAD

6 years agoinclude/common.h: add internal error fault code from master (needed for new contrib)
Aaron Jones [Sun, 11 Feb 2018 14:44:44 +0000 (14:44 +0000)] 
include/common.h: add internal error fault code from master (needed for new contrib)

6 years agolibathemecore, modules: some spelling fixes
Unit 193 [Wed, 7 Feb 2018 12:47:04 +0000 (13:47 +0100)] 
libathemecore, modules: some spelling fixes

6 years agogroupserv/main: use correct database backend functions
Aaron M. D. Jones [Sun, 4 Feb 2018 15:14:09 +0000 (15:14 +0000)] 
groupserv/main: use correct database backend functions

These 2 functions behave identically in opensex in this scenario but
that is an implementation detail that should not be relied upon.

6 years agogroupserv/main: write out group definitions before their access lists
Aaron M. D. Jones [Sun, 4 Feb 2018 14:42:03 +0000 (14:42 +0000)] 
groupserv/main: write out group definitions before their access lists

If a group '!a' includes an access list entry for group '!b' (which is
lexicographically after) then upon read-back (when restarting services)
the access list contains an entry for a (for the moment) non-existent
group which is ignored. This results in data loss.

The fix is simple: Write out all group definitions (& their flags and
metadata) and then all group access lists.

Reported-by: Samuel Hoffman <redacted> (sjh)
Reported-by: Aaron M. D. Jones <redacted> (amdj)
Reviewed-by: Janik Kleinhoff <redacted> (ilbelkyr)
6 years agoTravis CI: Use old config option for old branch
Aaron Jones [Sun, 21 Jan 2018 15:57:51 +0000 (15:57 +0000)] 
Travis CI: Use old config option for old branch

[ci skip]

6 years agoTravis CI: Backport configuration from master
Aaron Jones [Sun, 21 Jan 2018 15:46:00 +0000 (15:46 +0000)] 
Travis CI: Backport configuration from master

[ci skip]

6 years agoinclude/protocol/*.h: use better include guards
Aaron Jones [Mon, 11 Dec 2017 06:10:40 +0000 (06:10 +0000)] 
include/protocol/*.h: use better include guards

While authoring the last commit I neglected to look at the other files.

[ci skip]

6 years agoinclude/protocol/inspircd.h: rename include guard
Aaron Jones [Mon, 11 Dec 2017 05:51:30 +0000 (05:51 +0000)] 
include/protocol/inspircd.h: rename include guard

[ci skip]

6 years agomodules/saslserv/ecdsa-nist256p-challenge: use o2i_ECPublicKey properly
Aaron Jones [Sun, 10 Dec 2017 21:56:52 +0000 (21:56 +0000)] 
modules/saslserv/ecdsa-nist256p-challenge: use o2i_ECPublicKey properly

Check its return value, and fail if it does.

6 years agomodules/saslserv/ecdsa-nist256p-challenge: use arc4random_buf instead
Aaron Jones [Sun, 10 Dec 2017 21:56:04 +0000 (21:56 +0000)] 
modules/saslserv/ecdsa-nist256p-challenge: use arc4random_buf instead

RAND_pseudo_bytes() is dangerous and we already have our own RNG.

6 years agomodules/crypto/pbkdf2v2: backport from master
Aaron Jones [Thu, 7 Dec 2017 13:29:15 +0000 (13:29 +0000)] 
modules/crypto/pbkdf2v2: backport from master

See commits 68044e2a9cd2b5d3e97b...cf8e0677e90beb832665 for details.

6 years agoBuild System: backport from master
Aaron Jones [Thu, 7 Dec 2017 13:29:03 +0000 (13:29 +0000)] 
Build System: backport from master

See commits bcae7b4e445e149179b4...e2872439e4a6f4eb353e for details.

6 years agolibathemecore: backport base64 codec from master
Aaron Jones [Wed, 6 Dec 2017 21:47:41 +0000 (21:47 +0000)] 
libathemecore: backport base64 codec from master

6 years agoGitHub: We don't use C++, stop labelling our headers as so
Aaron Jones [Thu, 30 Nov 2017 06:34:35 +0000 (06:34 +0000)] 
GitHub: We don't use C++, stop labelling our headers as so

6 years agolibathemecore/crypto.c: crypt_string(): generate salt if not given one
Aaron Jones [Sun, 5 Nov 2017 16:48:16 +0000 (16:48 +0000)] 
libathemecore/crypto.c: crypt_string(): generate salt if not given one

6 years agoremove unnecessary space
equinox [Thu, 2 Nov 2017 19:38:30 +0000 (08:38 +1300)] 
remove unnecessary space

6 years agomodules/crypto/pbkdf2v2: return NULL instead of false
Aaron Jones [Mon, 30 Oct 2017 05:51:24 +0000 (05:51 +0000)] 
modules/crypto/pbkdf2v2: return NULL instead of false

clang trunk missed this.

6 years agomodules/crypto/pbkdf2v2: backport e3b0d7bdb831db694272 from master
Aaron Jones [Mon, 30 Oct 2017 05:48:06 +0000 (05:48 +0000)] 
modules/crypto/pbkdf2v2: backport e3b0d7bdb831db694272 from master

modules/crypto/pbkdf2v2: add debugging log messages

6 years agomodules/crypto/pbkdf2v2: backport 376472c9ac22e1832cd2 from master
Aaron Jones [Mon, 30 Oct 2017 05:46:49 +0000 (05:46 +0000)] 
modules/crypto/pbkdf2v2: backport 376472c9ac22e1832cd2 from master

modules/crypto/pbkdf2v2: add SCRAM-SHA support

6 years agomodules/crypto/pbkdf2v2: backport b3a33071d4e9d5dbca16 from master
Aaron Jones [Mon, 30 Oct 2017 05:43:01 +0000 (05:43 +0000)] 
modules/crypto/pbkdf2v2: backport b3a33071d4e9d5dbca16 from master

modules/crypto/pbkdf2v2: don't ask OpenSSL for digest length

We know it's only ever going to be SHA1 (20 bytes), SHA2-256 (32 bytes)
or SHA2-512 (64 bytes), and we're already in a switch() statement
converting a PRF ID into a digest algorithm, so we may as well set the
digest length in there too.

6 years agomodules/crypto/pbkdf2v2: reduce size of sscanf(3) buffers
Aaron Jones [Sun, 22 Oct 2017 02:24:39 +0000 (02:24 +0000)] 
modules/crypto/pbkdf2v2: reduce size of sscanf(3) buffers

0x2000 (8 KiB) is definitely sufficient to mitigate any potential
inadvertant overflow, and an attacker with a crafted malicious
database would have been able to overflow the old 0x8000 (32 KiB)
buffers anyway.

6 years agomodules/crypto/argon2d: reduce size of sscanf(3) buffers
Aaron Jones [Sun, 22 Oct 2017 02:24:18 +0000 (02:24 +0000)] 
modules/crypto/argon2d: reduce size of sscanf(3) buffers

0x2000 (8 KiB) is definitely sufficient to mitigate any potential
inadvertant overflow, and an attacker with a crafted malicious
database would have been able to overflow the old 0x8000 (32 KiB)
buffers anyway.

6 years agomodules/crypto/pbkdf2v2: offload most computation to dedicated function
Aaron Jones [Sat, 21 Oct 2017 18:19:10 +0000 (18:19 +0000)] 
modules/crypto/pbkdf2v2: offload most computation to dedicated function

6 years agomodules/crypto/pbkdf2v2: rename variables consistent with master
Aaron Jones [Sat, 21 Oct 2017 17:55:27 +0000 (17:55 +0000)] 
modules/crypto/pbkdf2v2: rename variables consistent with master

6 years agomodules/crypto/pbkdf2v2: allow variable salt length for possible migrations
Aaron Jones [Sat, 21 Oct 2017 17:49:44 +0000 (17:49 +0000)] 
modules/crypto/pbkdf2v2: allow variable salt length for possible migrations

6 years agomodules/crypto/pbkdf2v2: use PRF macro for default variable
Aaron Jones [Sat, 21 Oct 2017 17:36:58 +0000 (17:36 +0000)] 
modules/crypto/pbkdf2v2: use PRF macro for default variable

6 years agomodules/crypto/pbkdf2v2: adjust macro names for iter count
Aaron Jones [Sat, 21 Oct 2017 17:35:56 +0000 (17:35 +0000)] 
modules/crypto/pbkdf2v2: adjust macro names for iter count

6 years agomodules/crypto/pbkdf2v2: add macros for PRF algorithms
Aaron Jones [Sat, 21 Oct 2017 17:31:35 +0000 (17:31 +0000)] 
modules/crypto/pbkdf2v2: add macros for PRF algorithms

6 years agomodules/crypto/pbkdf2v2: fix up some format strings
Aaron Jones [Sat, 21 Oct 2017 17:28:04 +0000 (17:28 +0000)] 
modules/crypto/pbkdf2v2: fix up some format strings

6 years agomodules/crypto/pbkdf2v2: add support for HMAC-SHA1
Aaron Jones [Sun, 15 Oct 2017 14:31:46 +0000 (14:31 +0000)] 
modules/crypto/pbkdf2v2: add support for HMAC-SHA1

The master branch (what will become 7.3) got this too, but it was
added there for future possibility of implementing SASL SCRAM support.

We will not be implementing support for SCRAM in version 7.2, but
people who used the pbkdf2v2 module with SHA1 in version 7.3 might
want to downgrade to version 7.2, so we need support for verifying
those hashes too.

6 years agoFix '--docdir' configuration option.
Wade Cline [Fri, 14 Jul 2017 00:11:24 +0000 (17:11 -0700)] 
Fix '--docdir' configuration option.

Documentation should now be installed according to the '--docdir'
argument passed to configure.

6 years agomodules/crypto/argon2d: don't mix format strings for scanning & printing
Aaron Jones [Sun, 15 Oct 2017 11:01:45 +0000 (11:01 +0000)] 
modules/crypto/argon2d: don't mix format strings for scanning & printing

The inttypes.h header provides format specifier macros for scanning, so
use those for parsing instead of the printing ones, just incase we're
building on a machine where they are different.

6 years agoNEWS.md: Document new crypto module
Aaron Jones [Fri, 13 Oct 2017 08:25:11 +0000 (08:25 +0000)] 
NEWS.md: Document new crypto module

6 years agomodules/crypto/argon2d: backport module+documentation from master
Aaron Jones [Fri, 13 Oct 2017 02:34:04 +0000 (02:34 +0000)] 
modules/crypto/argon2d: backport module+documentation from master

6 years agomodules/crypto/pbkdf2v2: reuse previous idiom for length of salt array
Aaron Jones [Sat, 7 Oct 2017 22:55:21 +0000 (22:55 +0000)] 
modules/crypto/pbkdf2v2: reuse previous idiom for length of salt array

This is equivalent but more robust.

6 years agomodules/crypto/pbkdf2v2: reorder variables by usage
Aaron Jones [Sat, 7 Oct 2017 19:05:14 +0000 (19:05 +0000)] 
modules/crypto/pbkdf2v2: reorder variables by usage

6 years agomodules/crypto/pbkdf2v2: use correct variable types to function calls
Aaron Jones [Sat, 7 Oct 2017 19:00:49 +0000 (19:00 +0000)] 
modules/crypto/pbkdf2v2: use correct variable types to function calls

PKCS5_PBKDF2_HMAC() and base64_encode()

6 years agomodules/crypto/pbkdf2v2: replace switch() with if-elseif-else
Aaron Jones [Sat, 7 Oct 2017 18:59:12 +0000 (18:59 +0000)] 
modules/crypto/pbkdf2v2: replace switch() with if-elseif-else

It's so short anyway...

6 years agomodules/crypto/pbkdf2v2: move variables to where they are needed
Aaron Jones [Sat, 7 Oct 2017 18:56:59 +0000 (18:56 +0000)] 
modules/crypto/pbkdf2v2: move variables to where they are needed

6 years agomodules/crypto/pbkdf2v2: realign macros with spaces not tabs
Aaron Jones [Sat, 7 Oct 2017 18:42:33 +0000 (18:42 +0000)] 
modules/crypto/pbkdf2v2: realign macros with spaces not tabs

6 years agomodules/crypto/pbkdf2v2: make mod(de)init static and prefix their name(s)
Aaron Jones [Sat, 7 Oct 2017 18:39:32 +0000 (18:39 +0000)] 
modules/crypto/pbkdf2v2: make mod(de)init static and prefix their name(s)

Calls to these functions should be made through the pointers in the MAPI
header anyway.

6 years agomodules/crypto/pbkdf2v2: silence unused parameter warnings
Aaron Jones [Sat, 7 Oct 2017 18:36:20 +0000 (18:36 +0000)] 
modules/crypto/pbkdf2v2: silence unused parameter warnings

6 years agomodules/crypto/pbkdf2v2: rename conf_pbkdf2v2_table to pbkdf2v2_conf_table
Aaron Jones [Sat, 7 Oct 2017 18:33:45 +0000 (18:33 +0000)] 
modules/crypto/pbkdf2v2: rename conf_pbkdf2v2_table to pbkdf2v2_conf_table

This is consistent with the prefix on the other symbols.

6 years agomodules/crypto/pbkdf2v2: rename another function
Aaron Jones [Sat, 7 Oct 2017 18:31:22 +0000 (18:31 +0000)] 
modules/crypto/pbkdf2v2: rename another function

6 years agomodules/crypto/pbkdf2v2: fix wrong variable name
Aaron Jones [Sat, 7 Oct 2017 18:30:59 +0000 (18:30 +0000)] 
modules/crypto/pbkdf2v2: fix wrong variable name

6 years agomodules/crypto/pbkdf2v2: rename function
Aaron Jones [Sat, 7 Oct 2017 18:29:42 +0000 (18:29 +0000)] 
modules/crypto/pbkdf2v2: rename function

6 years agomodules/crypto/pbkdf2v2: align member assignment in crypt_impl_t
Aaron Jones [Sat, 7 Oct 2017 18:28:59 +0000 (18:28 +0000)] 
modules/crypto/pbkdf2v2: align member assignment in crypt_impl_t

6 years agomodules/crypto/pbkdf2v2: use 0/1 instead of false/true in bool function
Aaron Jones [Sat, 7 Oct 2017 18:27:01 +0000 (18:27 +0000)] 
modules/crypto/pbkdf2v2: use 0/1 instead of false/true in bool function

6 years agomodules/crypto/pbkdf2v2: rename a function argument for consistency
Aaron Jones [Sat, 7 Oct 2017 18:26:13 +0000 (18:26 +0000)] 
modules/crypto/pbkdf2v2: rename a function argument for consistency

6 years agomodules/crypto/pbkdf2v2: test for exact required return value of sscanf(3)
Aaron Jones [Sat, 7 Oct 2017 18:25:28 +0000 (18:25 +0000)] 
modules/crypto/pbkdf2v2: test for exact required return value of sscanf(3)

6 years agomodules/crypto/pbkdf2v2: add appropriate qualifiers to function arguments
Aaron Jones [Sat, 7 Oct 2017 18:24:38 +0000 (18:24 +0000)] 
modules/crypto/pbkdf2v2: add appropriate qualifiers to function arguments

6 years agomodules/crypto/pbkdf2v2: put function names on their own line
Aaron Jones [Sat, 7 Oct 2017 18:22:19 +0000 (18:22 +0000)] 
modules/crypto/pbkdf2v2: put function names on their own line

Makes grepping for '^name' easy.

6 years agomodules/crypto/pbkdf2v2: return error if hash generation would overflow
Aaron Jones [Sat, 7 Oct 2017 18:21:27 +0000 (18:21 +0000)] 
modules/crypto/pbkdf2v2: return error if hash generation would overflow

6 years agomodules/crypto/pbkdf2v2: return error if salt generation would overflow
Aaron Jones [Sat, 7 Oct 2017 14:48:41 +0000 (14:48 +0000)] 
modules/crypto/pbkdf2v2: return error if salt generation would overflow

6 years agomodules/crypto/pbkdf2v2: use arc4random_buf() to generate salt
Aaron Jones [Sat, 7 Oct 2017 14:43:57 +0000 (14:43 +0000)] 
modules/crypto/pbkdf2v2: use arc4random_buf() to generate salt

This is slightly more efficient and less ugly than calling arc4random()
multiple times.

6 years agomodules/crypto/pbkdf2v2: remove unnecessary memset(3) calls
Aaron Jones [Sat, 7 Oct 2017 14:35:45 +0000 (14:35 +0000)] 
modules/crypto/pbkdf2v2: remove unnecessary memset(3) calls

These are left over from module development where they made
debugging easier.

6 years agomodules/crypto/posix: fix potential NULL deref on password verify
Aaron Jones [Thu, 5 Oct 2017 22:56:41 +0000 (22:56 +0000)] 
modules/crypto/posix: fix potential NULL deref on password verify

If we have an encrypted password from the database that does not
contain a '$' in it (as is the case for the original deprecated
pbkdf2 module) then when posix tries to verify the hash it will
segfault because we assume a '$' is present.