Page MenuHomePhabricator
Paste P69382

wmfuniq prototype with key mgmt
ActivePublic

Authored by BBlack on Sep 20 2024, 5:50 PM.
Tags
None
Referenced Files
F57526195: wmfuniq prototype with key mgmt
Sep 20 2024, 5:50 PM
Subscribers
None
bblack@memex:~/repos/wmfuniq$ ./wmfuniq-keygen test1.key # make our first privkey
Wrote new key to file test1.key with key tag 39D7
bblack@memex:~/repos/wmfuniq$ echo '39D7:C:test1.key' >keyring # add as current ("C") to keyring file
bblack@memex:~/repos/wmfuniq$ ./wmfuniq-keygen -k keyring test2.key # make another, ensuring unique tag vs ring
Wrote new key to file test2.key with key tag 665E
bblack@memex:~/repos/wmfuniq$ echo '665E:P:test2.key' >>keyring # add as a valid past key
bblack@memex:~/repos/wmfuniq$ ./wmfuniq-cli -k keyring # bake a fresh cookie with current key and subkey based on current time
wmfuniq DEBUG: Made fresh cookie: c2FfkF7xc85FbzeoGDaqiwEHAAA51wAI1Og71RKC6WvFcX6_OiHCKWr58XDl1mab id: 73615F905EF173CE456F37A81836AA8B cday: 263 count: 0 opts: 0 pkid: 39D7 skid: 0008 salt: D4E83BD51282E96B mac: C5717EBF3A21C2296AF9F170E5D6669B
bblack@memex:~/repos/wmfuniq$ ./wmfuniq-cli -k keyring c2FfkF7xc85FbzeoGDaqiwEHAAA51wAI1Og71RKC6WvFcX6_OiHCKWr58XDl1mab # validate
wmfuniq DEBUG: Successfully validated cookie: c2FfkF7xc85FbzeoGDaqiwEHAAA51wAI1Og71RKC6WvFcX6_OiHCKWr58XDl1mab id: 73615F905EF173CE456F37A81836AA8B cday: 263 count: 0 opts: 0 pkid: 39D7 skid: 0008 salt: D4E83BD51282E96B mac: C5717EBF3A21C2296AF9F170E5D6669B
bblack@memex:~/repos/wmfuniq$ ./wmfuniq-cli -k keyring X2FfkF7xc85FbzeoGDaqiwEHAAA51wAI1Og71RKC6WvFcX6_OiHCKWr58XDl1mab # invalid
wmfuniq DEBUG: validate_cookie(): MAC memcmp failed!
wmfuniq DEBUG: Made fresh cookie: 8BkVxrk0UyLc39yrbJ29ZAEHAAA51wAIoWtiD3R1vPkyu71fkn3FjGCNtqnQTL6L id: F01915C6B9345322DCDFDCAB6C9DBD64 cday: 263 count: 0 opts: 0 pkid: 39D7 skid: 0008 salt: A16B620F7475BCF9 mac: 32BBBD5F927DC58C608DB6A9D04CBE8B