· 7 years ago · Jul 23, 2018, 06:26 AM
1
2-- --
3-- This should work with at least PostgreSQL. Maybe more --
4-- --
5
6CREATE TABLE yubikey (
7 yubikey_id serial NOT NULL,
8 active boolean NOT NULL DEFAULT 'f',
9 public_id varchar, -- fixed public bit of the key's output, modhex encoded
10 secret_uid bytea NOT NULL, -- secret uid bit of the key
11 secret_key bytea NOT NULL,
12 session_counter int,
13 session_use int
14);
15
16INSERT INTO yubikey (active, public_id,
17 secret_uid, secret_key, session_counter, session_use) VALUES
18 ('t', 'tfheen',
19 E'\\000\\000\\000\\000\\000\\000',
20 decode('baef43c254e9d2217912e80ed71a7b4a', 'hex'),
21 0, 0);
22
23CREATE TABLE shared_secret (
24 secret_id serial NOT NULL,
25 secret bytea NOT NULL,
26 active boolean NOT NULL DEFAULT 'f'
27);
28
29INSERT INTO shared_secret (secret, active) VALUES (decode('MQ6fOy1t/add/wisbu2O+LpPiMs=', 'base64'), 't');