Commit Graph

155 Commits (307bae3e3a22aa9dc6acc5a81f8c54ea668a77cd)

Author SHA1 Message Date
jMyles 4e25a0ac04 Much better grant logic. 2017-12-14 20:31:54 -08:00
jMyles 0a9002893e For now, Ursula stores Contracts in a dict. 2017-12-14 16:52:36 -08:00
jMyles 346883524a Ursula reconstructs the Contract at the other end of the wire. 2017-12-14 12:46:36 -08:00
jMyles 021f7a25d5 .enact() for Policy 2017-12-14 12:14:37 -08:00
jMyles ac10e6a3da Merge commit for various Policy and testing Work after PRs are merged. 2017-12-13 10:41:55 -08:00
jMyles 9541aa8519 Bob can reconstitute a PolicyGroup before he has the PFrag; nothing wrong with that. 2017-12-13 10:30:47 -08:00
jMyles af969c3ff7 Bob now gets a TreasureMap from just an Alice and URI (not a PolicyGroup). 2017-12-13 10:30:08 -08:00
jMyles 44438e6a50 Moving publish_treasure_map down to PolicyGroup. 2017-12-13 10:29:21 -08:00
jMyles 451095326f Adding __len__ for TreausureMap (kinda surprised we got by without it until now). 2017-12-11 17:03:07 -08:00
jMyles df013d6a00 More replacements of PolicyGroup for the simple hrac. 2017-12-11 17:02:45 -08:00
jMyles cbae3d666e Lookup TreasureMap with provided hrac. It's a good idea to test this, but it's untested as yet. 2017-12-11 17:00:36 -08:00
jMyles 673620e721 Bob doesn't need a PolicyGroup to generate work orders; an hrac will do. 2017-12-11 16:58:40 -08:00
jMyles 588ee82d8e Store TreasureMap when finding from DHT. 2017-12-11 16:56:00 -08:00
jMyles 57b4450d59 Look in own TreasureMaps when following. 2017-12-11 16:55:35 -08:00
jMyles a5fbc5c38d Bob will store TreasureMaps now. 2017-12-11 16:55:00 -08:00
jMyles 74f51e77f3 New deposit logic for grant: Alice can supply a deposit, look at her default deposit, or, if implemented in her network client, find a competitive rate. 2017-12-11 14:43:51 -08:00
jMyles 0cf82a4a0c grant method. 2017-12-09 17:21:08 -08:00
jMyles fd38b2421e Alice gets a PolicyManager at __init__. 2017-12-09 17:19:30 -08:00
jMyles 748aea9746 Added TODO showing where Ursula needs to sign response - See #141. 2017-12-07 20:36:36 -08:00
jMyles ad0a2a59cf Check that Ursula sent back the proper number of CFrags. 2017-12-07 20:36:09 -08:00
jMyles 2b1ca0d0d9 New concept for saving WorkOrders by Bob. 2017-12-07 20:35:38 -08:00
jMyles 647e0e4fd7 Bob can now lookup past work orders by PFrag since #137 is closed. 2017-12-07 00:36:35 -08:00
jMyles 0b21f67323 Ursula tracks WorkOrders. Probably makes more sense to serialize these and put them in her datastore. 2017-12-05 12:51:44 -08:00
jMyles 335320c566 Convenience method for finding a known Ursula by Bob. 2017-12-05 12:51:01 -08:00
jMyles ae4a6f87ec WorkOrder now takes a Bob instead of just Bob's key. 2017-12-05 12:50:18 -08:00
jMyles 028b28cb58 Bob's __init__ was flawed; didn't pass args to super. 2017-12-05 12:49:14 -08:00
jMyles 074788f10f Proper __eq__ logic for Characters - we'll need this to find WorkOrders belonging to Bob. 2017-12-05 12:48:40 -08:00
jMyles 6e3d8bb7b5 REST Response is bytestream of concat'd cFrags. 2017-12-04 17:17:56 -08:00
jMyles baa27f53f7 Storing encrypted key (ie, pfrag) as part of PolicyGroup. 2017-12-04 17:17:28 -08:00
jMyles df9f24e612 Mock network stuff to call reencrypt. 2017-12-04 17:17:28 -08:00
jMyles 3bda4b4a3c Ursula's REST endpoint for reencryption. 2017-12-04 17:17:28 -08:00
jMyles 593fb25db2 Bob signs pfrags and metadata. 2017-12-04 17:17:28 -08:00
jMyles 4494ea869e Bob can generate however many work orders he likes. 2017-12-04 17:17:28 -08:00
jMyles 4509ec0fc8 Pointing out where deterministic Ursula ID is useful. See #136. 2017-12-04 17:17:28 -08:00
jMyles 8cca28439e Work Order logic per-Ursula. 2017-12-04 17:17:28 -08:00
jMyles 07ceb085d1 Clarifying which interface we're talking about. See #134. 2017-12-04 17:17:28 -08:00
jMyles be35217f61 Bob can generate WorkOrder. 2017-12-04 17:17:28 -08:00
jMyles 09d189da47 Changing actor ID to something more realistic. This may become the basis for looking up an actor if we ever represent them with REST. 2017-11-27 20:27:12 -08:00
jMyles 63d1b9d082 encrypt_for takes Character, not str. 2017-11-21 22:09:29 -08:00
jMyles 6886b6bb0a Adding type hints for methods that return None. 2017-11-21 22:08:02 -08:00
jMyles 1e67468013 Properly delivering Alice's signature in the case that she signs the cleartext and includes it in the ciphertext. 2017-11-21 22:02:26 -08:00
jMyles 4c507fe22d Some cleanup; better docstring for Character.__init__ 2017-11-21 20:20:15 -08:00
jMyles 4ff94f385b Ursula can't just willy-nilly spin up an in-memory db anymore. 2017-11-21 12:04:33 -08:00
jMyles 83e63a2ffe Warning when using default DB for Ursula, which does not persist. 2017-11-21 09:38:04 -08:00
jMyles 4563ef2eca HRAC in URL as hex instead of encoded bytes. 2017-11-20 19:49:43 -08:00
jMyles 17ff9a37cf Changed 'set_kfrag' to 'set_policy'. 2017-11-20 19:19:37 -08:00
jMyles 05a9cb99ba Was catching the wrong ImportError. 2017-11-20 19:19:18 -08:00
jMyles 522c016f53 Moving REST App from test_utilities to Ursula. 2017-11-19 11:58:33 -08:00
jMyles 38933d59a0 REST Logic for Policy. Still a problem, though - RekeyFrag can't be added to KeyStore - see #126. 2017-11-18 19:21:36 -08:00
jMyles 31687af4f3 Convenience method for creating Characters from pubkey_sig_bytes. 2017-11-18 19:17:52 -08:00
jMyles 5fdac5d345 Ursula checks Alice's signature on the payload; still some logic to work out. 2017-11-18 13:33:32 -08:00
jMyles 753905f04f Ursula receives a Policy.payload via REST. 2017-11-18 13:33:31 -08:00
jMyles c426714622 Policy now gets Bob injected. 2017-11-18 13:33:31 -08:00
jMyles 711d99b109 IntegrityError block for adding a kFrag that already exists. 2017-11-18 13:33:31 -08:00
jMyles c61ea7f76e Implementing keystore in view. 2017-11-18 13:33:31 -08:00
jMyles ec07b241c8 Ursula now makes a KeyStore using in-memory sqlite if none is provided. 2017-11-18 13:33:31 -08:00
jMyles 0fa2750e6f Ursula now takes a KeyStore. 2017-11-18 13:29:55 -08:00
jMyles 531e3c15c2 Ursula endpoint for receiving a new kfrag. 2017-11-18 13:29:55 -08:00
jMyles 098da6dc21 PublicKey class. 2017-11-18 13:11:27 -08:00
jMyles ec8c225f7d Moved BytestringSplitter remainder logic to __call__; implemented throughout. 2017-11-11 18:00:32 -08:00
jMyles f643e0cd2b Using HRAC and dht_value_splitter for characters. 2017-11-11 17:46:27 -08:00
jMyles 53a0450bf5 Added dunders to Seal for concat'ing. 2017-11-11 15:49:15 -08:00
jMyles 7e43f3caad More thorough implementation of Signature throughout. 2017-11-10 23:36:21 -08:00
jMyles e0f9995e4c Casting Signature to bytes for msgpack. Better to concat it in the future - see #114. 2017-11-10 16:29:28 -08:00
jMyles 1ca86f5b71 ttl is now an attr instead of a method. 2017-11-10 15:55:54 -08:00
jMyles 48174e722e Implemented HRAC; pruned some other legacy code. 2017-11-10 15:34:52 -08:00
jMyles 49f99fc640 Added Bob's public key to secret part of TreasureMap DHT key. Also lots of sanding / code simplification. 2017-11-10 10:47:07 -08:00
jMyles b66eccb251 Working stop-propagation for both Ursula interfaces and TreasureMaps. 2017-11-10 02:04:01 -08:00
jMyles 19aab328d0 Bob can now follow treasure map and get Ursula instances. 2017-11-07 14:25:03 -08:00
jMyles f704f93cbe KeyPairBasedPower to reuse logic for powers based on keypairs. 2017-11-07 12:51:30 -08:00
jMyles ae7683478b Moved verify to utils; implemented it in Character.verify_from. Awesome cleanup. Fixes #99. 2017-11-05 20:30:34 -08:00
jMyles d49eb130af Ursula now sets interface info using public key, providing signed interface info. Other Ursulas refuse to propagate unless this info is correct. 2017-11-05 19:30:03 -08:00
jMyles 745e5a43b4 Beginning of verifying Ursula's interface. 2017-11-05 19:30:03 -08:00
jMyles d2b0e364e1 Ursula now reports IP via K:V store. Hacky workaround for #95. 2017-11-03 18:37:27 -07:00
jMyles eb2382e763 Pursuant to #93, changes to K:V for Alie to lookup Ursula. This commit demonstrates one of the problems described in #95. 2017-11-03 18:37:27 -07:00
jMyles 41b6642b6d Msgpacking encrypted message. 2017-11-03 18:37:27 -07:00
jMyles 5b570b046e Very close to complete Ursula -=> Bob flow for treasure map, but strange error when trying to run coroutine. 2017-11-03 18:37:27 -07:00
jMyles 83058d0211 Fairly reasonable shape for Bob-=>Ursula discovery/upgrade. 2017-11-03 18:37:27 -07:00
jMyles 17adc4c566 More test re-organization. Shows failure of ec.serialize. 2017-11-03 18:37:27 -07:00
jMyles a07e082e6a Working toward policy payload for use over network. 2017-11-03 18:37:21 -07:00
tux 0ae9d007c8 Implement generate_rekey_frags method on Alice
This doesn't include a test for this function. This is basically a tiny
wrapper around the crypto api for generating the key frags.

