projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
562504f
)
psycstore: postgres: add LENGTH checks for signature and purpose
author
Daniel Golle
<daniel@makrotopia.org>
Tue, 18 Oct 2016 11:28:23 +0000
(11:28 +0000)
committer
Daniel Golle
<daniel@makrotopia.org>
Tue, 18 Oct 2016 11:28:23 +0000
(11:28 +0000)
src/psycstore/plugin_psycstore_postgres.c
patch
|
blob
|
history
diff --git
a/src/psycstore/plugin_psycstore_postgres.c
b/src/psycstore/plugin_psycstore_postgres.c
index c6d274a78cc41998458213da1d832f6f066c037a..273ab4e80fb74f641974ad770ec88e5ddbd2c474 100644
(file)
--- 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"