Commit Graph

916 Commits (2670982d0076edd85a5a684a83300c5c54fd30f9)

Author SHA1 Message Date
jMyles 7b84024bd8 pubkey_sig_tuple is gone. 2018-02-14 00:17:12 -08:00
jMyles 112746363b MessageKit now casts strictly to ciphertext. Moved previous serialization to to_bytes, which we'll start to implement as a component-style interface. 2018-02-14 00:16:26 -08:00
jMyles 9325222885 OK, I'm buckling and finally providing Character.decrypt() - just a wrapper around their encrypting power, but now a public way to decrypt without specifying an actor or checking a signature. 2018-02-14 00:11:34 -08:00
jMyles 64f9f8c550 Clearing up verify_from logic and adding some TODOs which are worth taking some time to consider. 2018-02-14 00:11:15 -08:00
jMyles e1862657a8 Slightly tightened encrypt_for logic. 2018-02-14 00:07:55 -08:00
jMyles 30d273c43b verify_from can take bytes too. It can probably take other types and work, but we'll just hint MessageKit and bytes. We cast to bytes anyway. 2018-02-14 00:04:05 -08:00
Kieran R Prasch 2d92ed7dc7 New API renaming, and more style. 2018-02-13 17:50:46 -08:00
Kieran R Prasch 37a7fc5f84 Adds utility to get fingerprint from key. 2018-02-13 17:49:55 -08:00
Kieran R Prasch 895d17a31d Adds Pep and style changes. 2018-02-13 17:49:26 -08:00
Kieran R Prasch 022087f67a Fixes Db bulk delete assertion; Renames several key test method calls 2018-02-13 17:37:40 -08:00
tuxxy 6428337ab5 Add broken sqlalchemy delete 2018-02-13 17:37:40 -08:00
tuxxy 31a091bcce Some fixes in keystor and related tests 2018-02-13 17:37:40 -08:00
jMyles 734a334a77 Walking back the seal change for now. 2018-02-13 17:35:12 -08:00
jMyles 6ac0bee751 Extraneous comment. 2018-02-13 17:34:07 -08:00
jMyles 8f6c4b4a2f Capsule instead of PFrag. Feels so good. 2018-02-13 15:44:47 -08:00
jMyles c62e39917a CFrag splitter. 2018-02-13 15:43:38 -08:00
jMyles 258407450f Get the length from the message_class, not necessarily this object. 2018-02-13 15:43:06 -08:00
jMyles 032d5e6f3f Way more elegant __init__ for BytestringSplitter; with better error messages for misuse. 2018-02-13 15:42:07 -08:00
jMyles e3f347979e No more metabytyes! 2018-02-13 15:29:35 -08:00
jMyles 4b1cef51bf Now we pass the whole capsule! 2018-02-13 15:10:25 -08:00
tuxxy 7daab1f096 Add test_keypairs 2018-02-13 14:00:15 -07:00
jMyles 732b75bfd6 WorkOrders now take Capsules. 2018-02-13 13:28:51 -07:00
jMyles 481e56653c capsules instead of pfrags! So nice. 2018-02-13 13:28:51 -07:00
tuxxy d0bfd4ae0d WIP on rm-crypto: 2b73b14 Merge pull request #11 from jMyles/rm-crypto 2018-02-13 13:28:39 -07:00
jMyles 7d53c82f74 Starting MessageKit for TreasureMap flow. 2018-02-13 11:09:59 -08:00
jMyles e08f75ab71 Some fields are now nullable; passing None by default. 2018-02-13 11:09:32 -08:00
jMyles 41c4a920de Making full relationship flow for key FK. 2018-02-13 11:09:08 -08:00
jMyles c97635dd86 public key is no longer optional on Signature.verify. 2018-02-13 11:08:49 -08:00
jMyles bc01f5d07a Fixing sig up to work with cryptography ECDSA. 2018-02-13 11:08:28 -08:00
jMyles 261d501bd8 Grabbing contract from keystore instead of dict. 2018-02-13 11:08:18 -08:00
jMyles 0def1591fc Starting deprecation of _contracts - commented out some logic for now. 2018-02-13 11:07:56 -08:00
jMyles e45712a75b "Non-decrypt" flow for Character signature validation. 2018-02-13 11:07:39 -08:00
jMyles 8e77ee97d0 hrac as hex (DB entry will now match URL). 2018-02-13 07:42:40 -08:00
jMyles 8dda6b0553 Fixing up arguments for keystore. 2018-02-12 13:33:22 -08:00
jMyles f5c19cdfba k_frag, not key_frag! 2018-02-12 13:33:12 -08:00
jMyles 25477c1204 Sending Policy in a MessageKit. 2018-02-12 13:12:31 -08:00
jMyles b5bf5557a2 Reinstituing Keystore logic. 2018-02-12 13:09:18 -08:00
jMyles 2184933c97 Commenting out encrypting keys from the Keystore for the moment. 2018-02-12 13:08:58 -08:00
jMyles 63b2a94c9b equality for signatures. 2018-02-12 13:08:09 -08:00
jMyles 83344553d9 Clarifying that we need (and use) the enc - not sig - public key for encrypting. 2018-02-12 13:00:14 -08:00
jMyles 0e57e44c03 We might initially construct a MessageKit without some of the components. 2018-02-12 12:59:52 -08:00
jMyles e17e10b452 Reintroducing UNKNOWN_KFRAG. 2018-02-12 12:59:39 -08:00
jMyles e55dda7ace Seal needs a fingerprint too. 2018-02-12 12:59:31 -08:00
jMyles cf7b0053fd We don't represent a public key as a tuple anymore. 2018-02-12 12:59:18 -08:00
jMyles ee93749c20 New Policy logic to work with MessageKit and Keystore. Needs more cleanup. 2018-02-12 12:58:38 -08:00
jMyles 7551d79fd6 Constructing message_kit with Signature - we'll do this a better way soon. 2018-02-12 12:58:10 -08:00
Tux 6aeef2f6ec
Merge pull request #9 from jMyles/rm-crypto
Kits, splitters, new encrypt and decrypt, more
2018-02-11 02:15:25 -07:00
jMyles 5804ffdc95 New splitters for Policy. 2018-02-11 01:06:21 -08:00
jMyles f600f7f183 Formatting and style. 2018-02-11 01:05:58 -08:00
jMyles 570f169038 Splitter with kwargs. 2018-02-11 01:05:36 -08:00
jMyles 94fb768914 I had stashed some of Tux's work when I merged; adding that back in. 2018-02-11 01:04:50 -08:00
jMyles ccf3cb1f2d ByteStringSplitter can now take kwargs and can be added to other splitters. 2018-02-11 01:03:36 -08:00
jMyles 505c3a7115 Formatting and organization for ByteStringSplitter. 2018-02-11 01:02:45 -08:00
jMyles 9cd7bc083c Signature concat needs to be cummatative. 2018-02-11 01:00:39 -08:00
jMyles fba93f9b07 ...and that's the story of how pyumbral and MessageKits destroyed two perfectly awful functions. 2018-02-11 00:59:14 -08:00
jMyles d2a5218cc2 More touchups to powers. 2018-02-11 00:58:06 -08:00
jMyles b63e749819 Characters can encrypt for others without needing an encrypting power. 2018-02-11 00:56:33 -08:00
jMyles 69137b07d5 Some organization. 2018-02-11 00:55:22 -08:00
jMyles b92b5158e1 Serialize MessageKit. 2018-02-11 00:54:36 -08:00
jMyles 50043f68a9 Using splitters in kits! 2018-02-11 00:54:24 -08:00
jMyles 6e5a6cfbaa Putting some prefab splitters in splitters.py. 2018-02-11 00:54:15 -08:00
jMyles 0c32deab98 Splitting a MessageKit to get Policy. 2018-02-11 00:52:25 -08:00
jMyles f807113d7d verify_from now takes a MessageKit. 2018-02-11 00:52:10 -08:00
jMyles 5358916ea5 encrypt_for now takes plaintext, returns a MessageKit. 2018-02-11 00:51:21 -08:00
jMyles a3a05d9de0 powers_and_keys can now take UmbralPublicKeys. 2018-02-11 00:50:22 -08:00
tuxxy 1c5c1ab7ad Remove npre from policy.models 2018-02-10 22:11:37 -07:00
tuxxy 542e6b6a5c Fix syntax 2018-02-10 22:08:27 -07:00
jMyles 0c47c00d69 @tuxxy merged my Pull Request, then pushed his history to thunderdome. This commit merges those histories. 2018-02-10 20:39:30 -08:00
tuxxy 2fc5596d5b Add tests for sqlite keystore 2018-02-10 21:26:56 -07:00
jMyles d91426e0e8 Formatting and style changes. 2018-02-10 19:39:03 -08:00
jMyles fee2b29836 Red lines through PFrag. 2018-02-10 19:28:34 -08:00
jMyles 438ecf2e29 New splitters for new hashes. 2018-02-10 19:26:54 -08:00
jMyles 044c636a77 New hash digest length for dht bytestring splitter. 2018-02-10 19:24:27 -08:00
jMyles 84e6f7d410 Signatures returned from keypairs. 2018-02-10 19:12:45 -08:00
jMyles 625ec75b0f Better error if message_types aren't compliant with BytestringSplitter. 2018-02-10 19:09:29 -08:00
jMyles 440e3e13b6 Signature r+s concatenation serialization. 2018-02-10 19:09:29 -08:00
jMyles 24bbac9ae1 Unlike PublicKey, UmbralPublicKey can't be init'd with bytes. 2018-02-10 19:09:29 -08:00
jMyles 9ce9a8a49b Bytes de/serialization for Signature has changed a bit now that we're using cryptography.io.
For a question about this method of serialization r and s, see: https://stackoverflow.com/questions/48726642/whats-the-proper-way-to-get-a-fixed-length-bytes-representation-of-an-ecdsa-sig/48727351#48727351
2018-02-10 19:09:29 -08:00
jMyles ddd0d69ac8 We make a Signature our of r and s now - it'll be 64 bytes with secp256k1. 2018-02-10 19:09:29 -08:00
jMyles 29aeb86bc5 We don't hash messages in advance anymore; cryptography.io does it. 2018-02-10 19:09:29 -08:00
jMyles c7e13cb861 KeyPair gets init'd with bytes. 2018-02-10 19:09:29 -08:00
jMyles 8a6ac628bb Use the sig_keypair's sign method. 2018-02-10 19:09:29 -08:00
jMyles ad3af0fe8f Gotta actually grab the public key. 2018-02-10 19:09:29 -08:00
jMyles 8ecb791823 Moved mutable out of params list. 2018-02-10 19:09:29 -08:00
jMyles 817277623f Two hash digest lengths are better than one! 2018-02-10 19:09:29 -08:00
jMyles adf2eee2e8 API no longer returns Signature. 2018-02-10 19:09:29 -08:00
jMyles 1eef746f7c Alice implements new kfrag generation method. 2018-02-10 19:09:29 -08:00
jMyles 44d9820f7b Alice now generates KFrags with umbral. Woo! 2018-02-10 19:09:28 -08:00
tuxxy 893ae8d24c Implement Keystore with new models 2018-02-10 17:01:11 -07:00
tuxxy b894ca6d18 Implement get_fingerprint on Keypair 2018-02-10 15:43:00 -07:00
tuxxy 03ffe8c9cd Merge branch 'rm-crypto' of github.com:tuxxy/nucypher-kms into rm-crypto 2018-02-10 15:24:55 -07:00
tuxxy 439a80444b Add keystore models 2018-02-10 15:24:42 -07:00
jMyles 65940dd0fe Preparing to use UmbralPublicKey. 2018-02-09 20:44:16 -08:00
jMyles acc31b7757 Using UmbralPrivate key for splitting in protocols. 2018-02-09 20:38:10 -08:00
jMyles 9627dbca0e Using MessageKit for decrypting. 2018-02-09 20:37:55 -08:00
jMyles 3a1fcc349d Adding public key (assuming secp256k1) to constants 2018-02-09 20:36:15 -08:00
tuxxy 5b73db801e PEP8 changes to characters 2018-02-09 21:15:50 -07:00
tuxxy 7f7c1207ef Set HASH_DIGEST_LENGTH to 64 2018-02-09 19:52:43 -07:00
tuxxy a761466d38 Implement Umbral in Keypairs 2018-02-09 19:44:20 -07:00
tuxxy 39b70336d3 Add what I got so far -- Keypair 2018-02-09 14:25:52 -07:00
jMyles 5741702891 Fixed NameError for Signature.__bytes__. 2018-02-09 13:03:52 -08:00
jMyles 48bfbacd5d KeypairBasedPower.__init__ - @tuxxy is perhaps going to move this down to KeyPair. 2018-02-09 13:03:10 -08:00
tuxxy b694877f70 Implement ecdsa_sign in API and call it in signature 2018-02-09 13:29:04 -07:00
tuxxy ba2200487f Add what I got - KeypairBasedPower 2018-02-09 12:27:12 -07:00
tuxxy 1cafba8e34 Use 'ECDSA Signature' on __repr___ 2018-02-09 11:04:44 -07:00
tuxxy 61eb1a11f4 Merge branch 'rm-crypto' of github.com:tuxxy/nucypher-kms into rm-crypto 2018-02-09 03:44:30 -07:00
tuxxy 9eb303506d Use PyUmbral keys in Signature 2018-02-09 03:44:15 -07:00
jMyles fd8ba6670d SigningKeypair implements new ECDSA sign function. 2018-02-09 02:34:26 -08:00
jMyles c11e9c77f8 New ECDSA sign function. 2018-02-09 02:34:25 -08:00
tuxxy 75412b9a3d Remove deprecated files 2018-02-08 14:52:17 -07:00
jMyles 50aca7d66f Reflecting new location for fragments. 2018-02-07 16:22:28 -08:00
tuxxy f1a6689b7a Use umbral.KFrag and KFRAG_LENGTH for set_policy 2018-02-07 03:31:27 -07:00
jMyles 6d2c9e3d7b Reflecting deprecated crypto modules. 2018-02-07 02:16:45 -08:00
jMyles 0d964ca080 Removing various imports of the ole' fragments module. 2018-02-07 02:16:44 -08:00
tuxxy a55149fa06 Add cryptographic bytestring length constants from PyUmbral 2018-02-07 01:19:51 -07:00
tuxxy e84b772af5 Remove PRE declaration 2018-02-07 00:14:30 -07:00
tuxxy da70c11b06 Delete old code that will be replaced with pyUmbral 2018-02-06 22:07:08 -07:00
tuxxy 553ae20f09 Merge branch 'master' of github.com:nucypher/nucypher-kms 2018-02-06 18:36:58 -07:00
jMyles c6d050aca7 Making explicit which address and port are for Ursula's DHT interface. 2018-02-06 17:16:21 -08:00
jMyles cc80a065e0 Character.from_public_keys now takes a list of tuples. 2018-02-06 17:15:53 -08:00
jMyles 12f7990a09 Alice script properly sends a Contract and then, subsequently, sends a KFrag. 2018-02-06 03:08:23 -08:00
jMyles 1ff8d51515 Better doctstring for Policy. And something something agreement. 2018-02-05 23:40:21 -08:00
jMyles bdf738aef9 Serialization for Contract. 2018-02-05 23:30:07 -08:00
jMyles e263558218 Allow BytestringSplitter to use from_bytes if that method is provided. 2018-02-05 23:30:07 -08:00
jMyles 63d7990aa6 Contract Consideration is now a REST activity. 2018-02-05 23:30:07 -08:00
jMyles de3d9e6c01 Create an Ursula from a REST URL. Why not? 2018-02-05 23:30:01 -08:00
jMyles 672f796965 Some style tweaks for Character. 2018-02-05 23:08:55 -08:00
jMyles 543465b99d Implementing from_public_keys in various places. 2018-02-05 11:26:50 -08:00
jMyles 3db71115f6 Characters can now be created from either a signing or encryption key. Fixes #156. 2018-02-05 11:25:17 -08:00
jMyles b482c7a1be Only tell PowerUps to generate keys if the Character is_me. 2018-02-05 11:05:28 -08:00
jMyles 81c534041f Tracking both REST and DHT info on Ursula. 2018-02-04 23:39:40 -08:00
tuxxy 1ce78759c1
Merge branch 'master' of github.com:nucypher/nucypher-kms 2017-12-22 22:41:19 -07:00
jMyles 83aae67c7b Making Contract details explicit. 2017-12-15 21:50:36 -08:00
jMyles 6819456f43 Tearing out remainder of ChallengePack 2017-12-15 21:50:09 -08:00
jMyles 472d2f0a94 Way better docstring for Policy. 2017-12-15 21:49:45 -08:00
jMyles b30638cbf9 Doing this all on Ursula now. 2017-12-15 21:49:27 -08:00
jMyles 14071b5b9c Stepping up docstring. 2017-12-15 21:49:15 -08:00
jMyles cc7483436d Moving these splitters outta here. 2017-12-15 21:49:01 -08:00
jMyles 319b1f17a5 Instead of saving the contract in memory, saving a dict with details in preparation for a legit data store. See #127. 2017-12-15 21:48:18 -08:00
jMyles 8e0f9fb203 Ursula reconstructing contract from mock saved data. 2017-12-15 21:47:52 -08:00
jMyles 0bb62224ef With PolicyGroup gone, there's no need for these nagging managers. 2017-12-15 21:47:02 -08:00
jMyles a224487ecf Exception to raise when suspicious activity is detected and there's no other obvious recourse. 2017-12-15 21:46:14 -08:00
jMyles 9e32c72cc1 Cleaning up some imports and signatures. 2017-12-15 11:13:08 -08:00
jMyles 100e7478b6 Some PolicyGroup methods will now live on Policy. 2017-12-14 21:20:24 -08:00
jMyles 3ed0495d3c _accepted_contracts is a more accurate name than _active_contracts, and also opens up some other logic. 2017-12-14 21:19:59 -08:00
jMyles f0fe1012b9 Massive redlining of PolicyGroup. 2017-12-14 21:19:23 -08:00
jMyles 45ffae7ea4 This was an hrac all along - it was never meant to be called "pfrag" except as a quick experiment. 2017-12-14 21:18:50 -08:00
jMyles 87d25e4ce3 Pushing logic to match KFrags with Contracts down into Policy. 2017-12-14 21:18:25 -08:00
jMyles 5a96e23d40 Logic to find an unassigned kFrag and assign it to a Contract. 2017-12-14 20:36:08 -08:00
jMyles 4cf3d8aac8 Much clearer logic for finding Ursulas. 2017-12-14 20:35:56 -08:00
jMyles 5066cd1ad7 Instead of taking a single Contract, find_ursulas now makes the number of Contracts needed to offer one to each Ursula. 2017-12-14 20:35:22 -08:00
jMyles 7dd0953fa4 Alice can draw up a Contract. 2017-12-14 20:35:05 -08:00
jMyles d85776d80d Ursula is now on Contract, now Policy. 2017-12-14 20:34:47 -08:00
jMyles 5d70de739d More logic updates from Contract. 2017-12-14 20:34:30 -08:00
jMyles ef4cf13dc6 Special error for the scenario in which we have already contacted *too many* Ursulas. 2017-12-14 20:33:56 -08:00
jMyles 5ba1435c21 Moving TreasureMap to Policy (big one! :-) ) 2017-12-14 20:33:41 -08:00
jMyles 8be2c5cf4c Contract now gets updated wit REST payload instead of created anew (because Ursula has already saved it). 2017-12-14 20:33:12 -08:00
jMyles 775da4c670 Contract is identified by hrac. 2017-12-14 20:32:59 -08:00
jMyles 4927dec9e5 Ursula saves contract (although we'll want to do this in a datastore - see #127) 2017-12-14 20:32:22 -08:00
jMyles 567a9734fe Ursula saves KFrag from new Contract class. 2017-12-14 20:32:09 -08:00
jMyles 4e25a0ac04 Much better grant logic. 2017-12-14 20:31:54 -08:00
jMyles 91d46aae6a TODOs around Ursula's Contract storage. 2017-12-14 16:53:44 -08:00
jMyles 2869e1e5e1 Contract takes an Alice directly now, rather than a Policy. 2017-12-14 16:53:20 -08:00
jMyles 2667d0c131 Rolling the remaining PolicyGroup / PolicyOffer details into Contract. 2017-12-14 16:52:58 -08:00
jMyles 0a9002893e For now, Ursula stores Contracts in a dict. 2017-12-14 16:52:36 -08:00
jMyles 0fd71bf07b Enact logic to reflect new Contract. 2017-12-14 12:50:12 -08:00
jMyles fdce4e089c HRAC logic moved to Policy. PolicyGroup is losing weight! :-) 2017-12-14 12:49:50 -08:00
jMyles 4bcec28347 Moving from_ursula (ie, "other end of the wire" logic) to Contract. 2017-12-14 12:49:14 -08:00
jMyles 346883524a Ursula reconstructs the Contract at the other end of the wire. 2017-12-14 12:46:36 -08:00
jMyles 1c677efb6a Moving the rest of the enact logic to Policy. 2017-12-14 12:15:36 -08:00
jMyles 54d593f536 Rethinking PolicyOffer more broadly - it's now a Contract, which is able to formulate its own payload. 2017-12-14 12:15:10 -08:00
jMyles 021f7a25d5 .enact() for Policy 2017-12-14 12:14:37 -08:00
jMyles f68bd91510 Policy ID is immaterial now. Closes #38 wontfix. 2017-12-14 11:40:46 -08:00
jMyles f5abf099af New find_n_ursulas method for Policy. 2017-12-14 11:40:23 -08:00
jMyles 56b2fab5bc Moving activate to PolicyOffer. 2017-12-14 11:40:09 -08:00
jMyles 5638af4e9e Eh, this exception has lived in the wrong place its whole life. 2017-12-14 11:39:38 -08:00
jMyles 1fb92890bb Making KFrag hashable; preparing to use it as a key in `_active_ursulas`. 2017-12-14 11:39:17 -08:00
jMyles c4135b520f Alice passes uri and kFrags to make a Policy. 2017-12-14 11:22:20 -08:00
jMyles 847a0e0e99 Policy now takes multiple kFrags and a URI as arguments. 2017-12-14 11:22:00 -08:00
jMyles f5a0db8603 Moving craft_offer to Policy. 2017-12-14 11:21:37 -08:00
jMyles 7f7139e24f Moving 'n' to Policy. 2017-12-14 11:21:16 -08:00
jMyles 8435ddccdf Alice now makes a Policy instead of a PolicyGroup. 2017-12-14 11:20:57 -08:00
jMyles 899049c3d7 Moved pFrag down to Policy; pFrag stand-in for PolicyGroup. 2017-12-14 10:49:15 -08:00
jMyles fcc3636934 Found a pFrag that escaped refactor. 2017-12-13 20:09:34 -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 267647a07b Don't need TreasureMap setter anymore. 2017-12-13 10:32:44 -08:00
jMyles ff19d7f276 Payload has always incorrectly used the encrypted TreasureMap instead of ChallengePack - we didn't notice because we aren't doing challenges yet. 2017-12-13 10:32:10 -08:00
jMyles 38e692a526 Making it easier to get an hrac from outside PolicyGroup. 2017-12-13 10:31:31 -08:00
jMyles 6554df9c03 hash convenience method can just be static. 2017-12-13 10:31:15 -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 f8d67c83d6 BaseClass for NetworkyStuff will just return NotImplemented when asked to find a competitive rate. 2017-12-11 14:44:32 -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 1a6650f3e9 convenience method for crafting an offer from a PolicyGroup 2017-12-09 17:21:25 -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 f5ef7c6eaf Sketch of marking a WorkOrder complete. 2017-12-07 20:40:21 -08:00
jMyles 8c243ed399 A WorkOrder is only as long as its PFrags. 2017-12-07 20:38:51 -08:00
jMyles 537a782100 Pushing reencrypt logic down into actual NetworkyStuff instead of just the mock. Makes me psyched! 2017-12-07 20:37:08 -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 1f923aaeab That thing in a PolicyGroup isn't an EncryptedKey; it's a PFrag. 2017-12-05 12:54:19 -08:00
jMyles 2d4a57f463 RepeatingBytestringSplitter - to get any number of CFrags from the HTTP response. 2017-12-05 12:53:39 -08:00
jMyles 295e4c6e9b Overhaul of CFrag class; adding more robust protections. 2017-12-05 12:53:18 -08:00
jMyles 32658b08ee Reconstituting an EncryptedKey from deserialized key data. 2017-12-05 12:52:43 -08:00
jMyles 73f1a62141 Reconsituting CFrag from the full reencrypted_data payload. 2017-12-05 12:52:10 -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 61bcb62862 WorkOrder Payload simplified using PFrags. 2017-12-04 17:18:23 -08:00
jMyles 6e3d8bb7b5 REST Response is bytestream of concat'd cFrags. 2017-12-04 17:17:56 -08:00
jMyles d90a2649e9 Can't represent pfrag as bytes; this is a blocker for now. See #137. 2017-12-04 17:17:28 -08:00
jMyles baa27f53f7 Storing encrypted key (ie, pfrag) as part of PolicyGroup. 2017-12-04 17:17:28 -08:00
jMyles c4cbff3359 Tests that show Bob that Bob is able to issue a WorkOrder via REST. 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 c624f3c3d5 WorkOrder class. 2017-12-04 17:17:28 -08:00
jMyles ff04578dc3 CFrag and tests. 2017-12-04 17:17:13 -08:00
jMyles 2100acb680 Implemented PFrag in API. Closes #137. 2017-12-04 16:27:32 -08:00
jMyles ceb39d4ab7 PFrag class. 2017-12-04 16:26:52 -08:00
jMyles 4fab47cac3 Proper dunders with tests for kfrag retrieval and deserialization. Fixes #138. 2017-12-04 15:23:40 -08:00
jMyles 8ce87a3369 Better kfrag splitter. Reveals that test_kfrag_sqlite wasn't actually testing kfrag reconstruction. See #138. 2017-12-04 14:39:53 -08:00
jMyles 60d5846774 Don't need the part lengths anymore. 2017-12-04 14:38:43 -08:00
jMyles 9f41dfd06c Using KFrag with BytestringSplitter. Feels good. 2017-12-04 14:14:56 -08:00
jMyles 2fc80d3414 Providing KFrag compatibility. 2017-12-04 13:58:11 -08:00
jMyles 07ddefa909 Making API return KFrag instances. 2017-12-04 13:57:55 -08:00
jMyles 7ebe8eb56c First sketch of KFrag class. 2017-12-04 13:08:21 -08:00
jMyles 75dc1b011a Sketching things out here. 2017-12-02 17:33:49 -08:00
tuxxy f4afbc462a
Add Policy model 2017-11-29 12:47:39 -07: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 16be6e3b97 Another variable type hint removal. 2017-11-22 09:27:58 -08:00
jMyles f7539f7575 Python 3.5 doesn't like inline type-hints for variables. This can be a class anyway. 2017-11-22 09:23:40 -08:00
jMyles d250a2bd4a find_n_ursulas no longer returns a list. 2017-11-21 22:13:35 -08:00
jMyles 08644afc5d Type hint for list in blockchain_client. 2017-11-21 22:13:11 -08:00
jMyles 47328e8941 Default methods for Keypair. 2017-11-21 22:12:50 -08:00
jMyles a3b9960fbd Added sentinel for missing return value - see https://github.com/python/mypy/issues/4223#issuecomment-342865133. 2017-11-21 22:12:27 -08:00
jMyles 5f4b5f5cca Type for Keypair class. 2017-11-21 22:10:47 -08:00
jMyles e34ddef071 New names for return values. 2017-11-21 22:10:27 -08:00
jMyles fce308fc62 Fixed some tuple type hints with the proper number of expected members. 2017-11-21 22:09:58 -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 167ee66aa0 Changing fixture 'fake_ursulas' to just 'ursulas'. 2017-11-21 22:06:52 -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 2f0b483ba3 Not using msgpack for protocols anymore! All concat and split now. 2017-11-21 20:21:02 -08:00
jMyles 29d4089da1 Just a fake list for now as a blockchain client. 2017-11-21 20:20:38 -08:00
jMyles 4c507fe22d Some cleanup; better docstring for Character.__init__ 2017-11-21 20:20:15 -08:00
jMyles 436f2b1c05 Actually, we weren't using the rest module. 2017-11-21 12:41:32 -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 c0639349c7 Changed method to 'enact_policy'. Move HRAC to URL instead of HTTPS payload. 2017-11-20 19:23:25 -08:00
jMyles 8be498629b Fixed length of test bytes for keystore. 2017-11-20 19:20:18 -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 ac34d2667d Serializing keyfrag data before concat'ing it. See #126. 2017-11-19 11:59:35 -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 63a10aef67 Changing 'animate' to 'enact'. 2017-11-18 19:21:32 -08:00
jMyles 31687af4f3 Convenience method for creating Characters from pubkey_sig_bytes. 2017-11-18 19:17:52 -08:00
jMyles c0920b709d Splitting on the other end of the wire works! 2017-11-18 14:33:54 -08:00
jMyles a39146cac9 Using PublicKey in deserialization. 2017-11-18 14:33:33 -08:00
jMyles 1baf8123ee Length check for PublicKey while checking Signature. 2017-11-18 14:31:27 -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 7c3b62fb58 Beginning of creation of Policy from bytes payload. 2017-11-18 13:33:31 -08:00
jMyles 753905f04f Ursula receives a Policy.payload via REST. 2017-11-18 13:33:31 -08:00
jMyles 9782649a5b Policy payload encryption for Ursula. 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 2b8f0c9ddc Basic structure of kFrag routes. 2017-11-18 13:29:55 -08:00
jMyles 6f23832462 REST Directory. 2017-11-18 13:29:55 -08:00
jMyles 5a36280788 Ridculous try block no longer needed. 2017-11-18 13:16:41 -08:00
jMyles bcb8849533 Use PublicKey for splitter. 2017-11-18 13:16:26 -08:00
jMyles 291775e6b7 Signature.verify() uses PublicKey.without_metabytes() 2017-11-18 13:14:29 -08:00
jMyles fc08f6f4dd No more need for PUBKEY_SIG_LENGTH - this is on PublicKey now. 2017-11-18 13:13:59 -08:00
jMyles c4421d9e9d Added metabytes to public key generation; fixed some PEP8 issues in API. 2017-11-18 13:13:14 -08:00
jMyles 098da6dc21 PublicKey class. 2017-11-18 13:11:27 -08:00
jMyles e8cfed52e6 Raises ValueError if keypair_byte doesn't match. Fixes #123. 2017-11-18 11:18:12 -08:00
tuxxy 8906d89450
Use BytestringSplitter for kFrag in KeyStore 2017-11-14 16:26:06 -07:00