diff options
author | Daniel Golle <daniel@makrotopia.org> | 2016-10-18 10:36:46 +0000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2016-10-18 10:36:46 +0000 |
commit | 562504f9c0e8571fefd6c3dd2c398e6ccffa0027 (patch) | |
tree | 0a0ae4d7d0091e5390f53369e3ca8135dfa8b06e /src/psycstore | |
parent | b3edc375977fd6c85b83c1413ea7d0816aacd91a (diff) | |
download | gnunet-562504f9c0e8571fefd6c3dd2c398e6ccffa0027.tar.gz gnunet-562504f9c0e8571fefd6c3dd2c398e6ccffa0027.zip |
psycstore: postgres: introduce LENGTH check for pub_key field
Diffstat (limited to 'src/psycstore')
-rw-r--r-- | src/psycstore/plugin_psycstore_postgres.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/psycstore/plugin_psycstore_postgres.c b/src/psycstore/plugin_psycstore_postgres.c index 9240d3334..c6d274a78 100644 --- a/src/psycstore/plugin_psycstore_postgres.c +++ b/src/psycstore/plugin_psycstore_postgres.c | |||
@@ -100,7 +100,7 @@ database_setup (struct Plugin *plugin) | |||
100 | GNUNET_POSTGRES_exec(plugin->dbh, | 100 | GNUNET_POSTGRES_exec(plugin->dbh, |
101 | "CREATE TABLE IF NOT EXISTS channels (\n" | 101 | "CREATE TABLE IF NOT EXISTS channels (\n" |
102 | " id SERIAL,\n" | 102 | " id SERIAL,\n" |
103 | " pub_key BYTEA,\n" | 103 | " pub_key BYTEA NOT NULL CHECK (LENGTH(pub_key)=32),\n" |
104 | " max_state_message_id BIGINT,\n" | 104 | " max_state_message_id BIGINT,\n" |
105 | " state_hash_message_id BIGINT,\n" | 105 | " state_hash_message_id BIGINT,\n" |
106 | " PRIMARY KEY(id)\n" | 106 | " PRIMARY KEY(id)\n" |
@@ -121,7 +121,7 @@ database_setup (struct Plugin *plugin) | |||
121 | GNUNET_POSTGRES_exec(plugin->dbh, | 121 | GNUNET_POSTGRES_exec(plugin->dbh, |
122 | "CREATE TABLE IF NOT EXISTS slaves (\n" | 122 | "CREATE TABLE IF NOT EXISTS slaves (\n" |
123 | " id SERIAL,\n" | 123 | " id SERIAL,\n" |
124 | " pub_key BYTEA,\n" | 124 | " pub_key BYTEA NOT NULL CHECK (LENGTH(pub_key)=32),\n" |
125 | " PRIMARY KEY(id)\n" | 125 | " PRIMARY KEY(id)\n" |
126 | ")" "WITH OIDS")) || | 126 | ")" "WITH OIDS")) || |
127 | 127 | ||