I'll leave it to JMyles to implement this how he wants.

Fix syntax error

Skip erroring test
2017-10-23 14:20:15 -07:00
jMyles 24b1f4fa92 Bringing policy logic back in line with protocol with new crypto tooling. 2017-10-18 15:48:20 -07:00
tuxxy 9bc43c88e4
Use SigningPower instead of SigningKeypair in characters 2017-10-17 15:01:25 -06:00
jMyles 5566c6058e Removed alpha and added test for its removal. 2017-10-16 22:25:16 -07:00
jMyles 4a2d6a05b3 Code cleanup and some stale code removal. Made EncryptingPower compliant with confers_public_key logic. 2017-10-16 21:45:43 -07:00
jMyles 758aeaa2d7 Compatibility with new encrypt/decrypt functions. 2017-10-16 20:13:38 -07:00
jMyles 504d840e28 Moving new crypto utility functions to _alpha while we consider them. 2017-10-16 18:19:27 -07:00
jMyles 9714b2d0cb Fixing equality function (still needs tests) 2017-10-16 18:19:16 -07:00
jMyles adf71c80c8 Seal now implements dunders instead of custom methods. 2017-10-16 18:17:53 -07:00
jMyles e276e86d52 Getting pretty close. Need a clean way to encrypt and decrypt. 2017-10-16 18:17:53 -07:00
jMyles 71669bfc49 Made working defaults for EncryptingKeypair 2017-10-16 18:17:29 -07:00
jMyles db364a20de Fixed up docstring and type hints on verify_from 2017-10-16 18:16:01 -07:00
jMyles 506f0f81cd Character encryption tests.
Note that CryptoPower.decrypt and Character.encrypt_for have fake logic until EncryptingPower is implemented.
2017-10-16 18:16:01 -07:00
jMyles 8cf64dfcc6 PolicyGroup now uses Bob instead of a public key. One test fails until we get EncryptingPower working. 2017-10-16 18:12:14 -07:00
jMyles bf0f83b6ea Moving EncryptingKeypair over to powers. 2017-10-10 22:39:25 -07:00
tuxxy c699fd3e18 Use keccak_digest instead of signature_hash or content_hash
Really use keccak_hash

keccak_hash -> keccak_digest

Fix another thing
2017-10-10 20:32:35 -06:00
tuxxy 3b3f44038c Fix tests and update imports to reflect nkms.crypto.api 2017-10-10 20:18:24 -06:00
jMyles 9e651af46b Import statements changed while we reorganize. 2017-10-10 13:02:45 -07:00
jMyles 7eae9c21b1 KeyRing -=> KeyStore and some other reorganization. 2017-10-09 14:03:16 -07:00
jMyles b28a937b05 Passing both crypto_power and crypto_powerup is now not allowed. 2017-10-06 20:49:59 -07:00