aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore/plugin_psycstore_postgres.c
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2016-10-18 11:28:23 +0000
committerDaniel Golle <daniel@makrotopia.org>2016-10-18 11:28:23 +0000
commitb709fa7937e671b1a5f6e941c9a2ea7c342e23f2 (patch)
treedb8431c45846409e40ac5532bc62669c4f822a2f /src/psycstore/plugin_psycstore_postgres.c
parent562504f9c0e8571fefd6c3dd2c398e6ccffa0027 (diff)
psycstore: postgres: add LENGTH checks for signature and purpose
Diffstat (limited to 'src/psycstore/plugin_psycstore_postgres.c')
-rw-r--r--src/psycstore/plugin_psycstore_postgres.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/psycstore/plugin_psycstore_postgres.c b/src/psycstore/plugin_psycstore_postgres.c
index c6d274a78c..273ab4e80f 100644
--- a/src/psycstore/plugin_psycstore_postgres.c
+++ b/src/psycstore/plugin_psycstore_postgres.c
@@ -158,8 +158,8 @@ database_setup (struct Plugin *plugin)
"CREATE TABLE IF NOT EXISTS messages (\n"
" channel_id BIGINT NOT NULL REFERENCES channels(id),\n"
" hop_counter INT NOT NULL,\n"
- " signature BYTEA,\n"
- " purpose BYTEA,\n"
+ " signature BYTEA CHECK (LENGTH(signature)=64),\n"
+ " purpose BYTEA CHECK (LENGTH(purpose)=8),\n"
" fragment_id BIGINT NOT NULL,\n"
" fragment_offset BIGINT NOT NULL,\n"
" message_id BIGINT NOT NULL,\n"