Implement authenticated encryption in community auth
authorMagnus Hagander <magnus@hagander.net>
Tue, 1 Apr 2025 11:41:08 +0000 (13:41 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 11 Jun 2025 18:26:21 +0000 (20:26 +0200)
commitde76f82f62c0818f041c28a7a5f4ccdcb2e3a1ab
tree1ad83270e4be3e1285833f9d4d494ffcc089211a
parent7a42e2a5f595466d0632cd2f8cd1893b88866619
Implement authenticated encryption in community auth

This creates a community auth version 3 (previous one being 2, and 1 is
long gone) trhat uses AES_SIV as the encryption method instead of
regular AES_CBC, and validates the digests on all accounts.

As this gets deployed on servers incrementall, the version has to be
specified in the database record for the site. We could have the site
indicate this itself, but doing it this way seems safer as it will then
just break for any app that accidentally reverts the plugin.

Reviewed by Jacob Champion
docs/authentication.rst
pgweb/account/admin.py
pgweb/account/migrations/0010_communityauthsite_version.py [new file with mode: 0644]
pgweb/account/models.py
pgweb/account/views.py
tools/communityauth/generate_cryptkey.py
tools/communityauth/sample/django/auth.py
tools/communityauth/test_auth.py