Commit Graph

41 Commits

Author SHA1 Message Date
Sergi Delgado Segura
df5dcbdfe9 Renames dispute_delta to to_self_delay and justice tx to penalty tx
Uses the naming convention followed by LN implementations and BOLTs
2019-12-11 12:45:05 +01:00
Sergi Delgado Segura
d39056a0cc Refactors signing/verifiying functionality to be part of the Cryptographer
- All encryption/decryption and signing/verifying calls are performed by the cryptographer now.

- The current signature format is temporal. We should define something not base on json.

- Some Cryptographer tests are still missing.

- The cli tests should be modified to fit this too.
2019-12-07 13:22:39 +01:00
Sergi Delgado Segura
ae676e6632 Changes key encoding format from PEM to DER 2019-12-07 13:22:13 +01:00
Sergi Delgado Segura
a8800ac375 Integrates encryption/decryption within the Cryptographer. Close #63
Includes unittests. Also reformats test_inspector to avoid using cli functions
2019-12-06 13:23:02 +01:00
Sergi Delgado Segura
b4197aa5bb Replaces hardcoded 16/32 for LOCATOR lengths 2019-12-05 11:26:58 +01:00
Sergi Delgado Segura
f0150ce585 Removes hash/cipher configuration and changes AESGCM128 for CHACHA20POLY1305
Updates tests accordingly
2019-12-04 17:46:07 +01:00
Turtle
79d986677d Client signs appointment before sending it to server 2019-11-26 23:21:00 -05:00
Sergi Delgado Segura
20f296c9d4 Reformats code to match code guidelines 2019-11-07 15:47:35 +00:00
Salvatore Ingala
00a27b68e6 Various fixes from PR review 2019-11-07 15:04:21 +00:00
Salvatore Ingala
c786e3d225 Refactored add_appointment and get_appointment to avoid block nesting 2019-11-07 15:04:21 +00:00
Salvatore Ingala
21db172727 Refactored pisa_cli to improve testability; added test with wrong signature returned 2019-11-07 15:04:21 +00:00
Salvatore Ingala
956d7091eb Initial tests for pisa-cli 2019-11-07 15:04:21 +00:00
Salvatore Ingala
75b28e9bce Moved return inside the try branch, following up on PR review 2019-10-28 11:34:00 +07:00
Salvatore Ingala
bc9c513317 Fix import with absolute path instead of local 2019-10-28 11:07:42 +07:00
Salvatore Ingala
df9a1173a5 Minor refactoring of test_watcher; revert change DEFAULT_PISA_API_SERVER to correct value 2019-10-25 15:03:57 +08:00
Salvatore Ingala
21b54f048e Refactored error handling in add_appointment; minor comments from PR review 2019-10-25 14:51:15 +08:00
Salvatore Ingala
b55355e564 pisa-cli saving appointments and signatures to disk on success 2019-10-25 13:50:16 +08:00
Salvatore Ingala
6348d15cea Moved Logger from __init__ into separate file 2019-10-25 10:39:09 +08:00
Salvatore Ingala
edd6eec2a8 Removed global pisa_public_key, only use locally within is_appointment_signature_valid 2019-10-25 09:54:49 +08:00
Salvatore Ingala
8ab01a5eee Added Logger class to pisa-cli to avoid imports from pisa; changed log file name to pisa-cli.log 2019-10-24 14:44:04 +08:00
Salvatore Ingala
e678dfc661 Fix name fields {start,end}_block --> {start_end}_time; forgot to declare access to global variable 2019-10-24 12:53:44 +08:00
Salvatore Ingala
3658f44996 remove whitespace for PEP8 2019-10-24 12:33:55 +08:00
Salvatore Ingala
b633c89724 Several fixes from PR review 2019-10-23 22:33:34 +08:00
Salvatore Ingala
9b1af92fc3 Minor fixes 2019-10-22 18:59:27 +08:00
Salvatore Ingala
b39f7ef55b Fix appointment serialization 2019-10-22 15:00:44 +08:00
Salvatore Ingala
3657e0877a Forgot parameter in formatting error 2019-10-22 14:33:04 +08:00
Salvatore Ingala
503cb8ce41 Refactored validation logic; improved error handling; avoid loading the key unnecessarily 2019-10-22 14:29:08 +08:00
Salvatore Ingala
1601f0ca15 Renamed constants and default file names for Pisa's private and public keys 2019-10-22 12:13:12 +08:00
Salvatore Ingala
7fadde556a Fixed client side signature checking 2019-10-18 19:16:35 +08:00
Salvatore Ingala
a73b14bf13 Fix signature verificatio in pisa-cli 2019-10-18 15:40:57 +08:00
Salvatore Ingala
ca64b59277 Added signature verification to pisa_cli 2019-10-18 14:56:59 +08:00
Salvatore Ingala
9f25ef8603 Fixes from PR review 2019-10-10 18:22:33 +07:00
Salvatore Ingala
aea1d1f1e0 Fixes from PR review 2019-10-10 11:07:58 +07:00
Salvatore Ingala
dee93e5c62 Moved StructuredMessage and Logger to separate file; refactored pisa-cli logging using new format 2019-10-10 09:59:11 +07:00
Sergi Delgado Segura
ab1ad33e32 Adds Blob unittests and Blob sanity checks 2019-10-07 17:22:19 +01:00
Sergi Delgado Segura
10656c5955 Updates Blob Exception
Blob was raising general Exceptions when a ValueError should be a better match
2019-10-07 16:48:06 +01:00
Sergi Delgado Segura
76f0b1934a Client-side clean up 2019-10-07 15:59:52 +01:00
Sergi Delgado Segura
067efcca73 Clean unused imports and more cleanup 2019-10-07 11:58:28 +01:00
Sergi Delgado Segura
5ae210d893 Updates os.urandom to python3
All string generated with urandom(x) were using binascii + os.urandom + encode. In python3 os.urandom has a hex method.
2019-10-07 11:39:10 +01:00
Sergi Delgado Segura
0978d0bf9e Adds a bunch of comments related to the open issues. Clear old comments. 2019-08-12 14:02:41 +01:00
Sergi Delgado Segura
1cde4a2a11 refactors project structure 2019-08-12 13:24:04 +01:00