Commit Graph

31 Commits

Author SHA1 Message Date
Sergi Delgado Segura
71507d4c32 Gets rid of blob classes. Close #66 2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
ed8ff228d8 First commands with basic structure.
- Moves DBManager to common.
2020-04-20 17:30:15 +02:00
Sergi Delgado Segura
f350182012 sign_recoverable can raise a ValueError, handling it. 2020-04-03 21:56:42 +02:00
Sergi Delgado Segura
10e856ae74 Fixes typos according to the review 2020-04-03 16:38:46 +02:00
Sergi Delgado Segura
fe73ee7298 Fixes comments, docstrings and some renamings 2020-04-02 15:20:09 +02:00
Sergi Delgado Segura
0e392d1f2a Cryptographer.sigrec_decode assumed signatures where properly encoded.
- Fixes a bug in sigrec_decode where the decoding function assumend that the first by was formatted as 31 + SigRec. Non properly encoded signatures made the function to crash due to an overflow (int_to_bytes(x) for negative x)
2020-04-01 17:04:33 +02:00
Sergi Delgado Segura
b56123055d Adds flake8 and fixes style issues 2020-03-31 13:06:44 +02:00
Sergi Delgado Segura
c0ada5f818 Improves logging messages 2020-03-30 13:06:35 +02:00
Sergi Delgado Segura
ae68cd33da Captures TypeErrors in Cryptographer.get_compressed_pk and adds unit tests 2020-03-27 16:50:47 +01:00
Sergi Delgado Segura
bbe93ae3f1 Adds RIPMED160 hash function 2020-03-26 17:13:38 +01:00
Sergi Delgado Segura
4fad6b7b6f Fixes docstring 2020-03-26 17:09:15 +01:00
Sergi Delgado Segura
83b3913cb5 Adds basic authentication logic.
+ Users need to be registered in order to send appointments (free registration for now)
+ The tower gives them a number of appointments to work with
+ Non-registered users and users with no enough appoitnemnts slots return the same error (to avoid proving)

- Authentication does not cover get_* requests yet
- No tests
- No docs
2020-03-25 17:13:35 +01:00
Sergi Delgado Segura
b712e3df0c Changes sign/verify functions to match the ones used by lnd and c-lightning
- Replaces cryptography for coincurve for the signature / recovery operations
- Fixes return types of ecrypt, decrypt to be str (gets rid of rtype)
2020-02-21 13:11:06 +01:00
Sergi Delgado Segura
de2036b19b Fixes cli console log levels so Cryptographer's sensitive info is only logged in disk 2020-02-14 12:42:47 +01:00
Sergi Delgado Segura
02e159faac Moves EncryptedBlob to common 2020-02-13 16:32:51 +01:00
Sergi Delgado Segura
d447debe54 Temporal fix for Cryptographer logs. Close #91 2020-02-11 20:22:51 +01:00
Sergi Delgado Segura
ab21cbfc8f Moves load_key_file to Cryptographer and updates pisad to use it 2020-02-10 16:31:48 +01:00
Sergi Delgado Segura
2559d143aa Fixes logging 2020-01-21 19:06:29 +01:00
Sergi Delgado Segura
a69f1ba28b Moves appointment to common and creates serialize
Appointment serialization used to be part of the cryptographer (signature_format) but it makes more sense to be an appointment method. Therefore cli also need Appointment

Also fixes comments based on reviews
2019-12-17 16:21:54 +01:00
Sergi Delgado Segura
46a7fa824f Removes unnecessary encoding when unhexlifying
binascii.unhexlify(x) is equal to binascii.unhexlify(x.encode())
2019-12-17 11:35:28 +01:00
Sergi Delgado Segura
1184b4648a Fixes logs and removes redundant tailing dots 2019-12-16 19:45:30 +01:00
Sergi Delgado Segura
77b191dde2 Moves Logger to common 2019-12-16 14:15:30 +01:00
Sergi Delgado Segura
d37b6b6de2 Merge branch 'master' into 46-docstrings 2019-12-16 12:02:04 +01:00
Sergi Delgado Segura
a7eb22626e Some fixes based on review comments 2019-12-16 11:58:14 +01:00
Sergi Delgado Segura
e6fd9f77cf Fixes return types for cryptographer 2019-12-16 10:25:33 +01:00
Sergi Delgado Segura
83c73d5df4 Docstrings for common package 2019-12-13 18:13:29 +01:00
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
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
5f7cd7e189 Delete old TODOs 2019-12-05 11:34:44 +01:00
Sergi Delgado Segura
babb746dbd Create common package
Moves cryptographer to common. Also adds constants and defines the leghtn of the locator to avoid hardcoding it in almost every file
2019-12-05 11:02:17 +01:00