Persist Blowfish keys in the database
authorMichael Marley <michael@michaelmarley.com>
Tue, 8 May 2018 18:49:33 +0000 (13:49 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 23 May 2018 22:33:28 +0000 (00:33 +0200)
commitc382e0c11f80fb37307ecc42c487aa433c97ad8c
treed1eda5bd9c8c643d09b22860db23c7e53d74d1f5
parent899709300734acc2bac01b1d57a1fd8fe2a6d923
Persist Blowfish keys in the database

Add a new text field called "cipher" and store the hex-encoded
cipher key there whenever a new key is set or exchanged.  Also,
when each network is initialized, load the ciphers out of the
database and initialize the in-memory hashmap.  Then, the existing
behavior of each CoreIrcNetwork automatically using these keys
upon construction occurs.

Additionally, this makes PM buffer ciphers persistent both across
destruction/construction and across core restarts.

Note that the existing "key" field in the database is confusingly
named.  It does not contain any sort of cryptographic key but
instead holds channel passwords.

Closes #1473

Closes GH-332.
22 files changed:
src/core/SQL/PostgreSQL/migrate_write_buffer.sql
src/core/SQL/PostgreSQL/select_buffer_ciphers.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/setup_050_buffer.sql
src/core/SQL/PostgreSQL/update_buffer_cipher.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/25/upgrade_000_alter_buffer_add_cipher.sql [new file with mode: 0644]
src/core/SQL/SQLite/migrate_read_buffer.sql
src/core/SQL/SQLite/select_buffer_ciphers.sql [new file with mode: 0644]
src/core/SQL/SQLite/setup_030_buffer.sql
src/core/SQL/SQLite/update_buffer_cipher.sql [new file with mode: 0644]
src/core/SQL/SQLite/version/27/upgrade_000_alter_buffer_add_cipher.sql [new file with mode: 0644]
src/core/abstractsqlstorage.h
src/core/core.h
src/core/coreircuser.cpp
src/core/corenetwork.cpp
src/core/coresession.cpp
src/core/coresession.h
src/core/postgresqlstorage.cpp
src/core/postgresqlstorage.h
src/core/sql.qrc
src/core/sqlitestorage.cpp
src/core/sqlitestorage.h
src/core/storage.h